From 07ccc6e0b357dd3c7be0939957657d0a03738b9d Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 14 Dec 2021 18:35:44 +0100 Subject: scene: add wlr_scene_set_presentation() This helper automates sending presentation feedback to clients based on the primary output of scene surfaces. --- include/wlr/types/wlr_scene.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index d2af9c5a..e0b370ad 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -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. -- cgit v1.2.3