diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2023-03-09 05:38:26 +0100 |
---|---|---|
committer | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2023-03-09 05:38:53 +0100 |
commit | 9ac94516b805b350955a2aa17da9fa3c8ca8191f (patch) | |
tree | b538f31805d3c9ccd982ecfb1a30510486f16483 | |
parent | 774d2c82f0cc6ed5b20762fb74bab3e8bfd9f858 (diff) |
wlr_scene: Skip direct scanout if there is no damage
-rw-r--r-- | types/scene/wlr_scene.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 45a00429..953fb2c2 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -1558,6 +1558,11 @@ bool wlr_scene_output_commit(struct wlr_scene_output *scene_output) { struct wlr_renderer *renderer = output->renderer; assert(renderer != NULL); + if (!output->needs_frame && !pixman_region32_not_empty( + &scene_output->damage_ring.current)) { + return true; + } + struct render_list_constructor_data list_con = { .box = { .x = scene_output->x, .y = scene_output->y }, .render_list = &scene_output->render_list, @@ -1672,12 +1677,6 @@ bool wlr_scene_output_commit(struct wlr_scene_output *scene_output) { pixman_region32_init(&damage); wlr_damage_ring_get_buffer_damage(&scene_output->damage_ring, buffer_age, &damage); - if (!output->needs_frame && !pixman_region32_not_empty( - &scene_output->damage_ring.current)) { - pixman_region32_fini(&damage); - wlr_output_rollback(output); - return true; - } if (!wlr_renderer_begin(renderer, output->width, output->height)) { pixman_region32_fini(&damage); |