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>
dev
Armin Krezović 7 years ago committed by Pekka Paalanen
parent 99c92e7e52
commit 2b3c97d560
  1. 6
      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);

Loading…
Cancel
Save