[Cogl] [PATCH 1/3] egl: remove NativeWindowType/NativeDisplayType defines

Robert Bragg robert at sixbynine.org
Tue Mar 4 18:48:34 PST 2014


From: Robert Bragg <robert at linux.intel.com>

This ensures we use EGLNativeWindowType and EGLNativeDisplayType
everywhere instead. The previous names come from EGL 1.2 but it seems
reasonable to require more recent EGL versions. If someone wanted to add
compatibility for EGL 1.2 later it would be straightforward to define
the new names to the old.
---
 cogl/cogl-defines.h.win32.in          | 2 --
 cogl/cogl-defines.h.win32_SDL.in      | 2 --
 cogl/cogl-egl.h                       | 3 ---
 cogl/winsys/cogl-winsys-egl-android.c | 2 +-
 cogl/winsys/cogl-winsys-egl-gdl.c     | 2 +-
 cogl/winsys/cogl-winsys-egl-kms.c     | 6 +++---
 cogl/winsys/cogl-winsys-egl-null.c    | 2 +-
 cogl/winsys/cogl-winsys-egl-x11.c     | 6 +++---
 8 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/cogl/cogl-defines.h.win32.in b/cogl/cogl-defines.h.win32.in
index e374c10..9236573 100644
--- a/cogl/cogl-defines.h.win32.in
+++ b/cogl/cogl-defines.h.win32.in
@@ -52,8 +52,6 @@ G_BEGIN_DECLS
 #include <GLES/egl.h>
 #else
 #include <EGL/egl.h>
-#define NativeDisplayType EGLNativeDisplayType
-#define NativeWindowType EGLNativeWindowType
 #endif
 #endif
 
diff --git a/cogl/cogl-defines.h.win32_SDL.in b/cogl/cogl-defines.h.win32_SDL.in
index a1d5e20..e49da67 100644
--- a/cogl/cogl-defines.h.win32_SDL.in
+++ b/cogl/cogl-defines.h.win32_SDL.in
@@ -53,8 +53,6 @@ G_BEGIN_DECLS
 #include <GLES/egl.h>
 #else
 #include <EGL/egl.h>
-#define NativeDisplayType EGLNativeDisplayType
-#define NativeWindowType EGLNativeWindowType
 #endif
 #endif
 
diff --git a/cogl/cogl-egl.h b/cogl/cogl-egl.h
index e1ae563..5f38bed 100644
--- a/cogl/cogl-egl.h
+++ b/cogl/cogl-egl.h
@@ -37,9 +37,6 @@
 
 COGL_BEGIN_DECLS
 
-#define NativeDisplayType EGLNativeDisplayType
-#define NativeWindowType EGLNativeWindowType
-
 #ifndef GL_OES_EGL_image
 #define GLeglImageOES void *
 #endif
diff --git a/cogl/winsys/cogl-winsys-egl-android.c b/cogl/winsys/cogl-winsys-egl-android.c
index bbf3f4c..6bd8f55 100644
--- a/cogl/winsys/cogl-winsys-egl-android.c
+++ b/cogl/winsys/cogl-winsys-egl-android.c
@@ -130,7 +130,7 @@ _cogl_winsys_egl_context_created (CoglDisplay *display,
   egl_display->egl_surface =
     eglCreateWindowSurface (egl_renderer->edpy,
                             egl_display->egl_config,
-                            (NativeWindowType) android_native_window,
+                            (EGLNativeWindowType) android_native_window,
                             NULL);
   if (egl_display->egl_surface == EGL_NO_SURFACE)
     {
diff --git a/cogl/winsys/cogl-winsys-egl-gdl.c b/cogl/winsys/cogl-winsys-egl-gdl.c
index 40bfe64..aeba196 100644
--- a/cogl/winsys/cogl-winsys-egl-gdl.c
+++ b/cogl/winsys/cogl-winsys-egl-gdl.c
@@ -136,7 +136,7 @@ _cogl_winsys_egl_context_created (CoglDisplay *display,
   egl_display->egl_surface =
     eglCreateWindowSurface (egl_renderer->edpy,
                             egl_display->egl_config,
-                            (NativeWindowType) display->gdl_plane,
+                            (EGLNativeWindowType) display->gdl_plane,
                             NULL);
 
   if (egl_display->egl_surface == EGL_NO_SURFACE)
diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c
index 144ad9b..283814f 100644
--- a/cogl/winsys/cogl-winsys-egl-kms.c
+++ b/cogl/winsys/cogl-winsys-egl-kms.c
@@ -768,7 +768,7 @@ _cogl_winsys_egl_context_created (CoglDisplay *display,
   egl_display->dummy_surface =
     eglCreateWindowSurface (egl_renderer->edpy,
                             egl_display->egl_config,
-                            (NativeWindowType) kms_display->dummy_gbm_surface,
+                            (EGLNativeWindowType) kms_display->dummy_gbm_surface,
                             NULL);
   if (egl_display->dummy_surface == EGL_NO_SURFACE)
     {
@@ -958,7 +958,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
   egl_onscreen->egl_surface =
     eglCreateWindowSurface (egl_renderer->edpy,
                             egl_display->egl_config,
-                            (NativeWindowType) kms_onscreen->surface,
+                            (EGLNativeWindowType) kms_onscreen->surface,
                             NULL);
   if (egl_onscreen->egl_surface == EGL_NO_SURFACE)
     {
@@ -1133,7 +1133,7 @@ cogl_kms_display_set_layout (CoglDisplay *display,
       new_egl_surface =
         eglCreateWindowSurface (egl_renderer->edpy,
                                 egl_display->egl_config,
-                                (NativeWindowType) new_surface,
+                                (EGLNativeWindowType) new_surface,
                                 NULL);
       if (new_egl_surface == EGL_NO_SURFACE)
         {
diff --git a/cogl/winsys/cogl-winsys-egl-null.c b/cogl/winsys/cogl-winsys-egl-null.c
index 63b302a..ebbab1f 100644
--- a/cogl/winsys/cogl-winsys-egl-null.c
+++ b/cogl/winsys/cogl-winsys-egl-null.c
@@ -96,7 +96,7 @@ _cogl_winsys_egl_context_created (CoglDisplay *display,
   egl_display->egl_surface =
     eglCreateWindowSurface (egl_renderer->edpy,
                             egl_display->egl_config,
-                            (NativeWindowType) NULL,
+                            (EGLNativeWindowType) NULL,
                             NULL);
   if (egl_display->egl_surface == EGL_NO_SURFACE)
     {
diff --git a/cogl/winsys/cogl-winsys-egl-x11.c b/cogl/winsys/cogl-winsys-egl-x11.c
index c530fd1..eb277ba 100644
--- a/cogl/winsys/cogl-winsys-egl-x11.c
+++ b/cogl/winsys/cogl-winsys-egl-x11.c
@@ -278,7 +278,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
     goto error;
 
   egl_renderer->edpy =
-    eglGetDisplay ((NativeDisplayType) xlib_renderer->xdpy);
+    eglGetDisplay ((EGLNativeDisplayType) xlib_renderer->xdpy);
 
   if (!_cogl_winsys_egl_renderer_connect_common (renderer, error))
     goto error;
@@ -480,7 +480,7 @@ _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
   egl_onscreen->egl_surface =
     eglCreateWindowSurface (egl_renderer->edpy,
                             egl_config,
-                            (NativeWindowType) xlib_onscreen->xwin,
+                            (EGLNativeWindowType) xlib_onscreen->xwin,
                             NULL);
 
   return TRUE;
@@ -628,7 +628,7 @@ _cogl_winsys_egl_context_created (CoglDisplay *display,
   egl_display->dummy_surface =
     eglCreateWindowSurface (egl_renderer->edpy,
                             egl_display->egl_config,
-                            (NativeWindowType) xlib_display->dummy_xwin,
+                            (EGLNativeWindowType) xlib_display->dummy_xwin,
                             NULL);
 
   if (egl_display->dummy_surface == EGL_NO_SURFACE)
-- 
1.8.5.2



More information about the Cogl mailing list