eglplatform.h does not support Wayland
authoraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jul 2017 09:21:52 +0000 (09:21 +0000)
committeraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jul 2017 09:21:52 +0000 (09:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163482

This makes it possible to build WebKitGTK+ when the target system has only Wayland support,
but no X11 (and therefore the X11 headers are not present).

Reviewed by Alex Christensen.

* include/EGL/eglplatform.h: Add Wayland typedefs when WL_EGL_PLATFORM is defined (for example
by including wayland-egl.h before including EGL/egl.h). Also, include the X11 headers only
when ANGLE_USE_X11 is defined and, for consistency with Mesa's version of the header, when
MESA_EGL_NO_X11_HEADERS is not defined.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219446 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/changes.diff
Source/ThirdParty/ANGLE/include/EGL/eglplatform.h

index 3158289..57008e2 100644 (file)
@@ -1,3 +1,18 @@
+2017-07-13  Adrian Perez de Castro  <aperez@igalia.com>
+
+        eglplatform.h does not support Wayland
+        https://bugs.webkit.org/show_bug.cgi?id=163482
+
+        This makes it possible to build WebKitGTK+ when the target system has only Wayland support,
+        but no X11 (and therefore the X11 headers are not present).
+
+        Reviewed by Alex Christensen.
+
+        * include/EGL/eglplatform.h: Add Wayland typedefs when WL_EGL_PLATFORM is defined (for example
+        by including wayland-egl.h before including EGL/egl.h). Also, include the X11 headers only
+        when ANGLE_USE_X11 is defined and, for consistency with Mesa's version of the header, when
+        MESA_EGL_NO_X11_HEADERS is not defined.
+
 2017-07-03  Andy Estes  <aestes@apple.com>
 
         [Xcode] Add an experimental setting to build with ccache
index fb0df8a..b7ae06d 100644 (file)
@@ -558,3 +558,44 @@ index 2f93651..49aa604 100644
      if (conversionSet.find(CopyConversion(textureFormatInfo.format,
                                            framebufferFormatInfo.format)) != conversionSet.end())
      {
+diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
+index 9bb75910ac0..ccaf7e6f343 100644
+--- a/include/EGL/eglplatform.h
++++ b/include/EGL/eglplatform.h
+@@ -89,6 +89,12 @@ typedef int   EGLNativeDisplayType;
+ typedef void *EGLNativeWindowType;
+ typedef void *EGLNativePixmapType;
++#elif defined(WL_EGL_PLATFORM)
++
++typedef struct wl_display    *EGLNativeDisplayType;
++typedef struct wl_egl_pixmap *EGLNativePixmapType;
++typedef struct wl_egl_window *EGLNativeWindowType;
++
+ #elif defined(__ANDROID__) || defined(ANDROID)
+ #include <android/native_window.h>
+@@ -107,6 +113,8 @@ typedef intptr_t EGLNativePixmapType;
+ #elif defined(__unix__)
++#if defined(ANGLE_USE_X11) && !defined(MESA_EGL_NO_X11_HEADERS)
++
+ /* X11 (tentative)  */
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+@@ -116,6 +124,14 @@ typedef Pixmap   EGLNativePixmapType;
+ typedef Window   EGLNativeWindowType;
+ #else
++
++typedef void             *EGLNativeDisplayType;
++typedef khronos_uintptr_t EGLNativePixmapType;
++typedef khronos_uintptr_t EGLNativeWindowType;
++
++#endif /* ANGLE_USE_X11 && !MESA_EGL_NO_X11_HEADERS */
++
++#else
+ #error "Platform not recognized"
+ #endif
index 9bb7591..ccaf7e6 100644 (file)
@@ -89,6 +89,12 @@ typedef int   EGLNativeDisplayType;
 typedef void *EGLNativeWindowType;
 typedef void *EGLNativePixmapType;
 
+#elif defined(WL_EGL_PLATFORM)
+
+typedef struct wl_display    *EGLNativeDisplayType;
+typedef struct wl_egl_pixmap *EGLNativePixmapType;
+typedef struct wl_egl_window *EGLNativeWindowType;
+
 #elif defined(__ANDROID__) || defined(ANDROID)
 
 #include <android/native_window.h>
@@ -107,6 +113,8 @@ typedef intptr_t EGLNativePixmapType;
 
 #elif defined(__unix__)
 
+#if defined(ANGLE_USE_X11) && !defined(MESA_EGL_NO_X11_HEADERS)
+
 /* X11 (tentative)  */
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -116,6 +124,14 @@ typedef Pixmap   EGLNativePixmapType;
 typedef Window   EGLNativeWindowType;
 
 #else
+
+typedef void             *EGLNativeDisplayType;
+typedef khronos_uintptr_t EGLNativePixmapType;
+typedef khronos_uintptr_t EGLNativeWindowType;
+
+#endif /* ANGLE_USE_X11 && !MESA_EGL_NO_X11_HEADERS */
+
+#else
 #error "Platform not recognized"
 #endif