From 971cbeaa19693a586e0204b236c3c55ec82be8cd Mon Sep 17 00:00:00 2001 From: random human Date: Mon, 24 Sep 2018 20:22:52 +0530 Subject: wlr_surface: fix surface damage transformation Damage tracking on transformed surfaces now work (see "weston-simple-damage --rotation=90"), using either of buffer or surface damage. --- rootston/output.c | 3 +-- types/wlr_surface.c | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rootston/output.c b/rootston/output.c index 4207f0d0..6a6b25c4 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -696,8 +696,7 @@ static void damage_from_surface(struct wlr_surface *surface, int sx, int sy, int center_x = box.x + box.width/2; int center_y = box.y + box.height/2; - enum wl_output_transform transform = - wlr_output_transform_invert(surface->current.transform); + enum wl_output_transform transform = surface->current.transform; pixman_region32_t damage; pixman_region32_init(&damage); diff --git a/types/wlr_surface.c b/types/wlr_surface.c index ab1dfc2d..790db675 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include "util/signal.h" @@ -198,7 +199,8 @@ static void surface_update_damage(pixman_region32_t *buffer_damage, pixman_region32_init(&surface_damage); pixman_region32_copy(&surface_damage, ¤t->surface_damage); wlr_region_transform(&surface_damage, &surface_damage, - current->transform, current->buffer_width, current->buffer_height); + wlr_output_transform_invert(current->transform), + current->width, current->height); wlr_region_scale(&surface_damage, &surface_damage, current->scale); pixman_region32_union(buffer_damage, buffer_damage, &surface_damage); pixman_region32_fini(&surface_damage); @@ -307,8 +309,8 @@ static void surface_apply_damage(struct wlr_surface *surface) { pixman_region32_init(&surface_damage); pixman_region32_copy(&surface_damage, &surface->current.surface_damage); wlr_region_transform(&surface_damage, &surface_damage, - surface->current.transform, - surface->current.buffer_width, surface->current.buffer_height); + wlr_output_transform_invert(surface->current.transform), + surface->current.width, surface->current.height); wlr_region_scale(&surface_damage, &surface_damage, surface->current.scale); pixman_region32_union(&damage, &damage, &surface_damage); -- cgit v1.2.3