diff options
author | emersion <contact@emersion.fr> | 2018-07-01 14:55:14 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-07-05 00:26:39 +0100 |
commit | 51b215ad5c0cadc4f1c10f407d1a2c375b46a769 (patch) | |
tree | 1a96e5ac66dc484cb0e3c112f879d58c5f46fdbf /sway/desktop/output.c | |
parent | d43500831a78580f59525144a0c9b034d4d399d0 (diff) |
Use wlr_surface.buffer_damage
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index a86c1646..1211cc07 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -1163,11 +1163,17 @@ static void damage_surface_iterator(struct wlr_surface *surface, int sx, int sy, int center_x = box.x + box.width/2; int center_y = box.y + box.height/2; - if (pixman_region32_not_empty(&surface->current.surface_damage)) { + if (pixman_region32_not_empty(&surface->buffer_damage)) { + enum wl_output_transform transform = + wlr_output_transform_invert(surface->current.transform); + pixman_region32_t damage; pixman_region32_init(&damage); - pixman_region32_copy(&damage, &surface->current.surface_damage); - wlr_region_scale(&damage, &damage, output->wlr_output->scale); + pixman_region32_copy(&damage, &surface->buffer_damage); + wlr_region_transform(&damage, &damage, transform, + surface->current.buffer_width, surface->current.buffer_height); + wlr_region_scale(&damage, &damage, + output->wlr_output->scale / (float)surface->current.scale); if (ceil(output->wlr_output->scale) > surface->current.scale) { // When scaling up a surface, it'll become blurry so we need to // expand the damage region |