diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2016-05-06 16:08:30 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2016-07-20 14:23:48 +0800 |
commit | e05f48fc53cbb10fd9c66f8b947cf64881590b42 (patch) | |
tree | f32938eeb5758cf56b7f9163b74c276bb7ae54e4 /cogl | |
parent | 95a68854ad90e12bf7d7d7a054956caa7d883e52 (diff) | |
download | mutter-e05f48fc53cbb10fd9c66f8b947cf64881590b42.tar.gz |
Make it possible to include private cogl API from mutter
If we want to put a cogl winsys backend in mutter, that backend need to
have access to the internal workings of cogl.
https://bugzilla.gnome.org/show_bug.cgi?id=768976
Diffstat (limited to 'cogl')
-rw-r--r-- | cogl/.gitignore | 1 | ||||
-rw-r--r-- | cogl/cogl-mutter-config.h.in | 17 | ||||
-rw-r--r-- | cogl/cogl/cogl-egl-private.h | 2 | ||||
-rw-r--r-- | cogl/cogl/cogl-framebuffer.h | 2 | ||||
-rw-r--r-- | cogl/cogl/cogl-gl-header.h.in | 2 | ||||
-rw-r--r-- | cogl/cogl/cogl-meta-texture.h | 2 | ||||
-rw-r--r-- | cogl/cogl/cogl-mutter.h | 10 | ||||
-rw-r--r-- | cogl/cogl/cogl-texture.h | 2 | ||||
-rw-r--r-- | cogl/cogl/cogl-util.h | 4 | ||||
-rw-r--r-- | cogl/cogl/deprecated/cogl-type-casts.h | 2 | ||||
-rw-r--r-- | cogl/cogl/winsys/cogl-winsys-private.h | 2 | ||||
-rw-r--r-- | cogl/configure.ac | 1 |
12 files changed, 39 insertions, 8 deletions
diff --git a/cogl/.gitignore b/cogl/.gitignore index 288080850..8449b17fd 100644 --- a/cogl/.gitignore +++ b/cogl/.gitignore @@ -40,6 +40,7 @@ cogl-path-enum-types.c cogl-path-enum-types.h cogl-config.h cogl-config.h.in +cogl-mutter-config.h config.log config.lt config.status diff --git a/cogl/cogl-mutter-config.h.in b/cogl/cogl-mutter-config.h.in new file mode 100644 index 000000000..bc7f146ce --- /dev/null +++ b/cogl/cogl-mutter-config.h.in @@ -0,0 +1,17 @@ +/* Have GL for rendering */ +#undef HAVE_COGL_GL + +/* Have GLES 1.1 for rendering */ +#undef HAVE_COGL_GLES + +/* Have GLES 2.0 for rendering */ +#undef HAVE_COGL_GLES2 + +/* Define to 1 if you have the `ffs' function. */ +#undef HAVE_FFS + +/* Define to 1 if you have the `memmem' function. */ +#undef HAVE_MEMMEM + +/* Whether _Static_assert can be used or not */ +#undef HAVE_STATIC_ASSERT diff --git a/cogl/cogl/cogl-egl-private.h b/cogl/cogl/cogl-egl-private.h index c4b0dfe1b..0af8518f1 100644 --- a/cogl/cogl/cogl-egl-private.h +++ b/cogl/cogl/cogl-egl-private.h @@ -33,7 +33,7 @@ #include "cogl-egl-defines.h" -#ifndef GL_OES_EGL_image +#if defined(GL_OES_EGL_image) && !defined(GLeglImageOES) #define GLeglImageOES void * #endif diff --git a/cogl/cogl/cogl-framebuffer.h b/cogl/cogl/cogl-framebuffer.h index 56ba4aa25..67931f879 100644 --- a/cogl/cogl/cogl-framebuffer.h +++ b/cogl/cogl/cogl-framebuffer.h @@ -37,7 +37,7 @@ /* We forward declare the CoglFramebuffer type here to avoid some circular * dependency issues with the following headers. */ -#ifdef __COGL_H_INSIDE__ +#if defined(__COGL_H_INSIDE__) && !defined(COGL_ENABLE_MUTTER_API) /* For the public C api we typedef interface types as void to avoid needing * lots of casting in code and instead we will rely on runtime type checking * for these objects. */ diff --git a/cogl/cogl/cogl-gl-header.h.in b/cogl/cogl/cogl-gl-header.h.in index 0696dcf72..a6659e92f 100644 --- a/cogl/cogl/cogl-gl-header.h.in +++ b/cogl/cogl/cogl-gl-header.h.in @@ -28,7 +28,7 @@ * */ -#if !defined(COGL_COMPILATION) +#if !defined(COGL_COMPILATION) && !defined(COGL_ENABLE_MUTTER_API) #error "cogl-gl-header.h should only be included when compiling Cogl" #endif diff --git a/cogl/cogl/cogl-meta-texture.h b/cogl/cogl/cogl-meta-texture.h index 69c8cb04a..e5e68933f 100644 --- a/cogl/cogl/cogl-meta-texture.h +++ b/cogl/cogl/cogl-meta-texture.h @@ -92,7 +92,7 @@ COGL_BEGIN_DECLS * meta-textures.</note> */ -#ifdef __COGL_H_INSIDE__ +#if defined(__COGL_H_INSIDE__) && !defined(COGL_ENABLE_MUTTER_API) /* For the public C api we typedef interface types as void to avoid needing * lots of casting in code and instead we will rely on runtime type checking * for these objects. */ diff --git a/cogl/cogl/cogl-mutter.h b/cogl/cogl/cogl-mutter.h index 21ef0745d..672bede0f 100644 --- a/cogl/cogl/cogl-mutter.h +++ b/cogl/cogl/cogl-mutter.h @@ -31,11 +31,17 @@ #ifndef __COGL_MUTTER_H___ #define __COGL_MUTTER_H___ +#include "cogl-mutter-config.h" +#include "cogl-defines.h" + +#include <cogl/cogl-texture.h> +#include <cogl/cogl-meta-texture.h> +#include <cogl/cogl-error-private.h> +#include <cogl/cogl-renderer-private.h> #include <cogl/winsys/cogl-winsys-egl-kms-private.h> +#include <cogl/winsys/cogl-winsys-egl-private.h> #include <cogl/winsys/cogl-winsys-private.h> -typedef const CoglWinsysVtable *(*CoglWinsysVtableGetter) (void); - void cogl_renderer_set_custom_winsys (CoglRenderer *renderer, CoglWinsysVtableGetter winsys_vtable_getter); diff --git a/cogl/cogl/cogl-texture.h b/cogl/cogl/cogl-texture.h index 27188309b..3757667d3 100644 --- a/cogl/cogl/cogl-texture.h +++ b/cogl/cogl/cogl-texture.h @@ -38,7 +38,7 @@ /* We forward declare the CoglTexture type here to avoid some circular * dependency issues with the following headers. */ -#ifdef __COGL_H_INSIDE__ +#if defined(__COGL_H_INSIDE__) && !defined(COGL_ENABLE_MUTTER_API) /* For the public C api we typedef interface types as void to avoid needing * lots of casting in code and instead we will rely on runtime type checking * for these objects. */ diff --git a/cogl/cogl/cogl-util.h b/cogl/cogl/cogl-util.h index 60be7db4d..c24419664 100644 --- a/cogl/cogl/cogl-util.h +++ b/cogl/cogl/cogl-util.h @@ -42,7 +42,9 @@ #endif /* Double check that config.h has been included */ -#if !defined (PACKAGE_NAME) && !defined (_COGL_IN_TEST_BITMASK) +#if (!defined (PACKAGE_NAME) && \ + !defined (_COGL_IN_TEST_BITMASK) && \ + !defined(COGL_ENABLE_MUTTER_API)) #error "cogl-config.h must be included before including cogl-util.h" #endif diff --git a/cogl/cogl/deprecated/cogl-type-casts.h b/cogl/cogl/deprecated/cogl-type-casts.h index ae716e7dd..61c6fafc4 100644 --- a/cogl/cogl/deprecated/cogl-type-casts.h +++ b/cogl/cogl/deprecated/cogl-type-casts.h @@ -44,10 +44,12 @@ * so these macros are only kept for compatibility... */ +#ifndef COGL_ENABLE_MUTTER_API #define COGL_FRAMEBUFFER(X) (X) #define COGL_BUFFER(X) (X) #define COGL_TEXTURE(X) (X) #define COGL_META_TEXTURE(X) (X) #define COGL_PRIMITIVE_TEXTURE(X) (X) +#endif #endif /* __COGL_TYPE_CASTS_H__ */ diff --git a/cogl/cogl/winsys/cogl-winsys-private.h b/cogl/cogl/winsys/cogl-winsys-private.h index 85a67c72a..a8e07a509 100644 --- a/cogl/cogl/winsys/cogl-winsys-private.h +++ b/cogl/cogl/winsys/cogl-winsys-private.h @@ -190,6 +190,8 @@ typedef struct _CoglWinsysVtable } CoglWinsysVtable; +typedef const CoglWinsysVtable *(*CoglWinsysVtableGetter) (void); + CoglBool _cogl_winsys_has_feature (CoglWinsysFeature feature); diff --git a/cogl/configure.ac b/cogl/configure.ac index c2674fb8a..586b6e167 100644 --- a/cogl/configure.ac +++ b/cogl/configure.ac @@ -80,6 +80,7 @@ AC_CONFIG_SRCDIR(cogl/cogl.h) AC_CONFIG_AUX_DIR([build]) AC_CONFIG_MACRO_DIR([build/autotools]) AC_CONFIG_HEADERS(cogl-config.h) +AC_CONFIG_HEADERS(cogl-mutter-config.h) AC_GNU_SOURCE dnl ================================================================ |