Merge branch 'wlr_scene_tree-clip' into 'master'

Added a method of optionally clipping wlr_scene_tree children

See merge request wlroots/wlroots!5276
This commit is contained in:
Erik Reider 2026-03-23 14:44:33 +01:00
commit 333725fd62
2 changed files with 86 additions and 8 deletions

View file

@ -92,6 +92,11 @@ struct wlr_scene_tree {
struct wlr_scene_node node;
struct wl_list children; // wlr_scene_node.link
struct {
// The clipping region in the tree nodes-local coordinate space
struct wlr_box clip;
} WLR_PRIVATE;
};
/** The root scene-graph node. */
@ -386,6 +391,17 @@ void wlr_scene_set_color_manager_v1(struct wlr_scene *scene, struct wlr_color_ma
*/
struct wlr_scene_tree *wlr_scene_tree_create(struct wlr_scene_tree *parent);
/**
* Sets a cropping region for any nodes that are children of this scene tree.
* Note that clip boxes cascade down the tree, as in the clip boxes are
* intersected with each other from the root to the leaves.
* The clip coordinate space will be that of the tree node.
*
* A NULL or empty clip will disable clipping.
*/
void wlr_scene_tree_set_clip(struct wlr_scene_tree *tree,
const struct wlr_box *clip);
/**
* Add a node displaying a single surface to the scene-graph.
*