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
This commit is contained in:
Jonas Ådahl 2016-05-06 16:08:30 +08:00
parent 95a68854ad
commit e05f48fc53
13 changed files with 42 additions and 9 deletions

1
cogl/.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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. */

View File

@ -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

View File

@ -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. */

View File

@ -31,10 +31,16 @@
#ifndef __COGL_MUTTER_H___
#define __COGL_MUTTER_H___
#include <cogl/winsys/cogl-winsys-egl-kms-private.h>
#include <cogl/winsys/cogl-winsys-private.h>
#include "cogl-mutter-config.h"
#include "cogl-defines.h"
typedef const CoglWinsysVtable *(*CoglWinsysVtableGetter) (void);
#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>
void cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
CoglWinsysVtableGetter winsys_vtable_getter);

View File

@ -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. */

View File

@ -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

View File

@ -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__ */

View File

@ -190,6 +190,8 @@ typedef struct _CoglWinsysVtable
} CoglWinsysVtable;
typedef const CoglWinsysVtable *(*CoglWinsysVtableGetter) (void);
CoglBool
_cogl_winsys_has_feature (CoglWinsysFeature feature);

View File

@ -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 ================================================================

View File

@ -24,6 +24,8 @@ AM_CPPFLAGS = \
-I$(srcdir)/ui \
-I$(srcdir)/compositor \
-I$(top_srcdir)/cogl \
-I$(top_srcdir)/cogl/cogl \
-I$(top_srcdir)/cogl/cogl/winsys \
-I$(top_builddir)/cogl \
-I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter \