summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Krezović <krezovic.armin@gmail.com>2017-10-23 16:10:01 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2017-10-24 12:51:35 +0300
commit2b3c97d560a8a60d6029be9795e81712e0868307 (patch)
treebe08be79f35807c460070302a682d29741de3e5e
parent99c92e7e52f22b030aa804af4e0b1acb5dc09620 (diff)
compositor-wayland: fix damage coordinates with pixman renderer
Damage coordinates are in global coordinate space, and they need to be translated to local coordinate space so multiple outputs can work. This path now matches the similar path in the X11 backend. This patch fixes the appearance of multiple windows in the parent compositor. Previously, all windows except the one with nested output position 0,0 would have their damage for the parent wl_surface always fall outside of the wl_surface, save the decorations which were handled separately. If the parent compositor was Weston/GL, this would lead to the output area remaining black as partial GL texture uploads would practically never update the texture. If the parent compositor was Weston/pixman, the parent windows would not update on screen unless something else caused the area to be repainted. [Pekka: adjusted commit message] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--libweston/compositor-wayland.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
index bc78cbdb..eacf385d 100644
--- a/libweston/compositor-wayland.c
+++ b/libweston/compositor-wayland.c
@@ -558,11 +558,15 @@ wayland_shm_buffer_attach(struct wayland_shm_buffer *sb)
int i, n;
pixman_region32_init(&damage);
+ pixman_region32_copy(&damage, &sb->damage);
+ pixman_region32_translate(&damage, -sb->output->base.x,
+ -sb->output->base.y);
+
weston_transformed_region(sb->output->base.width,
sb->output->base.height,
sb->output->base.transform,
sb->output->base.current_scale,
- &sb->damage, &damage);
+ &damage, &damage);
if (sb->output->frame) {
frame_interior(sb->output->frame, &ix, &iy, &iwidth, &iheight);