summaryrefslogtreecommitdiff
path: root/wlr_scene.c
diff options
context:
space:
mode:
authorIsaac Freund <[email protected]>2021-12-13 16:11:19 +0100
committerSimon Ser <[email protected]>2021-12-13 15:21:05 +0000
commit9111ef3e3758fbf2d148946dc5544c908d18a044 (patch)
tree8cc3ddd5b68edcf3ddab85cb3ee0c3a92f1fa622 /wlr_scene.c
parentd164e76c0b89b6cff614ae82525812494f3db54c (diff)
scene: add wlr_scene_send_frame_done()
Diffstat (limited to 'wlr_scene.c')
-rw-r--r--wlr_scene.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/wlr_scene.c b/wlr_scene.c
index 4269707..daaf8d9 100644
--- a/wlr_scene.c
+++ b/wlr_scene.c
@@ -876,6 +876,31 @@ void wlr_scene_render_output(struct wlr_scene *scene, struct wlr_output *output,
pixman_region32_fini(&full_region);
}
+static void scene_send_frame_done_iterator(struct wlr_scene_node *node,
+ struct wlr_output *output, struct timespec *now) {
+ if (!node->state.enabled) {
+ return;
+ }
+
+ if (node->type == WLR_SCENE_NODE_SURFACE) {
+ struct wlr_scene_surface *scene_surface =
+ wlr_scene_surface_from_node(node);
+ if (scene_surface->primary_output == output) {
+ wlr_surface_send_frame_done(scene_surface->surface, now);
+ }
+ }
+
+ struct wlr_scene_node *child;
+ wl_list_for_each(child, &node->state.children, state.link) {
+ scene_send_frame_done_iterator(child, output, now);
+ }
+}
+
+void wlr_scene_send_frame_done(struct wlr_scene *scene,
+ struct wlr_output *output, struct timespec *now) {
+ scene_send_frame_done_iterator(&scene->node, output, now);
+}
+
static void scene_output_handle_destroy(struct wlr_addon *addon) {
struct wlr_scene_output *scene_output =
wl_container_of(addon, scene_output, addon);