WINDOW_CLIENT_AREA = 18,
};
-static const cairo_user_data_key_t surface_data_key;
+static const cairo_user_data_key_t shm_surface_data_key;
+static const cairo_user_data_key_t egl_window_surface_data_key;
#ifdef HAVE_CAIRO_EGL
rectangle->width,
rectangle->height);
- cairo_surface_set_user_data(cairo_surface, &surface_data_key,
+ cairo_surface_set_user_data(cairo_surface,
+ &egl_window_surface_data_key,
data, egl_window_surface_data_destroy);
return cairo_surface;
{
struct shm_surface_data *data;
- data = cairo_surface_get_user_data (surface, &surface_data_key);
+ data = cairo_surface_get_user_data(surface, &shm_surface_data_key);
return data->buffer;
}
rectangle->height,
stride);
- cairo_surface_set_user_data (surface, &surface_data_key,
- data, shm_surface_data_destroy);
+ cairo_surface_set_user_data(surface, &shm_surface_data_key,
+ data, shm_surface_data_destroy);
if (flags & SURFACE_OPAQUE)
format = WL_SHM_FORMAT_XRGB8888;
}
/* make sure we destroy the pool when the surface is destroyed */
- data = cairo_surface_get_user_data(surface, &surface_data_key);
+ data = cairo_surface_get_user_data(surface, &shm_surface_data_key);
data->pool = pool;
return surface;
#ifdef HAVE_CAIRO_EGL
case WINDOW_BUFFER_TYPE_EGL_WINDOW:
data = cairo_surface_get_user_data(window->cairo_surface,
- &surface_data_key);
+ &egl_window_surface_data_key);
cairo_gl_surface_swapbuffers(window->cairo_surface);
wl_egl_window_get_attached_size(data->window,
int x, y;
data = cairo_surface_get_user_data(window->cairo_surface,
- &surface_data_key);
+ &egl_window_surface_data_key);
window_get_resize_dx_dy(window, &x, &y),
wl_egl_window_resize(data->window,
{
struct display *d;
+ assert(&egl_window_surface_data_key != &shm_surface_data_key);
+
d = malloc(sizeof *d);
if (d == NULL)
return NULL;
}
data = cairo_surface_get_user_data(window->cairo_surface,
- &surface_data_key);
+ &egl_window_surface_data_key);
cairo_device_flush(device);
cairo_device_acquire(device);