[PATCH] compositor-wayland: Use correct damage coordinates for pixman backend

Pekka Paalanen ppaalanen at gmail.com
Tue Oct 24 08:26:18 UTC 2017


On Mon, 23 Oct 2017 16:10:01 +0200
Armin Krezović <krezovic.armin at gmail.com> wrote:

> Damage coordinates are in global coordinate space, and they need to
> be translated to local coordinate space so multiple outputs can work.
> ---
>  libweston/compositor-wayland.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
> index 1f77385b..e9054221 100644
> --- a/libweston/compositor-wayland.c
> +++ b/libweston/compositor-wayland.c
> @@ -556,11 +556,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);

Hi Armin,

yeah, this patch seems to the fix the very issue and looks correct. I
will send it to the list again as part of my other wayland-backend
fixes with the commit message extended. Awesome!

I reviewed the uses of sb->damage member everywhere, and fixed one more
place, though that was probably insignificant.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20171024/fee7986f/attachment.sig>


More information about the wayland-devel mailing list