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/render/wlr_texture.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/render/wlr_texture.h (limited to 'include/render') diff --git a/include/render/wlr_texture.h b/include/render/wlr_texture.h new file mode 100644 index 00000000..eb94824f --- /dev/null +++ b/include/render/wlr_texture.h @@ -0,0 +1,15 @@ +#ifndef RENDER_WLR_TEXTURE_H +#define RENDER_WLR_TEXTURE_H + +#include + +/** + * Create a new texture from a buffer. + * + * Should not be called in a rendering block like renderer_begin()/end() or + * between attaching a renderer to an output and committing it. + */ +struct wlr_texture *wlr_texture_from_buffer(struct wlr_renderer *renderer, + struct wlr_buffer *buffer); + +#endif -- cgit v1.2.3