diff options
author | Ilia Bozhinov <ammen99@gmail.com> | 2019-06-24 16:57:45 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-06-27 21:49:19 +0300 |
commit | fb739b829305a60f99abb6b847b45aeb9c6cbf77 (patch) | |
tree | be6c85928948d00d54d8ab49a4187493b02c2107 | |
parent | d10072e76cffa962d1bc32f056524708981dfa4a (diff) |
output-damage: set needs swap only when we have new damage
An output needs swap when there is new damage. If the damage is only
accumulated from the last frame, we could simply skip drawing.
-rw-r--r-- | types/wlr_output_damage.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/types/wlr_output_damage.c b/types/wlr_output_damage.c index fe35b563..a1fb6134 100644 --- a/types/wlr_output_damage.c +++ b/types/wlr_output_damage.c @@ -144,6 +144,8 @@ bool wlr_output_damage_attach_render(struct wlr_output_damage *output_damage, return false; } + *needs_frame = + output->needs_frame || pixman_region32_not_empty(&output_damage->current); // Check if we can use damage tracking if (buffer_age <= 0 || buffer_age - 1 > WLR_OUTPUT_DAMAGE_PREVIOUS_LEN) { int width, height; @@ -151,6 +153,7 @@ bool wlr_output_damage_attach_render(struct wlr_output_damage *output_damage, // Buffer new or too old, damage the whole output pixman_region32_union_rect(damage, damage, 0, 0, width, height); + *needs_frame = true; } else { pixman_region32_copy(damage, &output_damage->current); @@ -170,7 +173,6 @@ bool wlr_output_damage_attach_render(struct wlr_output_damage *output_damage, } } - *needs_frame = output->needs_frame || pixman_region32_not_empty(damage); return true; } |