From 323d4b37a09ae5c8800b390ab88a3b714aa21655 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 24 Oct 2017 10:28:43 +0300 Subject: [PATCH] compositor-wayland: fix shm_buffer damage init It appears that wayland_shm_buffer::damage is in the global coordinate space. Therefore initializing it to width x height at 0,0 is not correct for any output not positioned at 0,0. That is, all outputs after the first one get it wrong. Initialize it from the output region, which is in the global coordinate space. While at it, add a comment to note that damage is in global coordinate space. As I can see, this was the last confusion about it. Signed-off-by: Pekka Paalanen Reviewed-by: Quentin Glidic Acked-by: Daniel Stone --- libweston/compositor-wayland.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c index eacf385d..a0d0e62a 100644 --- a/libweston/compositor-wayland.c +++ b/libweston/compositor-wayland.c @@ -168,7 +168,7 @@ struct wayland_shm_buffer { struct wl_buffer *buffer; void *data; size_t size; - pixman_region32_t damage; + pixman_region32_t damage; /**< in global coords */ int frame_damaged; pixman_image_t *pm_image; @@ -311,8 +311,8 @@ wayland_output_get_shm_buffer(struct wayland_output *output) wl_list_init(&sb->free_link); wl_list_insert(&output->shm.buffers, &sb->link); - pixman_region32_init_rect(&sb->damage, 0, 0, - output->base.width, output->base.height); + pixman_region32_init(&sb->damage); + pixman_region32_copy(&sb->damage, &output->base.region); sb->frame_damaged = 1; sb->data = data;