diff options
author | Kirill Primak <vyivel@posteo.net> | 2021-12-04 20:39:13 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-12-06 16:44:34 +0100 |
commit | 03a29ed36df22f39198168c95d940a59578daa49 (patch) | |
tree | f180b830f0fbbbfda6b88597f1168f0d66432f12 /sway | |
parent | Delete .clang-format (diff) | |
download | sway-03a29ed36df22f39198168c95d940a59578daa49.tar.gz sway-03a29ed36df22f39198168c95d940a59578daa49.tar.zst sway-03a29ed36df22f39198168c95d940a59578daa49.zip |
output: remove surface buffer damage check
A surface can have effective damage even without any buffer damage
committed.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/output.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index ed6bc064..e0d76349 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -633,21 +633,19 @@ static void damage_surface_iterator(struct sway_output *output, | |||
633 | struct wlr_box box = *_box; | 633 | struct wlr_box box = *_box; |
634 | scale_box(&box, output->wlr_output->scale); | 634 | scale_box(&box, output->wlr_output->scale); |
635 | 635 | ||
636 | if (pixman_region32_not_empty(&surface->buffer_damage)) { | 636 | pixman_region32_t damage; |
637 | pixman_region32_t damage; | 637 | pixman_region32_init(&damage); |
638 | pixman_region32_init(&damage); | 638 | wlr_surface_get_effective_damage(surface, &damage); |
639 | wlr_surface_get_effective_damage(surface, &damage); | 639 | wlr_region_scale(&damage, &damage, output->wlr_output->scale); |
640 | wlr_region_scale(&damage, &damage, output->wlr_output->scale); | 640 | if (ceil(output->wlr_output->scale) > surface->current.scale) { |
641 | if (ceil(output->wlr_output->scale) > surface->current.scale) { | 641 | // When scaling up a surface, it'll become blurry so we need to |
642 | // When scaling up a surface, it'll become blurry so we need to | 642 | // expand the damage region |
643 | // expand the damage region | 643 | wlr_region_expand(&damage, &damage, |
644 | wlr_region_expand(&damage, &damage, | 644 | ceil(output->wlr_output->scale) - surface->current.scale); |
645 | ceil(output->wlr_output->scale) - surface->current.scale); | 645 | } |
646 | } | 646 | pixman_region32_translate(&damage, box.x, box.y); |
647 | pixman_region32_translate(&damage, box.x, box.y); | 647 | wlr_output_damage_add(output->damage, &damage); |
648 | wlr_output_damage_add(output->damage, &damage); | 648 | pixman_region32_fini(&damage); |
649 | pixman_region32_fini(&damage); | ||
650 | } | ||
651 | 649 | ||
652 | if (whole) { | 650 | if (whole) { |
653 | wlr_output_damage_add_box(output->damage, &box); | 651 | wlr_output_damage_add_box(output->damage, &box); |