aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Bozhinov <ammen99@gmail.com>2020-11-19 11:28:32 +0100
committerSimon Ser <contact@emersion.fr>2020-11-19 11:35:04 +0100
commit6284af121fd1427eaefb043ea03363c969f2df3f (patch)
tree6c56934a22b5d0541c210fda1b6eb60293b43ac4
parentdc7c6c4860e03193513ca2f0d0adf563318f6b15 (diff)
texture: document that functions should not be called while rendering
-rw-r--r--include/wlr/render/wlr_texture.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/wlr/render/wlr_texture.h b/include/wlr/render/wlr_texture.h
index 71ce5e7c..3a4840ac 100644
--- a/include/wlr/render/wlr_texture.h
+++ b/include/wlr/render/wlr_texture.h
@@ -24,6 +24,9 @@ struct wlr_texture {
/**
* Create a new texture from raw pixel data. `stride` is in bytes. The returned
* texture is mutable.
+ *
+ * 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_pixels(struct wlr_renderer *renderer,
enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width, uint32_t height,
@@ -32,12 +35,18 @@ struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
/**
* Create a new texture from a wl_drm resource. The returned texture is
* immutable.
+ *
+ * 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_wl_drm(struct wlr_renderer *renderer,
struct wl_resource *data);
/**
* Create a new texture from a DMA-BUF. The returned texture is immutable.
+ *
+ * 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_dmabuf(struct wlr_renderer *renderer,
struct wlr_dmabuf_attributes *attribs);
@@ -58,6 +67,9 @@ bool wlr_texture_is_opaque(struct wlr_texture *texture);
/**
* Update a texture with raw pixels. The texture must be mutable, and the input
* data must have the same pixel format that the texture was created with.
+ *
+ * Should not be called in a rendering block like renderer_begin()/end() or
+ * between attaching a renderer to an output and committing it.
*/
bool wlr_texture_write_pixels(struct wlr_texture *texture,
uint32_t stride, uint32_t width, uint32_t height,