aboutsummaryrefslogtreecommitdiff
path: root/render/wlr_renderer.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/wlr_renderer.c')
-rw-r--r--render/wlr_renderer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index 31bf2b18..10dc6db2 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -139,6 +139,15 @@ int wlr_renderer_get_dmabuf_modifiers(struct wlr_renderer *r, int format,
return r->impl->get_dmabuf_modifiers(r, format, modifiers);
}
+bool wlr_renderer_preferred_read_format(struct wlr_renderer *r,
+ enum wl_shm_format *fmt) {
+ if (!r->impl->preferred_read_format || !r->impl->read_pixels) {
+ return false;
+ }
+ *fmt = r->impl->preferred_read_format(r);
+ return true;
+}
+
bool wlr_renderer_read_pixels(struct wlr_renderer *r, enum wl_shm_format fmt,
uint32_t *flags, 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,