st/egl: Update to the new wl_shm_pool interface

This commit is contained in:
Benjamin Franzke 2012-04-03 20:20:49 +02:00
parent 900be21e09
commit 9ba3cecaa0
3 changed files with 10 additions and 3 deletions

View file

@ -84,6 +84,8 @@ wayland_create_shm_buffer(struct wayland_display *display,
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);
@ -104,9 +106,12 @@ wayland_create_shm_buffer(struct wayland_display *display,
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

View file

@ -243,6 +243,7 @@ wayland_displaytarget_get_handle(struct sw_winsys *ws,
whandle->fd = wldt->fd;
whandle->stride = wldt->stride;
whandle->size = wldt->size;
return TRUE;
}

View file

@ -32,6 +32,7 @@ struct wl_display;
struct winsys_handle {
int fd;
unsigned stride;
unsigned size;
};
struct sw_winsys *