wlr_scene: Pull scene_node_get_root into a private header

We will need this for surface emulation on buffers.
Alexander Orzechowski 3 years ago
parent 39c059b70e
commit 5f56246571

@ -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

@ -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;
} }

Loading…
Cancel
Save