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>
This commit is contained in:
+1
-5
@@ -1832,14 +1832,10 @@ view_accumulate_damage(struct weston_view *view,
|
|||||||
|
|
||||||
extents = pixman_region32_extents(&view->surface->damage);
|
extents = pixman_region32_extents(&view->surface->damage);
|
||||||
view_compute_bbox(view, extents, &damage);
|
view_compute_bbox(view, extents, &damage);
|
||||||
pixman_region32_translate(&damage,
|
|
||||||
-view->plane->x,
|
|
||||||
-view->plane->y);
|
|
||||||
} else {
|
} else {
|
||||||
pixman_region32_copy(&damage, &view->surface->damage);
|
pixman_region32_copy(&damage, &view->surface->damage);
|
||||||
pixman_region32_translate(&damage,
|
pixman_region32_translate(&damage,
|
||||||
view->geometry.x - view->plane->x,
|
view->geometry.x, view->geometry.y);
|
||||||
view->geometry.y - view->plane->y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pixman_region32_subtract(&damage, &damage, opaque);
|
pixman_region32_subtract(&damage, &damage, opaque);
|
||||||
|
|||||||
+1
-1
@@ -555,7 +555,7 @@ struct weston_layer {
|
|||||||
|
|
||||||
struct weston_plane {
|
struct weston_plane {
|
||||||
struct weston_compositor *compositor;
|
struct weston_compositor *compositor;
|
||||||
pixman_region32_t damage;
|
pixman_region32_t damage; /**< in global coords */
|
||||||
pixman_region32_t clip;
|
pixman_region32_t clip;
|
||||||
int32_t x, y;
|
int32_t x, y;
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
|
|||||||
Reference in New Issue
Block a user