struct winsys_handle wsh;
uint width, height;
enum wl_shm_format format;
+ struct wl_buffer *buffer;
+ struct wl_shm_pool *pool;
resource = resource_surface_get_single_resource(surface->rsurf, attachment);
resource_surface_get_size(surface->rsurf, &width, &height);
break;
}
- return wl_shm_create_buffer(shmdpy->wl_shm, wsh.fd,
- width, height,
- wsh.stride, format);
+ pool = wl_shm_create_pool(shmdpy->wl_shm, wsh.fd, wsh.size);
+ buffer = wl_shm_pool_create_buffer(pool, 0, width, height,
+ wsh.stride, format);
+ wl_shm_pool_destroy(pool);
+
+ return buffer;
}
static void