wlr_scene: Allow buffer in wlr_scene_buffer to be NULL

This is useful to emulate an unmapped surface.
This commit is contained in:
Alexander Orzechowski 2022-05-19 14:16:52 -04:00
parent 8fe3aa29da
commit 039a31df9a
2 changed files with 11 additions and 2 deletions

View file

@ -107,6 +107,8 @@ struct wlr_scene_rect {
/** A scene-graph node displaying a buffer */
struct wlr_scene_buffer {
struct wlr_scene_node node;
// May be NULL
struct wlr_buffer *buffer;
// private state
@ -267,6 +269,8 @@ void wlr_scene_rect_set_color(struct wlr_scene_rect *rect, const float color[sta
/**
* Add a node displaying a buffer to the scene-graph.
*
* If the buffer is NULL, this node will not be displayed.
*/
struct wlr_scene_buffer *wlr_scene_buffer_create(struct wlr_scene_node *parent,
struct wlr_buffer *buffer);