scene: add wlr_scene_set_presentation()

This helper automates sending presentation feedback to clients based on
the primary output of scene surfaces.
This commit is contained in:
Isaac Freund 2021-12-14 18:35:44 +01:00
parent c0b120a30c
commit 07ccc6e0b3
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11
2 changed files with 56 additions and 0 deletions

View file

@ -62,6 +62,12 @@ struct wlr_scene {
struct wlr_scene_node node;
struct wl_list outputs; // wlr_scene_output.link
// private state
// May be NULL
struct wlr_presentation *presentation;
struct wl_listener presentation_destroy;
};
/** A sub-tree in the scene-graph. */
@ -201,6 +207,14 @@ struct wlr_scene *wlr_scene_create(void);
*/
void wlr_scene_render_output(struct wlr_scene *scene, struct wlr_output *output,
int lx, int ly, pixman_region32_t *damage);
/**
* Handle presentation feedback for all surfaces in the scene, assuming that
* scene outputs and the scene rendering functions are used.
*
* Asserts that a wlr_presentation hasn't already been set for the scene.
*/
void wlr_scene_set_presentation(struct wlr_scene *scene,
struct wlr_presentation *presentation);
/**
* Add a node displaying nothing but its children.