From bf42b54faaf3ec3c2f789467927d52003f60a79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 16 Aug 2018 16:20:38 +0200 Subject: [PATCH] Make it possible to build without EGL support This will avoid building anything related to EGL. For meson, this will mean that both the native backend an the Wayland support must also be disabled. --- cogl/cogl/cogl-mutter.h | 2 ++ cogl/cogl/cogl-texture-2d.c | 2 ++ cogl/cogl/driver/gl/cogl-texture-2d-gl.c | 4 ++++ src/backends/x11/meta-renderer-x11.c | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/cogl/cogl/cogl-mutter.h b/cogl/cogl/cogl-mutter.h index 13de039d0..0f1154e8a 100644 --- a/cogl/cogl/cogl-mutter.h +++ b/cogl/cogl/cogl-mutter.h @@ -39,7 +39,9 @@ #include #include #include +#if defined (COGL_HAS_EGL_SUPPORT) #include +#endif #include void cogl_renderer_set_custom_winsys (CoglRenderer *renderer, diff --git a/cogl/cogl/cogl-texture-2d.c b/cogl/cogl/cogl-texture-2d.c index c0d14ed1e..65ba5114b 100644 --- a/cogl/cogl/cogl-texture-2d.c +++ b/cogl/cogl/cogl-texture-2d.c @@ -385,6 +385,7 @@ cogl_wayland_texture_2d_new_from_buffer (CoglContext *ctx, else return tex; } +#ifdef COGL_HAS_EGL_SUPPORT else { int format, width, height; @@ -439,6 +440,7 @@ cogl_wayland_texture_2d_new_from_buffer (CoglContext *ctx, return tex; } } +#endif /* COGL_HAS_EGL_SUPPORT */ _cogl_set_error (error, COGL_SYSTEM_ERROR, diff --git a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c index 56f8e34ef..ba90998ba 100644 --- a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c +++ b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c @@ -576,7 +576,11 @@ _cogl_texture_2d_gl_allocate (CoglTexture *tex, case COGL_TEXTURE_SOURCE_TYPE_GL_FOREIGN: return allocate_from_gl_foreign (tex_2d, loader, error); case COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE_EXTERNAL: +#if defined (COGL_HAS_EGL_SUPPORT) return allocate_custom_egl_image_external (tex_2d, loader, error); +#else + g_return_val_if_reached (FALSE); +#endif } g_return_val_if_reached (FALSE); diff --git a/src/backends/x11/meta-renderer-x11.c b/src/backends/x11/meta-renderer-x11.c index 8a1183ecb..526861fa9 100644 --- a/src/backends/x11/meta-renderer-x11.c +++ b/src/backends/x11/meta-renderer-x11.c @@ -45,13 +45,19 @@ G_DEFINE_TYPE (MetaRendererX11, meta_renderer_x11, META_TYPE_RENDERER) static const CoglWinsysVtable * get_x11_cogl_winsys_vtable (CoglRenderer *renderer) { +#ifdef COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT if (meta_is_wayland_compositor ()) return _cogl_winsys_egl_xlib_get_vtable (); +#endif switch (renderer->driver) { case COGL_DRIVER_GLES2: +#ifdef COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT return _cogl_winsys_egl_xlib_get_vtable (); +#else + break; +#endif case COGL_DRIVER_GL: case COGL_DRIVER_GL3: return _cogl_winsys_glx_get_vtable ();