summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2017-10-24 10:28:43 +0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2017-10-24 12:51:35 +0300
commit323d4b37a09ae5c8800b390ab88a3b714aa21655 (patch)
treec7d02a0a36ac2d481c08e7ccb1aebd5afe850494
parent2b3c97d560a8a60d6029be9795e81712e0868307 (diff)
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 <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, 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;