diff options
author | Isaac Freund <mail@isaacfreund.com> | 2021-12-14 18:35:44 +0100 |
---|---|---|
committer | Isaac Freund <mail@isaacfreund.com> | 2021-12-14 21:34:02 +0100 |
commit | 07ccc6e0b357dd3c7be0939957657d0a03738b9d (patch) | |
tree | 55f8064f22634bebd9b08004267c59c5daba8086 /include | |
parent | c0b120a30caae4cc538d1f83b722950d3d71a921 (diff) |
scene: add wlr_scene_set_presentation()
This helper automates sending presentation feedback to clients based on
the primary output of scene surfaces.
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_scene.h | 14 |
1 files changed, 14 insertions, 0 deletions
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. |