render: constify struct wlr_buffer_pass_options

Let's not allow renderer implementations to mutate the passed in
options.
This commit is contained in:
Simon Ser 2023-07-10 11:31:01 +02:00
parent fe06e5f49a
commit b7dca21c2b
6 changed files with 6 additions and 6 deletions

View file

@ -49,7 +49,7 @@ struct wlr_renderer_impl {
struct wlr_texture *(*texture_from_buffer)(struct wlr_renderer *renderer,
struct wlr_buffer *buffer);
struct wlr_render_pass *(*begin_buffer_pass)(struct wlr_renderer *renderer,
struct wlr_buffer *buffer, struct wlr_buffer_pass_options *options);
struct wlr_buffer *buffer, const struct wlr_buffer_pass_options *options);
struct wlr_render_timer *(*render_timer_create)(struct wlr_renderer *renderer);
};

View file

@ -177,7 +177,7 @@ struct wlr_buffer_pass_options {
* render pass.
*/
struct wlr_render_pass *wlr_renderer_begin_buffer_pass(struct wlr_renderer *renderer,
struct wlr_buffer *buffer, struct wlr_buffer_pass_options *options);
struct wlr_buffer *buffer, const struct wlr_buffer_pass_options *options);
/**
* Submit the render pass.

View file

@ -552,7 +552,7 @@ static void gles2_destroy(struct wlr_renderer *wlr_renderer) {
}
static struct wlr_render_pass *gles2_begin_buffer_pass(struct wlr_renderer *wlr_renderer,
struct wlr_buffer *wlr_buffer, struct wlr_buffer_pass_options *options) {
struct wlr_buffer *wlr_buffer, const struct wlr_buffer_pass_options *options) {
struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
if (!wlr_egl_make_current(renderer->egl)) {
return NULL;

View file

@ -493,7 +493,7 @@ static uint32_t pixman_get_render_buffer_caps(struct wlr_renderer *renderer) {
}
static struct wlr_render_pass *pixman_begin_buffer_pass(struct wlr_renderer *wlr_renderer,
struct wlr_buffer *wlr_buffer, struct wlr_buffer_pass_options *options) {
struct wlr_buffer *wlr_buffer, const struct wlr_buffer_pass_options *options) {
struct wlr_pixman_renderer *renderer = get_renderer(wlr_renderer);
struct wlr_pixman_buffer *buffer = get_buffer(renderer, wlr_buffer);

View file

@ -1922,7 +1922,7 @@ static uint32_t vulkan_get_render_buffer_caps(struct wlr_renderer *wlr_renderer)
}
static struct wlr_render_pass *vulkan_begin_buffer_pass(struct wlr_renderer *wlr_renderer,
struct wlr_buffer *buffer, struct wlr_buffer_pass_options *options) {
struct wlr_buffer *buffer, const struct wlr_buffer_pass_options *options) {
struct wlr_vk_renderer *renderer = vulkan_get_renderer(wlr_renderer);
struct wlr_vk_render_buffer *render_buffer = get_render_buffer(renderer, buffer);

View file

@ -415,7 +415,7 @@ int wlr_renderer_get_drm_fd(struct wlr_renderer *r) {
}
struct wlr_render_pass *wlr_renderer_begin_buffer_pass(struct wlr_renderer *renderer,
struct wlr_buffer *buffer, struct wlr_buffer_pass_options *options) {
struct wlr_buffer *buffer, const struct wlr_buffer_pass_options *options) {
if (!renderer->impl->begin_buffer_pass) {
return begin_legacy_buffer_render_pass(renderer, buffer);
}