diff -up webkitgtk-2.14.0/Source/WebCore/platform/graphics/egl/GLContextEGL.h.jx webkitgtk-2.14.0/Source/WebCore/platform/graphics/egl/GLContextEGL.h
--- webkitgtk-2.14.0/Source/WebCore/platform/graphics/egl/GLContextEGL.h.jx 2016-09-19 08:18:06.000000000 -0400
+++ webkitgtk-2.14.0/Source/WebCore/platform/graphics/egl/GLContextEGL.h 2016-10-11 18:45:48.497320945 -0400
@@ -24,6 +24,7 @@
#include "GLContext.h"
#include <EGL/egl.h>
+#include <EGL/eglext.h>
#if PLATFORM(X11)
#include "XUniqueResource.h"
diff -up webkitgtk-2.14.0/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp.jx webkitgtk-2.14.0/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp
--- webkitgtk-2.14.0/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp.jx 2016-09-19 08:18:06.000000000 -0400
+++ webkitgtk-2.14.0/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp 2016-10-11 18:45:48.497320945 -0400
@@ -62,7 +62,26 @@ void PlatformDisplayWayland::initialize(
wl_registry_add_listener(m_registry.get(), &s_registryListener, this);
wl_display_roundtrip(m_display);
- m_eglDisplay = eglGetDisplay(m_display);
+ const char *client_extensions = eglQueryString (NULL, EGL_EXTENSIONS);
+
+ if (strstr (client_extensions, "EGL_KHR_platform_base")) {
+ PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =
+ (PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress ("eglGetPlatformDisplay");
+
+ if (get_platform_display)
+ m_eglDisplay = get_platform_display (EGL_PLATFORM_WAYLAND_KHR,
+ m_display, NULL);
+ } else if (strstr (client_extensions, "EGL_EXT_platform_base")) {
+ PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =
+ (PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress ("eglGetPlatformDisplayEXT");
+
+ if (get_platform_display)
+ m_eglDisplay = get_platform_display (EGL_PLATFORM_WAYLAND_KHR,
+ m_display, NULL);
+ } else {
+ m_eglDisplay = eglGetDisplay ((EGLNativeDisplayType) m_display);
+ }
+
PlatformDisplay::initializeEGLDisplay();
}
diff -up webkitgtk-2.14.0/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp.jx webkitgtk-2.14.0/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
--- webkitgtk-2.14.0/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp.jx 2016-09-19 08:18:06.000000000 -0400
+++ webkitgtk-2.14.0/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp 2016-10-11 18:46:07.501627378 -0400
@@ -35,6 +35,7 @@
#if USE(EGL)
#include <EGL/egl.h>
+#include <EGL/eglext.h>
#include <EGL/eglplatform.h>
#endif
@@ -68,7 +69,26 @@ PlatformDisplayX11::~PlatformDisplayX11(
#if USE(EGL)
void PlatformDisplayX11::initializeEGLDisplay()
{
- m_eglDisplay = eglGetDisplay(m_display);
+ const char *client_extensions = eglQueryString (NULL, EGL_EXTENSIONS);
+
+ if (strstr (client_extensions, "EGL_KHR_platform_base")) {
+ PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =
+ (PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress ("eglGetPlatformDisplay");
+
+ if (get_platform_display)
+ m_eglDisplay = get_platform_display (EGL_PLATFORM_X11_KHR,
+ m_display, NULL);
+ } else if (strstr (client_extensions, "EGL_EXT_platform_base")) {
+ PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =
+ (PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress ("eglGetPlatformDisplayEXT");
+
+ if (get_platform_display)
+ m_eglDisplay = get_platform_display (EGL_PLATFORM_X11_KHR,
+ m_display, NULL);
+ } else {
+ m_eglDisplay = eglGetDisplay ((EGLNativeDisplayType) m_display);
+ }
+
PlatformDisplay::initializeEGLDisplay();
}
#endif