summaryrefslogtreecommitdiff
path: root/clients/simple-shm.c
diff options
context:
space:
mode:
Diffstat (limited to 'clients/simple-shm.c')
-rw-r--r--clients/simple-shm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/clients/simple-shm.c b/clients/simple-shm.c
index 7026af9..d1fe0c6 100644
--- a/clients/simple-shm.c
+++ b/clients/simple-shm.c
@@ -57,6 +57,7 @@ create_shm_buffer(struct display *display,
int width, int height, uint32_t format, void **data_out)
{
char filename[] = "/tmp/wayland-shm-XXXXXX";
+ struct wl_shm_pool *pool;
struct wl_buffer *buffer;
int fd, size, stride;
void *data;
@@ -83,9 +84,10 @@ create_shm_buffer(struct display *display,
return NULL;
}
- buffer = wl_shm_create_buffer(display->shm, fd,
- width, height, stride, format);
-
+ pool = wl_shm_create_pool(display->shm, fd, size);
+ buffer = wl_shm_pool_create_buffer(pool, 0,
+ width, height, stride, format);
+ wl_shm_pool_destroy(pool);
close(fd);
*data_out = data;