From 63040d67448ad710fb3536b86d0e417b06783079 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 20 Sep 2021 17:41:52 +0200 Subject: scene: add wlr_scene_buffer_set_source_box --- include/wlr/types/wlr_scene.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/wlr') 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 */ @@ -211,6 +212,15 @@ void wlr_scene_rect_set_color(struct wlr_scene_rect *rect, const float color[sta 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. * -- cgit v1.2.3