aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-12-04 06:58:35 -0500
committerAlexander Orzechowski <alex@ozal.ski>2023-12-04 06:58:35 -0500
commit364d7cba42cc450cc31058cef8fb11147d8a59fb (patch)
tree9d02f0a23475f516917ec18052838410bd1dd3b5
parentfe8916fef0bd5d0846dfadd5f8c49ac57beedc9a (diff)
wlr_scene: Apply output damage once
We would apply it twice if we failed direct scanout. Once when we attempt direct scanout and again when we composite.
-rw-r--r--types/scene/wlr_scene.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c
index ed7a72fa..949b8c89 100644
--- a/types/scene/wlr_scene.c
+++ b/types/scene/wlr_scene.c
@@ -1601,7 +1601,6 @@ static bool scene_entry_try_direct_scanout(struct render_list_entry *entry,
}
wlr_output_state_set_buffer(&pending, buffer->buffer);
- output_state_apply_damage(data, &pending);
if (!wlr_output_test_state(scene_output->output, &pending)) {
wlr_output_state_finish(&pending);
@@ -1712,6 +1711,12 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output,
struct render_list_entry *list_data = list_con.render_list->data;
int list_len = list_con.render_list->size / sizeof(*list_data);
+ if (debug_damage == WLR_SCENE_DEBUG_DAMAGE_RERENDER) {
+ wlr_damage_ring_add_whole(&scene_output->damage_ring);
+ }
+
+ output_state_apply_damage(&render_data, state);
+
bool scanout = list_len == 1 &&
scene_entry_try_direct_scanout(&list_data[0], state, &render_data);
@@ -1731,10 +1736,6 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output,
return true;
}
- if (debug_damage == WLR_SCENE_DEBUG_DAMAGE_RERENDER) {
- wlr_damage_ring_add_whole(&scene_output->damage_ring);
- }
-
struct timespec now;
if (debug_damage == WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT) {
struct wl_list *regions = &scene_output->damage_highlight_regions;
@@ -1805,7 +1806,6 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output,
render_data.render_pass = render_pass;
- output_state_apply_damage(&render_data, state);
pixman_region32_init(&render_data.damage);
wlr_damage_ring_rotate_buffer(&scene_output->damage_ring, buffer,
&render_data.damage);