[cogl] Avoid including the EGL headers from the public Cogl headers
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] Avoid including the EGL headers from the public Cogl headers
- Date: Fri, 13 Jul 2012 15:40:19 +0000 (UTC)
commit ed0cdca0eca815543619fe72fbd42d662d53f92d
Author: Tomeu Vizoso <tomeu vizoso collabora com>
Date: Tue Jul 10 15:14:07 2012 +0200
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>
cogl/Makefile.am | 16 +++++++--
cogl/cogl-context.h | 18 -----------
cogl/cogl-defines.h.in | 6 ----
cogl/cogl-egl-defines.h.in | 33 ++++++++++++++++++++
cogl/cogl-egl.h | 60 +++++++++++++++++++++++++++++++++++++
cogl/winsys/cogl-winsys-private.h | 4 ++
configure.ac | 1 +
7 files changed, 110 insertions(+), 28 deletions(-)
---
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index 19e0834..853c296 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -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
pc_files = cogl2.pc
@@ -101,6 +101,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 \
@@ -431,6 +434,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 \
@@ -490,7 +498,7 @@ cogl_headers = \
coglincludedir = $(includedir)/cogl2/cogl
coglinclude_HEADERS = $(cogl_headers) $(cogl_experimental_h)
-nodist_coglinclude_HEADERS = cogl-defines.h
+nodist_coglinclude_HEADERS = $(cogl_nodist_experimental_h) cogl-defines.h
if USE_GLIB
nodist_coglinclude_HEADERS += cogl-enum-types.h
endif
diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h
index 616cd77..719b6ca 100644
--- a/cogl/cogl-context.h
+++ b/cogl/cogl-context.h
@@ -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:
diff --git a/cogl/cogl-defines.h.in b/cogl/cogl-defines.h.in
index 7c1c5ae..a8765d8 100644
--- a/cogl/cogl-defines.h.in
+++ b/cogl/cogl-defines.h.in
@@ -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@
diff --git a/cogl/cogl-egl-defines.h.in b/cogl/cogl-egl-defines.h.in
new file mode 100644
index 0000000..fee93f5
--- /dev/null
+++ b/cogl/cogl-egl-defines.h.in
@@ -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
diff --git a/cogl/cogl-egl.h b/cogl/cogl-egl.h
new file mode 100644
index 0000000..c9ca786
--- /dev/null
+++ b/cogl/cogl-egl.h
@@ -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
diff --git a/cogl/winsys/cogl-winsys-private.h b/cogl/winsys/cogl-winsys-private.h
index dd09a02..3262d2f 100644
--- a/cogl/winsys/cogl-winsys-private.h
+++ b/cogl/winsys/cogl-winsys-private.h
@@ -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
diff --git a/configure.ac b/configure.ac
index 512fd17..685cee1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1185,6 +1185,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-pango2.pc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]