From dc9bc5683ad3427afddc04afb383dd56723b9016 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Thu, 19 May 2022 14:26:50 -0400 Subject: wlr_scene: Refactor wlr_scene_surface to be a helper on top of wlr_scene_buffer --- include/wlr/types/wlr_scene.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 02088150..f3302574 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -43,7 +43,6 @@ typedef void (*wlr_scene_buffer_iterator_func_t)( enum wlr_scene_node_type { WLR_SCENE_NODE_ROOT, WLR_SCENE_NODE_TREE, - WLR_SCENE_NODE_SURFACE, WLR_SCENE_NODE_RECT, WLR_SCENE_NODE_BUFFER, }; @@ -93,21 +92,17 @@ struct wlr_scene_tree { /** A scene-graph node displaying a single surface. */ struct wlr_scene_surface { - struct wlr_scene_node node; + struct wlr_scene_buffer *buffer; struct wlr_surface *surface; - /** - * The output that the largest area of this surface is displayed on. - * This may be NULL if the surface is not currently displayed on any - * outputs. This is the output that should be used for frame callbacks, - * presentation feedback, etc. - */ - struct wlr_output *primary_output; - // private state - int prev_width, prev_height; + struct wlr_addon addon; + struct wl_listener output_enter; + struct wl_listener output_leave; + struct wl_listener output_present; + struct wl_listener frame_done; struct wl_listener surface_destroy; struct wl_listener surface_commit; }; @@ -276,10 +271,15 @@ struct wlr_scene_tree *wlr_scene_tree_create(struct wlr_scene_node *parent); struct wlr_scene_surface *wlr_scene_surface_create(struct wlr_scene_node *parent, struct wlr_surface *surface); -struct wlr_scene_surface *wlr_scene_surface_from_node(struct wlr_scene_node *node); - struct wlr_scene_buffer *wlr_scene_buffer_from_node(struct wlr_scene_node *node); +/** + * If this buffer is backed by a surface, then the wlr_scene_surface is + * returned. If not, NULL will be returned. + */ +struct wlr_scene_surface *wlr_scene_surface_from_buffer( + struct wlr_scene_buffer *scene_buffer); + /** * Add a node displaying a solid-colored rectangle to the scene-graph. */ -- cgit v1.2.3