aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-09-20 16:05:19 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-09-22 10:45:39 -0600
commit7939bf8cc6b81d5bbd11da08b905eea1bba81ce3 (patch)
treed693f1e8d64deb4f63f6724777b387fdd7051abf /include
parentf6f0e010d182e5a24b7e540fcc0567ebcafcca24 (diff)
scene: add wlr_scene_buffer
This new scene-graph node displays a wlr_buffer. Closes: https://github.com/swaywm/wlroots/issues/3161
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_scene.h17
1 files changed, 17 insertions, 0 deletions
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;
@@ -195,6 +206,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.
*
* An output can only be added once to the scene-graph.