Avoid including the EGL headers from the public Cogl headers

Otherwise, X11 identifiers may leak and cause havoc in big applications

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit ed0cdca0eca815543619fe72fbd42d662d53f92d)
This commit is contained in:
Tomeu Vizoso 2012-07-10 15:14:07 +02:00 committed by Robert Bragg
parent 90641cf2ca
commit bb258c1d42
7 changed files with 110 additions and 28 deletions

View File

@ -34,9 +34,9 @@ AM_CPPFLAGS = \
AM_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
BUILT_SOURCES += cogl-defines.h cogl-gl-header.h
DISTCLEANFILES += cogl-defines.h cogl-gl-header.h
EXTRA_DIST += cogl-defines.h.in cogl-gl-header.h.in
BUILT_SOURCES += cogl-defines.h cogl-egl-defines.h cogl-gl-header.h
DISTCLEANFILES += cogl-defines.h cogl-egl-defines.h cogl-gl-header.h
EXTRA_DIST += cogl-defines.h.in cogl-egl-defines.h.in cogl-gl-header.h.in
# Note: The cogl-1.0/cogl-gl-1.0 files are essentially for
# compatability only. I'm not really sure who could possibly be using
@ -119,6 +119,9 @@ cogl_experimental_h = \
$(srcdir)/cogl-version.h \
$(NULL)
cogl_nodist_experimental_h = \
$(NULL)
cogl_gl_prototypes_h = \
$(srcdir)/gl-prototypes/cogl-gles2-functions.h \
$(srcdir)/gl-prototypes/cogl-core-functions.h \
@ -459,6 +462,11 @@ cogl_sources_c += \
$(srcdir)/winsys/cogl-winsys-egl-android-private.h
endif
if SUPPORT_EGL
cogl_experimental_h += \
$(srcdir)/cogl-egl.h
cogl_nodist_experimental_h += \
$(builddir)/cogl-egl-defines.h
cogl_sources_c += \
$(srcdir)/winsys/cogl-winsys-egl.c \
$(srcdir)/winsys/cogl-winsys-egl-feature-functions.h \
@ -513,7 +521,7 @@ cogl_headers = \
coglincludedir = $(includedir)/cogl/cogl
coglinclude_HEADERS = $(cogl_headers) $(cogl_experimental_h)
nodist_coglinclude_HEADERS = cogl-defines.h cogl-enum-types.h
nodist_coglinclude_HEADERS = $(cogl_nodist_experimental_h) cogl-defines.h cogl-enum-types.h
cogl_proto_includedir = $(includedir)/cogl2/cogl/gl-prototypes
cogl_proto_include_HEADERS = $(cogl_gl_prototypes_h)

View File

@ -106,24 +106,6 @@ cogl_context_new (CoglDisplay *display,
CoglDisplay *
cogl_context_get_display (CoglContext *context);
#ifdef COGL_HAS_EGL_SUPPORT
/**
* cogl_egl_context_get_egl_display:
* @context: A #CoglContext pointer
*
* If you have done a runtime check to determine that Cogl is using
* EGL internally then this API can be used to retrieve the EGLDisplay
* handle that was setup internally. The result is undefined if Cogl
* is not using EGL.
*
* Return value: The internally setup EGLDisplay handle.
* Since: 1.8
* Stability: unstable
*/
EGLDisplay
cogl_egl_context_get_egl_display (CoglContext *context);
#endif
#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
/**
* cogl_android_set_native_window:

View File

@ -34,12 +34,6 @@ G_BEGIN_DECLS
@COGL_DEFINES@
#ifdef COGL_HAS_EGL_SUPPORT
@COGL_EGL_INCLUDES@
#define NativeDisplayType EGLNativeDisplayType
#define NativeWindowType EGLNativeWindowType
#endif
#define COGL_VERSION_MAJOR_INTERNAL @COGL_MAJOR_VERSION@
#define COGL_VERSION_MINOR_INTERNAL @COGL_MINOR_VERSION@
#define COGL_VERSION_MICRO_INTERNAL @COGL_MICRO_VERSION@

View File

@ -0,0 +1,33 @@
/*
* Cogl
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
* Copyright (C) 2007,2008,2009,2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#ifndef __COGL_EGL_DEFINES_H__
#define __COGL_EGL_DEFINES_H__
#ifdef COGL_HAS_EGL_SUPPORT
@COGL_EGL_INCLUDES@
#endif /* COGL_HAS_EGL_SUPPORT */
#endif

60
cogl/cogl-egl.h Normal file
View File

@ -0,0 +1,60 @@
/*
* Cogl
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
* Copyright (C) 2007,2008,2009,2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#ifndef __COGL_EGL_H__
#define __COGL_EGL_H__
#ifdef COGL_HAS_EGL_SUPPORT
#include "cogl-egl-defines.h"
G_BEGIN_DECLS
#define NativeDisplayType EGLNativeDisplayType
#define NativeWindowType EGLNativeWindowType
#ifndef GL_OES_EGL_image
#define GLeglImageOES void *
#endif
/**
* cogl_egl_context_get_egl_display:
* @context: A #CoglContext pointer
*
* If you have done a runtime check to determine that Cogl is using
* EGL internally then this API can be used to retrieve the EGLDisplay
* handle that was setup internally. The result is undefined if Cogl
* is not using EGL.
*
* Return value: The internally setup EGLDisplay handle.
* Since: 1.8
* Stability: unstable
*/
EGLDisplay
cogl_egl_context_get_egl_display (CoglContext *context);
G_END_DECLS
#endif /* COGL_HAS_EGL_SUPPORT */
#endif

View File

@ -37,6 +37,10 @@
#include "cogl-texture-pixmap-x11-private.h"
#endif
#ifdef COGL_HAS_EGL_SUPPORT
#include "cogl-egl.h"
#endif
#include "cogl-poll.h"
GQuark

View File

@ -1195,6 +1195,7 @@ cogl/cogl-defines.h
cogl/cogl-defines.h.win32
cogl/cogl-defines.h.win32_SDL
cogl/cogl-gl-header.h
cogl/cogl-egl-defines.h
cogl/cogl.rc
cogl-pango/Makefile
cogl-pango/cogl-pango-1.0.pc