From f8475c93669528bbaec730afee3acb39655c5c86 Mon Sep 17 00:00:00 2001 From: nobled Date: Wed, 5 Jan 2011 17:41:55 +0000 Subject: [PATCH 1/2] Fix window.c build without cairo-gl --- clients/window.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clients/window.c b/clients/window.c index 22cbd287..67002352 100644 --- a/clients/window.c +++ b/clients/window.c @@ -536,8 +536,13 @@ display_get_pointer_surface(struct display *display, int pointer, cairo_surface_t *surface; surface = display->pointer_surfaces[pointer]; +#if HAVE_CAIRO_GL *width = cairo_gl_surface_get_width(surface); *height = cairo_gl_surface_get_height(surface); +#else + *width = cairo_image_surface_get_width(surface); + *height = cairo_image_surface_get_height(surface); +#endif *hotspot_x = pointer_images[pointer].hotspot_x; *hotspot_y = pointer_images[pointer].hotspot_y; From 9835417962dcc65ee6c426ef8aad4cd1d979d82e Mon Sep 17 00:00:00 2001 From: nobled Date: Wed, 5 Jan 2011 17:48:15 +0000 Subject: [PATCH 2/2] Workaround gears depending on cairo-gl Extremely hacky, but at least it doesn't stop the build anymore. --- clients/gears.c | 7 +++++-- clients/window.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/clients/gears.c b/clients/gears.c index 2f2eeda5..9f6f2874 100644 --- a/clients/gears.c +++ b/clients/gears.c @@ -222,10 +222,13 @@ allocate_buffer(struct gears *gears) window_draw(gears->window); gears->surface[gears->current] = window_get_surface(gears->window); - +#ifdef HAVE_CAIRO_GL image = display_get_image_for_drm_surface(gears->display, gears->surface[gears->current]); - +#else /* XXX: hack to make Wayland compile, even if this example doesn't run */ + die("gears cannot allocate buffer: it was compiled without cairo-gl"); + return; +#endif if (!eglMakeCurrent(gears->display, NULL, NULL, gears->context)) die("faile to make context current\n"); diff --git a/clients/window.h b/clients/window.h index 341f6022..79c7a82b 100644 --- a/clients/window.h +++ b/clients/window.h @@ -51,10 +51,12 @@ display_get_compositor(struct display *display); EGLDisplay display_get_egl_display(struct display *d); +#ifdef HAVE_CAIRO_GL EGLImageKHR display_get_image_for_drm_surface(struct display *display, cairo_surface_t *surface); #endif +#endif cairo_surface_t * display_create_surface(struct display *display,