aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-09-20 17:41:52 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-09-22 10:45:39 -0600
commit63040d67448ad710fb3536b86d0e417b06783079 (patch)
tree2e9b83e1be5d87c8fbff45faee022dee5b93c5b4 /include/wlr
parentfdc22449d6f7ac38388812d7f0da7c93e110d28a (diff)
scene: add wlr_scene_buffer_set_source_box
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_scene.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h
index 7548bb3e..93be43d0 100644
--- a/include/wlr/types/wlr_scene.h
+++ b/include/wlr/types/wlr_scene.h
@@ -94,6 +94,7 @@ struct wlr_scene_buffer {
// private state
struct wlr_texture *texture;
+ struct wlr_fbox src_box;
};
/** A viewport for an output in the scene-graph */
@@ -212,6 +213,15 @@ struct wlr_scene_buffer *wlr_scene_buffer_create(struct wlr_scene_node *parent,
struct wlr_buffer *buffer);
/**
+ * Set the source rectangle describing the region of the buffer which will be
+ * sampled to render this node. This allows cropping the buffer.
+ *
+ * If NULL, the whole buffer is sampled. By default, the source box is NULL.
+ */
+void wlr_scene_buffer_set_source_box(struct wlr_scene_buffer *scene_buffer,
+ const struct wlr_fbox *box);
+
+/**
* Add a viewport for the specified output to the scene-graph.
*
* An output can only be added once to the scene-graph.