scene: add wlr_scene_buffer_set_source_box

This commit is contained in:
Simon Ser 2021-09-20 17:41:52 +02:00 committed by Simon Zeni
parent fdc22449d6
commit 63040d6744
2 changed files with 56 additions and 19 deletions

View file

@ -94,6 +94,7 @@ struct wlr_scene_buffer {
// private state
struct wlr_texture *texture;
struct wlr_fbox src_box;
};
/** A viewport for an output in the scene-graph */
@ -211,6 +212,15 @@ void wlr_scene_rect_set_color(struct wlr_scene_rect *rect, const float color[sta
struct wlr_scene_buffer *wlr_scene_buffer_create(struct wlr_scene_node *parent,
struct wlr_buffer *buffer);
/**
* Set the source rectangle describing the region of the buffer which will be
* sampled to render this node. This allows cropping the buffer.
*
* If NULL, the whole buffer is sampled. By default, the source box is NULL.
*/
void wlr_scene_buffer_set_source_box(struct wlr_scene_buffer *scene_buffer,
const struct wlr_fbox *box);
/**
* Add a viewport for the specified output to the scene-graph.
*