From 502f5e06a2011ff07fb972719a668af24b0fc7e8 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 23 Feb 2015 14:08:25 +0200 Subject: [PATCH] compositor: fix plane coords in view_accumulate_damage() All things everywhere, except this one case, assume weston_plane::damage is in global coordinates. Document it. view_accumulate_damage() is wrong in converting damage to plane coordinates (similar to global coordinate except translated). Fix this by removing the unwanted translation, and use only global coordinates. We have not seen this bug manifest in real life because we get lucky: the origin of the primary plane is always at 0, 0. We do not use non-primary planes, except cursor plane on DRM backend where the actual damage coordinates are ignored. Signed-off-by: Pekka Paalanen Reviewed-by: Bryce Harrington --- src/compositor.c | 6 +----- src/compositor.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 50ff373e5..46e375671 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1832,14 +1832,10 @@ view_accumulate_damage(struct weston_view *view, extents = pixman_region32_extents(&view->surface->damage); view_compute_bbox(view, extents, &damage); - pixman_region32_translate(&damage, - -view->plane->x, - -view->plane->y); } else { pixman_region32_copy(&damage, &view->surface->damage); pixman_region32_translate(&damage, - view->geometry.x - view->plane->x, - view->geometry.y - view->plane->y); + view->geometry.x, view->geometry.y); } pixman_region32_subtract(&damage, &damage, opaque); diff --git a/src/compositor.h b/src/compositor.h index 57b671d2d..12fc61732 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -555,7 +555,7 @@ struct weston_layer { struct weston_plane { struct weston_compositor *compositor; - pixman_region32_t damage; + pixman_region32_t damage; /**< in global coords */ pixman_region32_t clip; int32_t x, y; struct wl_list link;