summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2020-03-17 21:52:28 +0000
committerDaniel Stone <daniels@collabora.com>2020-03-18 11:33:52 +0000
commitcb481a66cd3e27845fa5cfe8a775e5d178c6c3b5 (patch)
tree3a8eb00bf408b9a174a7aa6dceca658fc5d6033c
parent4505f8111125f861d8e039f26a0f062ead4aa043 (diff)
downloadweston-cb481a66cd3e27845fa5cfe8a775e5d178c6c3b5.tar.gz
wayland-backend: Fully damage initial SHM buffer
In order to start the repaint loop, the Wayland backend tries to damage the full SHM buffer, but doesn't actually damage the full area if we have a frame. Store the buffer's width and height alongside the buffer itself, so we can damage the full area when required. Signed-off-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--libweston/backend-wayland/wayland.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libweston/backend-wayland/wayland.c b/libweston/backend-wayland/wayland.c
index 42af0c80..83145c93 100644
--- a/libweston/backend-wayland/wayland.c
+++ b/libweston/backend-wayland/wayland.c
@@ -180,6 +180,8 @@ struct wayland_shm_buffer {
struct wl_buffer *buffer;
void *data;
size_t size;
+ int width;
+ int height;
pixman_region32_t damage; /**< in global coords */
int frame_damaged;
@@ -339,6 +341,8 @@ wayland_output_get_shm_buffer(struct wayland_output *output)
sb->frame_damaged = 1;
sb->data = data;
+ sb->width = width;
+ sb->height = height;
sb->size = height * stride;
pool = wl_shm_create_pool(shm, fd, sb->size);
@@ -410,8 +414,7 @@ draw_initial_frame(struct wayland_output *output)
wl_surface_attach(output->parent.surface, sb->buffer, 0, 0);
wl_surface_damage(output->parent.surface, 0, 0,
- output->base.current_mode->width,
- output->base.current_mode->height);
+ sb->width, sb->height);
}
#ifdef ENABLE_EGL