scene: add wlr_scene_buffer_set_buffer_with_options()

This is an extensible version of wlr_scene_buffer_set_buffer().
This commit is contained in:
Simon Ser 2024-08-05 19:28:03 +02:00
parent edb867bc05
commit 48f0902a36
2 changed files with 36 additions and 4 deletions

View file

@ -404,6 +404,24 @@ void wlr_scene_buffer_set_buffer(struct wlr_scene_buffer *scene_buffer,
void wlr_scene_buffer_set_buffer_with_damage(struct wlr_scene_buffer *scene_buffer,
struct wlr_buffer *buffer, const pixman_region32_t *region);
/**
* Options for wlr_scene_buffer_set_buffer_with_options().
*/
struct wlr_scene_buffer_set_buffer_options {
// The damage region is in buffer-local coordinates. If the region is NULL,
// the whole buffer node will be damaged.
const pixman_region32_t *damage;
};
/**
* Sets the buffer's backing buffer.
*
* If the buffer is NULL, the buffer node will not be displayed. If options is
* NULL, empty options are used.
*/
void wlr_scene_buffer_set_buffer_with_options(struct wlr_scene_buffer *scene_buffer,
struct wlr_buffer *buffer, const struct wlr_scene_buffer_set_buffer_options *options);
/**
* Sets the buffer's opaque region. This is an optimization hint used to
* determine if buffers which reside under this one need to be rendered or not.