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 <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
dev
Pekka Paalanen 10 years ago
parent c7d7fdfd11
commit 502f5e06a2
  1. 6
      src/compositor.c
  2. 2
      src/compositor.h

@ -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);

@ -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;

Loading…
Cancel
Save