From c5a3c5ca4cc4ee664bb4b4edad77dba8c36b0a21 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Thu, 30 Nov 2023 20:01:12 -0500 Subject: render: Implement texture_preferred_read_format --- render/pixman/renderer.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'render/pixman') diff --git a/render/pixman/renderer.c b/render/pixman/renderer.c index 2c92e662..13049e8f 100644 --- a/render/pixman/renderer.c +++ b/render/pixman/renderer.c @@ -115,8 +115,16 @@ static bool texture_read_pixels(struct wlr_texture *wlr_texture, return true; } +static uint32_t pixman_texture_preferred_read_format(struct wlr_texture *wlr_texture) { + struct wlr_pixman_texture *texture = get_texture(wlr_texture); + + pixman_format_code_t pixman_format = pixman_image_get_format(texture->image); + return get_drm_format_from_pixman(pixman_format); +} + static const struct wlr_texture_impl texture_impl = { .read_pixels = texture_read_pixels, + .preferred_read_format = pixman_texture_preferred_read_format, .destroy = texture_destroy, }; -- cgit v1.2.3