From 6832ae14aaa659929ea13057616db34536f7f724 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 3 Oct 2022 11:44:21 +0200 Subject: [PATCH] render: drop wlr_renderer_read_pixels() flags These are unused. --- backend/x11/output.c | 2 +- include/wlr/render/interface.h | 2 +- include/wlr/render/wlr_renderer.h | 9 +-------- render/gles2/renderer.c | 6 +----- render/pixman/renderer.c | 2 +- render/vulkan/renderer.c | 2 +- render/wlr_renderer.c | 4 ++-- types/wlr_screencopy_v1.c | 12 ++++-------- 8 files changed, 12 insertions(+), 27 deletions(-) diff --git a/backend/x11/output.c b/backend/x11/output.c index f109757d..6182258e 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -407,7 +407,7 @@ static bool output_cursor_to_picture(struct wlr_x11_output *output, } bool result = wlr_renderer_read_pixels( - renderer, DRM_FORMAT_ARGB8888, NULL, + renderer, DRM_FORMAT_ARGB8888, stride, buffer->width, buffer->height, 0, 0, 0, 0, data); diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index 20d755f9..e347f29b 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -40,7 +40,7 @@ struct wlr_renderer_impl { struct wlr_renderer *renderer); uint32_t (*preferred_read_format)(struct wlr_renderer *renderer); bool (*read_pixels)(struct wlr_renderer *renderer, uint32_t fmt, - uint32_t *flags, uint32_t stride, uint32_t width, uint32_t height, + uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data); void (*destroy)(struct wlr_renderer *renderer); diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h index 50ba6b21..e240897d 100644 --- a/include/wlr/render/wlr_renderer.h +++ b/include/wlr/render/wlr_renderer.h @@ -14,10 +14,6 @@ #include #include -enum wlr_renderer_read_pixels_flags { - WLR_RENDERER_READ_PIXELS_Y_INVERT = 1, -}; - struct wlr_renderer_impl; struct wlr_drm_format_set; struct wlr_buffer; @@ -90,12 +86,9 @@ const struct wlr_drm_format_set *wlr_renderer_get_dmabuf_texture_formats( /** * Reads out of pixels of the currently bound surface into data. `stride` is in * bytes. - * - * If `flags` is not NULl, the caller indicates that it accepts frame flags - * defined in enum wlr_renderer_read_pixels_flags. */ bool wlr_renderer_read_pixels(struct wlr_renderer *r, uint32_t fmt, - uint32_t *flags, uint32_t stride, uint32_t width, uint32_t height, + uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data); /** diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index c00a7f51..354584e5 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -415,7 +415,7 @@ static uint32_t gles2_preferred_read_format( } static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer, - uint32_t drm_format, uint32_t *flags, uint32_t stride, + uint32_t drm_format, uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data) { struct wlr_gles2_renderer *renderer = @@ -464,10 +464,6 @@ static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer, pop_gles2_debug(renderer); - if (flags != NULL) { - *flags = 0; - } - return glGetError() == GL_NO_ERROR; } diff --git a/render/pixman/renderer.c b/render/pixman/renderer.c index d4833f29..d7ed3eae 100644 --- a/render/pixman/renderer.c +++ b/render/pixman/renderer.c @@ -457,7 +457,7 @@ static uint32_t pixman_preferred_read_format( } static bool pixman_read_pixels(struct wlr_renderer *wlr_renderer, - uint32_t drm_format, uint32_t *flags, uint32_t stride, + uint32_t drm_format, uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data) { struct wlr_pixman_renderer *renderer = get_renderer(wlr_renderer); diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c index 4d134877..b978ad46 100644 --- a/render/vulkan/renderer.c +++ b/render/vulkan/renderer.c @@ -970,7 +970,7 @@ static void vulkan_destroy(struct wlr_renderer *wlr_renderer) { } static bool vulkan_read_pixels(struct wlr_renderer *wlr_renderer, - uint32_t drm_format, uint32_t *flags, uint32_t stride, + uint32_t drm_format, uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data) { // TODO: implement! diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 55a5d989..2d6481f0 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -194,13 +194,13 @@ uint32_t renderer_get_render_buffer_caps(struct wlr_renderer *r) { } bool wlr_renderer_read_pixels(struct wlr_renderer *r, uint32_t fmt, - uint32_t *flags, uint32_t stride, uint32_t width, uint32_t height, + uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data) { if (!r->impl->read_pixels) { return false; } - return r->impl->read_pixels(r, fmt, flags, stride, width, height, + return r->impl->read_pixels(r, fmt, stride, width, height, src_x, src_y, dst_x, dst_y, data); } diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c index 88290eee..4ca659a4 100644 --- a/types/wlr_screencopy_v1.c +++ b/types/wlr_screencopy_v1.c @@ -190,7 +190,7 @@ static void frame_send_ready(struct wlr_screencopy_frame_v1 *frame, } static bool frame_shm_copy(struct wlr_screencopy_frame_v1 *frame, - struct wlr_buffer *src_buffer, uint32_t *flags) { + struct wlr_buffer *src_buffer) { struct wlr_output *output = frame->output; struct wlr_renderer *renderer = output->renderer; assert(renderer); @@ -208,16 +208,13 @@ static bool frame_shm_copy(struct wlr_screencopy_frame_v1 *frame, return false; } - uint32_t renderer_flags = 0; bool ok = false; if (!wlr_renderer_begin_with_buffer(renderer, src_buffer)) { goto out; } - ok = wlr_renderer_read_pixels(renderer, format, &renderer_flags, + ok = wlr_renderer_read_pixels(renderer, format, stride, width, height, x, y, 0, 0, data); wlr_renderer_end(renderer); - *flags = renderer_flags & WLR_RENDERER_READ_PIXELS_Y_INVERT ? - ZWLR_SCREENCOPY_FRAME_V1_FLAGS_Y_INVERT : 0; out: wlr_buffer_end_data_ptr_access(frame->buffer); @@ -293,14 +290,13 @@ static void frame_handle_output_commit(struct wl_listener *listener, wl_list_remove(&frame->output_commit.link); wl_list_init(&frame->output_commit.link); - uint32_t flags = 0; bool ok; switch (frame->buffer_cap) { case WLR_BUFFER_CAP_DMABUF: ok = frame_dma_copy(frame, buffer); break; case WLR_BUFFER_CAP_DATA_PTR: - ok = frame_shm_copy(frame, buffer, &flags); + ok = frame_shm_copy(frame, buffer); break; default: abort(); // unreachable @@ -311,7 +307,7 @@ static void frame_handle_output_commit(struct wl_listener *listener, return; } - zwlr_screencopy_frame_v1_send_flags(frame->resource, flags); + zwlr_screencopy_frame_v1_send_flags(frame->resource, 0); frame_send_damage(frame); frame_send_ready(frame, event->when); frame_destroy(frame);