wlr_scene: Pull scene_node_get_root into a private header

We will need this for surface emulation on buffers.
This commit is contained in:
Alexander Orzechowski 2022-05-19 14:01:44 -04:00
parent 39c059b70e
commit 5f56246571
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,8 @@
#ifndef TYPES_WLR_SCENE_H
#define TYPES_WLR_SCENE_H
#include <wlr/types/wlr_scene.h>
struct wlr_scene *scene_node_get_root(struct wlr_scene_node *node);
#endif

View file

@ -10,6 +10,7 @@
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <wlr/util/region.h> #include <wlr/util/region.h>
#include "types/wlr_scene.h"
#include "util/signal.h" #include "util/signal.h"
static struct wlr_scene *scene_root_from_node(struct wlr_scene_node *node) { static struct wlr_scene *scene_root_from_node(struct wlr_scene_node *node) {
@ -35,7 +36,7 @@ struct wlr_scene_buffer *wlr_scene_buffer_from_node(
return (struct wlr_scene_buffer *)node; return (struct wlr_scene_buffer *)node;
} }
static struct wlr_scene *scene_node_get_root(struct wlr_scene_node *node) { struct wlr_scene *scene_node_get_root(struct wlr_scene_node *node) {
while (node->parent != NULL) { while (node->parent != NULL) {
node = node->parent; node = node->parent;
} }