wlr_scene: Make scene_tree_from_node public

This is to allow for compositors that want to be more implicit about
how their scene is organized. Such a compositor may want to walk up
at a certain scene node to find something such as a surface to focus on.
This commit is contained in:
Alexander Orzechowski 2022-06-05 13:06:18 -04:00 committed by Simon Ser
parent 61c157269e
commit 88f80c4a7c
2 changed files with 16 additions and 10 deletions

View file

@ -323,6 +323,12 @@ struct wlr_scene_surface *wlr_scene_surface_create(struct wlr_scene_tree *parent
*/
struct wlr_scene_buffer *wlr_scene_buffer_from_node(struct wlr_scene_node *node);
/**
* If this node represents a wlr_scene_tree, that tree will be returned. It
* is not legal to feed a node that does not represent a wlr_scene_tree.
*/
struct wlr_scene_tree *wlr_scene_tree_from_node(struct wlr_scene_node *node);
/**
* If this buffer is backed by a surface, then the struct wlr_scene_surface is
* returned. If not, NULL will be returned.