From 9d55f712e3880927bcbc39bf4da7f4166ea94a91 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 12 Apr 2021 18:38:13 +0200 Subject: render: introduce wlr_texture_from_buffer This adds a a function to create a wlr_texture from a wlr_buffer. The main motivation for this is to allow the renderer to create a single wlr_texture per wlr_buffer. This can avoid needless imports by re-using existing textures. --- include/wlr/render/interface.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/wlr/render/interface.h') diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index f280852c..251154d8 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -57,6 +57,8 @@ struct wlr_renderer_impl { struct wl_display *wl_display); int (*get_drm_fd)(struct wlr_renderer *renderer); uint32_t (*get_render_buffer_caps)(void); + struct wlr_texture *(*texture_from_buffer)(struct wlr_renderer *renderer, + struct wlr_buffer *buffer); }; void wlr_renderer_init(struct wlr_renderer *renderer, -- cgit v1.2.3