window: merge struct surface_data into shm_surface_data
Struct surface_data was not really useful, and it definitely was not used with EGL-based windows. This also fixes a semantic mistake, where struct shm_surface_data was put into cairo_surface_t private, but got out as struct surface_data instead. Due to struct layout, however, this did not cause a real bug. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
f86504c881
commit
0c6a34378a
+8
-11
@@ -347,9 +347,6 @@ enum window_location {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const cairo_user_data_key_t surface_data_key;
|
static const cairo_user_data_key_t surface_data_key;
|
||||||
struct surface_data {
|
|
||||||
struct wl_buffer *buffer;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef HAVE_CAIRO_EGL
|
#ifdef HAVE_CAIRO_EGL
|
||||||
|
|
||||||
@@ -414,22 +411,22 @@ display_create_egl_window_surface(struct display *display,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct shm_surface_data {
|
||||||
|
struct wl_buffer *buffer;
|
||||||
|
struct shm_pool *pool;
|
||||||
|
};
|
||||||
|
|
||||||
struct wl_buffer *
|
struct wl_buffer *
|
||||||
display_get_buffer_for_surface(struct display *display,
|
display_get_buffer_for_surface(struct display *display,
|
||||||
cairo_surface_t *surface)
|
cairo_surface_t *surface)
|
||||||
{
|
{
|
||||||
struct surface_data *data;
|
struct shm_surface_data *data;
|
||||||
|
|
||||||
data = cairo_surface_get_user_data (surface, &surface_data_key);
|
data = cairo_surface_get_user_data (surface, &surface_data_key);
|
||||||
|
|
||||||
return data->buffer;
|
return data->buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct shm_surface_data {
|
|
||||||
struct surface_data data;
|
|
||||||
struct shm_pool *pool;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
shm_pool_destroy(struct shm_pool *pool);
|
shm_pool_destroy(struct shm_pool *pool);
|
||||||
|
|
||||||
@@ -438,7 +435,7 @@ shm_surface_data_destroy(void *p)
|
|||||||
{
|
{
|
||||||
struct shm_surface_data *data = p;
|
struct shm_surface_data *data = p;
|
||||||
|
|
||||||
wl_buffer_destroy(data->data.buffer);
|
wl_buffer_destroy(data->buffer);
|
||||||
if (data->pool)
|
if (data->pool)
|
||||||
shm_pool_destroy(data->pool);
|
shm_pool_destroy(data->pool);
|
||||||
|
|
||||||
@@ -570,7 +567,7 @@ display_create_shm_surface_from_pool(struct display *display,
|
|||||||
else
|
else
|
||||||
format = WL_SHM_FORMAT_ARGB8888;
|
format = WL_SHM_FORMAT_ARGB8888;
|
||||||
|
|
||||||
data->data.buffer = wl_shm_pool_create_buffer(pool->pool, offset,
|
data->buffer = wl_shm_pool_create_buffer(pool->pool, offset,
|
||||||
rectangle->width,
|
rectangle->width,
|
||||||
rectangle->height,
|
rectangle->height,
|
||||||
stride, format);
|
stride, format);
|
||||||
|
|||||||
Reference in New Issue
Block a user