From 7939bf8cc6b81d5bbd11da08b905eea1bba81ce3 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 20 Sep 2021 16:05:19 +0200 Subject: scene: add wlr_scene_buffer This new scene-graph node displays a wlr_buffer. Closes: https://github.com/swaywm/wlroots/issues/3161 --- include/wlr/types/wlr_scene.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 965782bf..7548bb3e 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -31,6 +31,7 @@ enum wlr_scene_node_type { WLR_SCENE_NODE_TREE, WLR_SCENE_NODE_SURFACE, WLR_SCENE_NODE_RECT, + WLR_SCENE_NODE_BUFFER, }; struct wlr_scene_node_state { @@ -85,6 +86,16 @@ struct wlr_scene_rect { float color[4]; }; +/** A scene-graph node displaying a buffer */ +struct wlr_scene_buffer { + struct wlr_scene_node node; + struct wlr_buffer *buffer; + + // private state + + struct wlr_texture *texture; +}; + /** A viewport for an output in the scene-graph */ struct wlr_scene_output { struct wlr_output *output; @@ -194,6 +205,12 @@ void wlr_scene_rect_set_size(struct wlr_scene_rect *rect, int width, int height) */ void wlr_scene_rect_set_color(struct wlr_scene_rect *rect, const float color[static 4]); +/** + * Add a node displaying a buffer to the scene-graph. + */ +struct wlr_scene_buffer *wlr_scene_buffer_create(struct wlr_scene_node *parent, + struct wlr_buffer *buffer); + /** * Add a viewport for the specified output to the scene-graph. * -- cgit v1.2.3