<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[207977] releases/WebKitGTK/webkit-2.14/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/207977">207977</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-10-27 03:15:59 -0700 (Thu, 27 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/207615">r207615</a> - [GTK] Avoid including egl.h headers in internal headers
https://bugs.webkit.org/show_bug.cgi?id=163722

Reviewed by Žan Doberšek.

egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.

* PlatformGTK.cmake:
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::createContextForWindow):
* platform/graphics/GLContext.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::~GLContextEGL):
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLWayland.cpp: Added.
(WebCore::GLContextEGL::GLContextEGL):
(WebCore::GLContextEGL::createWindowSurfaceWayland):
(WebCore::GLContextEGL::createWaylandContext):
(WebCore::GLContextEGL::destroyWaylandWindow):
* platform/graphics/egl/GLContextEGLX11.cpp: Added.
(WebCore::GLContextEGL::GLContextEGL):
(WebCore::GLContextEGL::createWindowSurfaceX11):
(WebCore::GLContextEGL::createPixmapContext):
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::GLContextGLX::createWindowContext):
(WebCore::GLContextGLX::createContext):
(WebCore::GLContextGLX::GLContextGLX):
* platform/graphics/glx/GLContextGLX.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
* platform/graphics/x11/PlatformDisplayX11.cpp:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorePlatformGTKcmake">releases/WebKitGTK/webkit-2.14/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsGLContextcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GLContext.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsGLContexth">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GLContext.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicseglGLContextEGLcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicseglGLContextEGLh">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGL.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsglxGLContextGLXcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsglxGLContextGLXh">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicswaylandPlatformDisplayWaylandcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsx11PlatformDisplayX11cpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicseglGLContextEGLWaylandcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicseglGLContextEGLX11cpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit214SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -1,5 +1,46 @@
</span><span class="cx"> 2016-10-20  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        [GTK] Avoid including egl.h headers in internal headers
+        https://bugs.webkit.org/show_bug.cgi?id=163722
+
+        Reviewed by Žan Doberšek.
+
+        egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
+        to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
+        eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
+        default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
+        for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
+        the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
+        include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.
+
+        * PlatformGTK.cmake:
+        * platform/graphics/GLContext.cpp:
+        (WebCore::GLContext::createContextForWindow):
+        * platform/graphics/GLContext.h:
+        * platform/graphics/egl/GLContextEGL.cpp:
+        (WebCore::GLContextEGL::createWindowContext):
+        (WebCore::GLContextEGL::createContext):
+        (WebCore::GLContextEGL::~GLContextEGL):
+        * platform/graphics/egl/GLContextEGL.h:
+        * platform/graphics/egl/GLContextEGLWayland.cpp: Added.
+        (WebCore::GLContextEGL::GLContextEGL):
+        (WebCore::GLContextEGL::createWindowSurfaceWayland):
+        (WebCore::GLContextEGL::createWaylandContext):
+        (WebCore::GLContextEGL::destroyWaylandWindow):
+        * platform/graphics/egl/GLContextEGLX11.cpp: Added.
+        (WebCore::GLContextEGL::GLContextEGL):
+        (WebCore::GLContextEGL::createWindowSurfaceX11):
+        (WebCore::GLContextEGL::createPixmapContext):
+        * platform/graphics/glx/GLContextGLX.cpp:
+        (WebCore::GLContextGLX::createWindowContext):
+        (WebCore::GLContextGLX::createContext):
+        (WebCore::GLContextGLX::GLContextGLX):
+        * platform/graphics/glx/GLContextGLX.h:
+        * platform/graphics/wayland/PlatformDisplayWayland.cpp:
+        * platform/graphics/x11/PlatformDisplayX11.cpp:
+
+2016-10-20  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
</ins><span class="cx">         [GTK] Avoid strstr() when checking (E)GL extensions
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=161958
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/PlatformGTK.cmake (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/PlatformGTK.cmake        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/PlatformGTK.cmake        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -124,6 +124,8 @@
</span><span class="cx">     platform/graphics/cairo/TransformationMatrixCairo.cpp
</span><span class="cx"> 
</span><span class="cx">     platform/graphics/egl/GLContextEGL.cpp
</span><ins>+    platform/graphics/egl/GLContextEGLWayland.cpp
+    platform/graphics/egl/GLContextEGLX11.cpp
</ins><span class="cx"> 
</span><span class="cx">     platform/graphics/freetype/FontCacheFreeType.cpp
</span><span class="cx">     platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsGLContextcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GLContext.cpp (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GLContext.cpp        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GLContext.cpp        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -84,12 +84,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(GLX)
</span><del>-#if PLATFORM(WAYLAND) // Building both X11 and Wayland targets
-    XID GLXWindowHandle = reinterpret_cast&lt;XID&gt;(windowHandle);
-#else
-    XID GLXWindowHandle = static_cast&lt;XID&gt;(windowHandle);
-#endif
-    if (auto glxContext = GLContextGLX::createContext(GLXWindowHandle, display))
</del><ins>+    if (auto glxContext = GLContextGLX::createContext(windowHandle, display))
</ins><span class="cx">         return WTFMove(glxContext);
</span><span class="cx"> #endif
</span><span class="cx"> #if USE(EGL)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsGLContexth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GLContext.h (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GLContext.h        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GLContext.h        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -27,10 +27,6 @@
</span><span class="cx"> #if USE(EGL) &amp;&amp; !PLATFORM(GTK)
</span><span class="cx"> #include &quot;eglplatform.h&quot;
</span><span class="cx"> typedef EGLNativeWindowType GLNativeWindowType;
</span><del>-#elif PLATFORM(GTK) &amp;&amp; PLATFORM(WAYLAND) &amp;&amp; !defined(GTK_API_VERSION_2)
-#include &lt;wayland-egl.h&gt;
-#include &lt;EGL/eglplatform.h&gt;
-typedef EGLNativeWindowType GLNativeWindowType;
</del><span class="cx"> #else
</span><span class="cx"> typedef uint64_t GLNativeWindowType;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicseglGLContextEGLcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -22,6 +22,8 @@
</span><span class="cx"> #if USE(EGL)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;GraphicsContext3D.h&quot;
</span><ins>+#include &quot;PlatformDisplay.h&quot;
+#include &lt;EGL/egl.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CAIRO)
</span><span class="cx"> #include &lt;cairo.h&gt;
</span><span class="lines">@@ -34,18 +36,6 @@
</span><span class="cx"> #include &quot;OpenGLShims.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(X11)
-#include &quot;PlatformDisplayX11.h&quot;
-#include &quot;XErrorTrapper.h&quot;
-#include &quot;XUniquePtr.h&quot;
-#include &lt;X11/Xlib.h&gt;
-#endif
-
-#if PLATFORM(WAYLAND)
-#include &quot;PlatformDisplayWayland.h&quot;
-#include &lt;wayland-egl.h&gt;
-#endif
-
</del><span class="cx"> #if ENABLE(ACCELERATED_2D_CANVAS)
</span><span class="cx"> // cairo-gl.h includes some definitions from GLX that conflict with
</span><span class="cx"> // the ones provided by us. Since GLContextEGL doesn't use any GLX
</span><span class="lines">@@ -103,7 +93,7 @@
</span><span class="cx">     return eglChooseConfig(display, attributeList, config, 1, &amp;numberConfigsReturned) &amp;&amp; numberConfigsReturned;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;GLContextEGL&gt; GLContextEGL::createWindowContext(EGLNativeWindowType window, PlatformDisplay&amp; platformDisplay, EGLContext sharingContext)
</del><ins>+std::unique_ptr&lt;GLContextEGL&gt; GLContextEGL::createWindowContext(GLNativeWindowType window, PlatformDisplay&amp; platformDisplay, EGLContext sharingContext)
</ins><span class="cx"> {
</span><span class="cx">     EGLDisplay display = platformDisplay.eglDisplay();
</span><span class="cx">     EGLConfig config;
</span><span class="lines">@@ -114,7 +104,19 @@
</span><span class="cx">     if (context == EGL_NO_CONTEXT)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    EGLSurface surface = eglCreateWindowSurface(display, config, window, 0);
</del><ins>+    EGLSurface surface = EGL_NO_SURFACE;
+#if PLATFORM(GTK)
+#if PLATFORM(X11)
+    if (platformDisplay.type() == PlatformDisplay::Type::X11)
+        surface = createWindowSurfaceX11(display, config, window);
+#endif
+#if PLATFORM(WAYLAND)
+    if (platformDisplay.type() == PlatformDisplay::Type::Wayland)
+        surface = createWindowSurfaceWayland(display, config, window);
+#endif
+#else
+    surface = eglCreateWindowSurface(display, config, static_cast&lt;EGLNativeWindowType&gt;(window), nullptr);
+#endif
</ins><span class="cx">     if (surface == EGL_NO_SURFACE) {
</span><span class="cx">         eglDestroyContext(display, context);
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -165,91 +167,8 @@
</span><span class="cx">     return std::unique_ptr&lt;GLContextEGL&gt;(new GLContextEGL(platformDisplay, context, EGL_NO_SURFACE, Surfaceless));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(X11)
-std::unique_ptr&lt;GLContextEGL&gt; GLContextEGL::createPixmapContext(PlatformDisplay&amp; platformDisplay, EGLContext sharingContext)
</del><ins>+std::unique_ptr&lt;GLContextEGL&gt; GLContextEGL::createContext(GLNativeWindowType window, PlatformDisplay&amp; platformDisplay)
</ins><span class="cx"> {
</span><del>-    EGLDisplay display = platformDisplay.eglDisplay();
-    EGLConfig config;
-    if (!getEGLConfig(display, &amp;config, PixmapSurface))
-        return nullptr;
-
-    EGLContext context = eglCreateContext(display, config, sharingContext, gContextAttributes);
-    if (context == EGL_NO_CONTEXT)
-        return nullptr;
-
-    EGLint visualId;
-    if (!eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &amp;visualId)) {
-        eglDestroyContext(display, context);
-        return nullptr;
-    }
-
-    Display* x11Display = downcast&lt;PlatformDisplayX11&gt;(platformDisplay).native();
-
-    XVisualInfo visualInfo;
-    visualInfo.visualid = visualId;
-    int numVisuals = 0;
-    XUniquePtr&lt;XVisualInfo&gt; visualInfoList(XGetVisualInfo(x11Display, VisualIDMask, &amp;visualInfo, &amp;numVisuals));
-    if (!visualInfoList || !numVisuals) {
-        eglDestroyContext(display, context);
-        return nullptr;
-    }
-
-    // We are using VisualIDMask so there must be only one.
-    ASSERT(numVisuals == 1);
-    XUniquePixmap pixmap = XCreatePixmap(x11Display, DefaultRootWindow(x11Display), 1, 1, visualInfoList.get()[0].depth);
-    if (!pixmap) {
-        eglDestroyContext(display, context);
-        return nullptr;
-    }
-
-    // Some drivers fail to create the surface producing BadDrawable X error and the default XError handler normally aborts.
-    // However, if the X error is ignored, eglCreatePixmapSurface() ends up returning a surface and we can continue creating
-    // the context. Since this is an offscreen context, it doesn't matter if the pixmap used is not valid because we never do
-    // swap buffers. So, we use a custom XError handler here that ignores BadDrawable errors and only warns about any other
-    // errors without aborting in any case.
-    XErrorTrapper trapper(x11Display, XErrorTrapper::Policy::Warn, { BadDrawable });
-    EGLSurface surface = eglCreatePixmapSurface(display, config, reinterpret_cast&lt;EGLNativePixmapType&gt;(pixmap.get()), 0);
-    if (surface == EGL_NO_SURFACE) {
-        eglDestroyContext(display, context);
-        return nullptr;
-    }
-
-    return std::unique_ptr&lt;GLContextEGL&gt;(new GLContextEGL(platformDisplay, context, surface, WTFMove(pixmap)));
-}
-#endif // PLATFORM(X11)
-
-#if PLATFORM(WAYLAND)
-std::unique_ptr&lt;GLContextEGL&gt; GLContextEGL::createWaylandContext(PlatformDisplay&amp; platformDisplay, EGLContext sharingContext)
-{
-    EGLDisplay display = platformDisplay.eglDisplay();
-    EGLConfig config;
-    if (!getEGLConfig(display, &amp;config, WindowSurface))
-        return nullptr;
-
-    EGLContext context = eglCreateContext(display, config, sharingContext, gContextAttributes);
-    if (context == EGL_NO_CONTEXT)
-        return nullptr;
-
-    WlUniquePtr&lt;struct wl_surface&gt; wlSurface(downcast&lt;PlatformDisplayWayland&gt;(platformDisplay).createSurface());
-    if (!wlSurface) {
-        eglDestroyContext(display, context);
-        return nullptr;
-    }
-
-    EGLNativeWindowType window = wl_egl_window_create(wlSurface.get(), 1, 1);
-    EGLSurface surface = eglCreateWindowSurface(display, config, window, 0);
-    if (surface == EGL_NO_SURFACE) {
-        eglDestroyContext(display, context);
-        wl_egl_window_destroy(window);
-        return nullptr;
-    }
-
-    return std::unique_ptr&lt;GLContextEGL&gt;(new GLContextEGL(platformDisplay, context, surface, WTFMove(wlSurface), window));
-}
-#endif
-
-std::unique_ptr&lt;GLContextEGL&gt; GLContextEGL::createContext(EGLNativeWindowType window, PlatformDisplay&amp; platformDisplay)
-{
</del><span class="cx">     if (platformDisplay.eglDisplay() == EGL_NO_DISPLAY)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -311,29 +230,6 @@
</span><span class="cx">     ASSERT(type == Surfaceless || surface != EGL_NO_SURFACE);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(X11)
-GLContextEGL::GLContextEGL(PlatformDisplay&amp; display, EGLContext context, EGLSurface surface, XUniquePixmap&amp;&amp; pixmap)
-    : GLContext(display)
-    , m_context(context)
-    , m_surface(surface)
-    , m_type(PixmapSurface)
-    , m_pixmap(WTFMove(pixmap))
-{
-}
-#endif
-
-#if PLATFORM(WAYLAND)
-GLContextEGL::GLContextEGL(PlatformDisplay&amp; display, EGLContext context, EGLSurface surface, WlUniquePtr&lt;struct wl_surface&gt;&amp;&amp; wlSurface, EGLNativeWindowType wlWindow)
-    : GLContext(display)
-    , m_context(context)
-    , m_surface(surface)
-    , m_type(WindowSurface)
-    , m_wlSurface(WTFMove(wlSurface))
-    , m_wlWindow(wlWindow)
-{
-}
-#endif
-
</del><span class="cx"> GLContextEGL::~GLContextEGL()
</span><span class="cx"> {
</span><span class="cx"> #if USE(CAIRO)
</span><span class="lines">@@ -352,8 +248,7 @@
</span><span class="cx">         eglDestroySurface(display, m_surface);
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><del>-    if (m_wlWindow)
-        wl_egl_window_destroy(m_wlWindow);
</del><ins>+    destroyWaylandWindow();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicseglGLContextEGLh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGL.h (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGL.h        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGL.h        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -17,13 +17,11 @@
</span><span class="cx">  *  Boston, MA 02110-1301 USA
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef GLContextEGL_h
-#define GLContextEGL_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if USE(EGL)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;GLContext.h&quot;
</span><del>-#include &lt;EGL/egl.h&gt;
</del><span class="cx"> 
</span><span class="cx"> #if PLATFORM(X11)
</span><span class="cx"> #include &quot;XUniqueResource.h&quot;
</span><span class="lines">@@ -31,18 +29,25 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><span class="cx"> #include &quot;WlUniquePtr.h&quot;
</span><ins>+struct wl_egl_window;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+typedef void *EGLConfig;
+typedef void *EGLContext;
+typedef void *EGLDisplay;
+typedef void *EGLSurface;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class GLContextEGL final : public GLContext {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(GLContextEGL);
</span><span class="cx"> public:
</span><del>-    static std::unique_ptr&lt;GLContextEGL&gt; createContext(EGLNativeWindowType, PlatformDisplay&amp;);
</del><ins>+    static std::unique_ptr&lt;GLContextEGL&gt; createContext(GLNativeWindowType, PlatformDisplay&amp;);
</ins><span class="cx">     static std::unique_ptr&lt;GLContextEGL&gt; createSharingContext(PlatformDisplay&amp;);
</span><span class="cx"> 
</span><span class="cx">     virtual ~GLContextEGL();
</span><span class="cx"> 
</span><ins>+private:
</ins><span class="cx">     bool makeContextCurrent() override;
</span><span class="cx">     void swapBuffers() override;
</span><span class="cx">     void waitNative() override;
</span><span class="lines">@@ -58,7 +63,6 @@
</span><span class="cx">     PlatformGraphicsContext3D platformContext() override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-private:
</del><span class="cx">     enum EGLSurfaceType { PbufferSurface, WindowSurface, PixmapSurface, Surfaceless };
</span><span class="cx"> 
</span><span class="cx">     GLContextEGL(PlatformDisplay&amp;, EGLContext, EGLSurface, EGLSurfaceType);
</span><span class="lines">@@ -66,23 +70,26 @@
</span><span class="cx">     GLContextEGL(PlatformDisplay&amp;, EGLContext, EGLSurface, XUniquePixmap&amp;&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><del>-    GLContextEGL(PlatformDisplay&amp;, EGLContext, EGLSurface, WlUniquePtr&lt;struct wl_surface&gt;&amp;&amp;, EGLNativeWindowType);
</del><ins>+    GLContextEGL(PlatformDisplay&amp;, EGLContext, EGLSurface, WlUniquePtr&lt;struct wl_surface&gt;&amp;&amp;, struct wl_egl_window*);
+    void destroyWaylandWindow();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    static std::unique_ptr&lt;GLContextEGL&gt; createWindowContext(EGLNativeWindowType, PlatformDisplay&amp;, EGLContext sharingContext = EGL_NO_CONTEXT);
-    static std::unique_ptr&lt;GLContextEGL&gt; createPbufferContext(PlatformDisplay&amp;, EGLContext sharingContext = EGL_NO_CONTEXT);
-    static std::unique_ptr&lt;GLContextEGL&gt; createSurfacelessContext(PlatformDisplay&amp;, EGLContext sharingContext = EGL_NO_CONTEXT);
</del><ins>+    static std::unique_ptr&lt;GLContextEGL&gt; createWindowContext(GLNativeWindowType, PlatformDisplay&amp;, EGLContext sharingContext = nullptr);
+    static std::unique_ptr&lt;GLContextEGL&gt; createPbufferContext(PlatformDisplay&amp;, EGLContext sharingContext = nullptr);
+    static std::unique_ptr&lt;GLContextEGL&gt; createSurfacelessContext(PlatformDisplay&amp;, EGLContext sharingContext = nullptr);
</ins><span class="cx"> #if PLATFORM(X11)
</span><del>-    static std::unique_ptr&lt;GLContextEGL&gt; createPixmapContext(PlatformDisplay&amp;, EGLContext sharingContext = EGL_NO_CONTEXT);
</del><ins>+    static std::unique_ptr&lt;GLContextEGL&gt; createPixmapContext(PlatformDisplay&amp;, EGLContext sharingContext = nullptr);
+    static EGLSurface createWindowSurfaceX11(EGLDisplay, EGLConfig, GLNativeWindowType);
</ins><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><del>-    static std::unique_ptr&lt;GLContextEGL&gt; createWaylandContext(PlatformDisplay&amp;, EGLContext sharingContext = EGL_NO_CONTEXT);
</del><ins>+    static std::unique_ptr&lt;GLContextEGL&gt; createWaylandContext(PlatformDisplay&amp;, EGLContext sharingContext = nullptr);
+    static EGLSurface createWindowSurfaceWayland(EGLDisplay, EGLConfig, GLNativeWindowType);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     static bool getEGLConfig(EGLDisplay, EGLConfig*, EGLSurfaceType);
</span><span class="cx"> 
</span><del>-    EGLContext m_context { EGL_NO_CONTEXT };
-    EGLSurface m_surface { EGL_NO_SURFACE };
</del><ins>+    EGLContext m_context { nullptr };
+    EGLSurface m_surface { nullptr };
</ins><span class="cx">     EGLSurfaceType m_type;
</span><span class="cx"> #if PLATFORM(X11)
</span><span class="cx">     XUniquePixmap m_pixmap;
</span><span class="lines">@@ -99,5 +106,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(EGL)
</span><del>-
-#endif // GLContextEGL_h
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicseglGLContextEGLWaylandcpp"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp (0 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp                                (rev 0)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+/*
+ * Copyright (C) 2016 Igalia, S.L.
+ *
+ *  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, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include &quot;config.h&quot;
+#include &quot;GLContextEGL.h&quot;
+
+#if USE(EGL) &amp;&amp; PLATFORM(WAYLAND)
+
+#include &quot;PlatformDisplayWayland.h&quot;
+// These includes need to be in this order because wayland-egl.h defines WL_EGL_PLATFORM
+// and egl.h checks that to decide whether it's Wayland platform.
+#include &lt;wayland-egl.h&gt;
+#include &lt;EGL/egl.h&gt;
+
+namespace WebCore {
+
+GLContextEGL::GLContextEGL(PlatformDisplay&amp; display, EGLContext context, EGLSurface surface, WlUniquePtr&lt;struct wl_surface&gt;&amp;&amp; wlSurface, struct wl_egl_window* wlWindow)
+    : GLContext(display)
+    , m_context(context)
+    , m_surface(surface)
+    , m_type(WindowSurface)
+    , m_wlSurface(WTFMove(wlSurface))
+    , m_wlWindow(wlWindow)
+{
+}
+
+EGLSurface GLContextEGL::createWindowSurfaceWayland(EGLDisplay display, EGLConfig config, GLNativeWindowType window)
+{
+    return eglCreateWindowSurface(display, config, reinterpret_cast&lt;EGLNativeWindowType&gt;(window), nullptr);
+}
+
+std::unique_ptr&lt;GLContextEGL&gt; GLContextEGL::createWaylandContext(PlatformDisplay&amp; platformDisplay, EGLContext sharingContext)
+{
+    EGLDisplay display = platformDisplay.eglDisplay();
+    EGLConfig config;
+    if (!getEGLConfig(display, &amp;config, WindowSurface))
+        return nullptr;
+
+    static const EGLint contextAttributes[] = {
+#if USE(OPENGL_ES_2)
+        EGL_CONTEXT_CLIENT_VERSION, 2,
+#endif
+        EGL_NONE
+    };
+
+    EGLContext context = eglCreateContext(display, config, sharingContext, contextAttributes);
+    if (context == EGL_NO_CONTEXT)
+        return nullptr;
+
+    WlUniquePtr&lt;struct wl_surface&gt; wlSurface(downcast&lt;PlatformDisplayWayland&gt;(platformDisplay).createSurface());
+    if (!wlSurface) {
+        eglDestroyContext(display, context);
+        return nullptr;
+    }
+
+    EGLNativeWindowType window = wl_egl_window_create(wlSurface.get(), 1, 1);
+    EGLSurface surface = eglCreateWindowSurface(display, config, window, 0);
+    if (surface == EGL_NO_SURFACE) {
+        eglDestroyContext(display, context);
+        wl_egl_window_destroy(window);
+        return nullptr;
+    }
+
+    return std::unique_ptr&lt;GLContextEGL&gt;(new GLContextEGL(platformDisplay, context, surface, WTFMove(wlSurface), window));
+}
+
+void GLContextEGL::destroyWaylandWindow()
+{
+    if (m_wlWindow)
+        wl_egl_window_destroy(m_wlWindow);
+}
+
+} // namespace WebCore
+
+#endif //  USE(EGL) &amp;&amp; PLATFORM(WAYLAND)
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicseglGLContextEGLX11cpp"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp (0 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp                                (rev 0)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+/*
+ * Copyright (C) 2016 Igalia, S.L.
+ *
+ *  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, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include &quot;config.h&quot;
+#include &quot;GLContextEGL.h&quot;
+
+#if USE(EGL) &amp;&amp; PLATFORM(X11)
+#include &quot;PlatformDisplayX11.h&quot;
+#include &quot;XErrorTrapper.h&quot;
+#include &quot;XUniquePtr.h&quot;
+#include &lt;EGL/egl.h&gt;
+#include &lt;X11/Xlib.h&gt;
+
+namespace WebCore {
+
+GLContextEGL::GLContextEGL(PlatformDisplay&amp; display, EGLContext context, EGLSurface surface, XUniquePixmap&amp;&amp; pixmap)
+    : GLContext(display)
+    , m_context(context)
+    , m_surface(surface)
+    , m_type(PixmapSurface)
+    , m_pixmap(WTFMove(pixmap))
+{
+}
+
+EGLSurface GLContextEGL::createWindowSurfaceX11(EGLDisplay display, EGLConfig config, GLNativeWindowType window)
+{
+    return eglCreateWindowSurface(display, config, static_cast&lt;EGLNativeWindowType&gt;(window), nullptr);
+}
+
+std::unique_ptr&lt;GLContextEGL&gt; GLContextEGL::createPixmapContext(PlatformDisplay&amp; platformDisplay, EGLContext sharingContext)
+{
+    EGLDisplay display = platformDisplay.eglDisplay();
+    EGLConfig config;
+    if (!getEGLConfig(display, &amp;config, PixmapSurface))
+        return nullptr;
+
+    static const EGLint contextAttributes[] = {
+#if USE(OPENGL_ES_2)
+        EGL_CONTEXT_CLIENT_VERSION, 2,
+#endif
+        EGL_NONE
+    };
+    EGLContext context = eglCreateContext(display, config, sharingContext, contextAttributes);
+    if (context == EGL_NO_CONTEXT)
+        return nullptr;
+
+    EGLint visualId;
+    if (!eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &amp;visualId)) {
+        eglDestroyContext(display, context);
+        return nullptr;
+    }
+
+    Display* x11Display = downcast&lt;PlatformDisplayX11&gt;(platformDisplay).native();
+
+    XVisualInfo visualInfo;
+    visualInfo.visualid = visualId;
+    int numVisuals = 0;
+    XUniquePtr&lt;XVisualInfo&gt; visualInfoList(XGetVisualInfo(x11Display, VisualIDMask, &amp;visualInfo, &amp;numVisuals));
+    if (!visualInfoList || !numVisuals) {
+        eglDestroyContext(display, context);
+        return nullptr;
+    }
+
+    // We are using VisualIDMask so there must be only one.
+    ASSERT(numVisuals == 1);
+    XUniquePixmap pixmap = XCreatePixmap(x11Display, DefaultRootWindow(x11Display), 1, 1, visualInfoList.get()[0].depth);
+    if (!pixmap) {
+        eglDestroyContext(display, context);
+        return nullptr;
+    }
+
+    // Some drivers fail to create the surface producing BadDrawable X error and the default XError handler normally aborts.
+    // However, if the X error is ignored, eglCreatePixmapSurface() ends up returning a surface and we can continue creating
+    // the context. Since this is an offscreen context, it doesn't matter if the pixmap used is not valid because we never do
+    // swap buffers. So, we use a custom XError handler here that ignores BadDrawable errors and only warns about any other
+    // errors without aborting in any case.
+    XErrorTrapper trapper(x11Display, XErrorTrapper::Policy::Warn, { BadDrawable });
+    EGLSurface surface = eglCreatePixmapSurface(display, config, reinterpret_cast&lt;EGLNativePixmapType&gt;(pixmap.get()), 0);
+    if (surface == EGL_NO_SURFACE) {
+        eglDestroyContext(display, context);
+        return nullptr;
+    }
+
+    return std::unique_ptr&lt;GLContextEGL&gt;(new GLContextEGL(platformDisplay, context, surface, WTFMove(pixmap)));
+}
+
+} // namespace WebCore
+
+#endif // USE(EGL) &amp;&amp; PLATFORM(X11)
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsglxGLContextGLXcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -74,11 +74,11 @@
</span><span class="cx">     return !!glXSwapIntervalSGI;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;GLContextGLX&gt; GLContextGLX::createWindowContext(XID window, PlatformDisplay&amp; platformDisplay, GLXContext sharingContext)
</del><ins>+std::unique_ptr&lt;GLContextGLX&gt; GLContextGLX::createWindowContext(GLNativeWindowType window, PlatformDisplay&amp; platformDisplay, GLXContext sharingContext)
</ins><span class="cx"> {
</span><span class="cx">     Display* display = downcast&lt;PlatformDisplayX11&gt;(platformDisplay).native();
</span><span class="cx">     XWindowAttributes attributes;
</span><del>-    if (!XGetWindowAttributes(display, window, &amp;attributes))
</del><ins>+    if (!XGetWindowAttributes(display, static_cast&lt;Window&gt;(window), &amp;attributes))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     XVisualInfo visualInfo;
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">     return std::unique_ptr&lt;GLContextGLX&gt;(new GLContextGLX(platformDisplay, WTFMove(context), WTFMove(pixmap), WTFMove(glxPixmap)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;GLContextGLX&gt; GLContextGLX::createContext(XID window, PlatformDisplay&amp; platformDisplay)
</del><ins>+std::unique_ptr&lt;GLContextGLX&gt; GLContextGLX::createContext(GLNativeWindowType window, PlatformDisplay&amp; platformDisplay)
</ins><span class="cx"> {
</span><span class="cx">     GLXContext glxSharingContext = platformDisplay.sharingGLContext() ? static_cast&lt;GLContextGLX*&gt;(platformDisplay.sharingGLContext())-&gt;m_context.get() : nullptr;
</span><span class="cx">     auto context = window ? createWindowContext(window, platformDisplay, glxSharingContext) : nullptr;
</span><span class="lines">@@ -177,11 +177,11 @@
</span><span class="cx">     return context;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GLContextGLX::GLContextGLX(PlatformDisplay&amp; display, XUniqueGLXContext&amp;&amp; context, XID window)
</del><ins>+GLContextGLX::GLContextGLX(PlatformDisplay&amp; display, XUniqueGLXContext&amp;&amp; context, GLNativeWindowType window)
</ins><span class="cx">     : GLContext(display)
</span><span class="cx">     , m_x11Display(downcast&lt;PlatformDisplayX11&gt;(m_display).native())
</span><span class="cx">     , m_context(WTFMove(context))
</span><del>-    , m_window(window)
</del><ins>+    , m_window(static_cast&lt;Window&gt;(window))
</ins><span class="cx"> {
</span><span class="cx">     activeContexts().add(this);
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsglxGLContextGLXh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.h (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.h        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.h        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -17,8 +17,7 @@
</span><span class="cx">  *  Boston, MA 02110-1301 USA
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef GLContextGLX_h
-#define GLContextGLX_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if USE(GLX)
</span><span class="cx"> 
</span><span class="lines">@@ -27,7 +26,7 @@
</span><span class="cx"> #include &quot;XUniqueResource.h&quot;
</span><span class="cx"> 
</span><span class="cx"> typedef unsigned char GLubyte;
</span><del>-typedef unsigned long XID;
</del><ins>+typedef unsigned long Window;
</ins><span class="cx"> typedef void* ContextKeyType;
</span><span class="cx"> typedef struct _XDisplay Display;
</span><span class="cx"> 
</span><span class="lines">@@ -36,11 +35,14 @@
</span><span class="cx"> class GLContextGLX final : public GLContext {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(GLContextGLX);
</span><span class="cx"> public:
</span><del>-    static std::unique_ptr&lt;GLContextGLX&gt; createContext(XID window, PlatformDisplay&amp;);
</del><ins>+    static std::unique_ptr&lt;GLContextGLX&gt; createContext(GLNativeWindowType, PlatformDisplay&amp;);
</ins><span class="cx">     static std::unique_ptr&lt;GLContextGLX&gt; createSharingContext(PlatformDisplay&amp;);
</span><span class="cx"> 
</span><span class="cx">     virtual ~GLContextGLX();
</span><span class="cx"> 
</span><ins>+    void clear();
+
+private:
</ins><span class="cx">     bool makeContextCurrent() override;
</span><span class="cx">     void swapBuffers() override;
</span><span class="cx">     void waitNative() override;
</span><span class="lines">@@ -54,20 +56,17 @@
</span><span class="cx">     PlatformGraphicsContext3D platformContext() override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void clear();
-
-private:
-    GLContextGLX(PlatformDisplay&amp;, XUniqueGLXContext&amp;&amp;, XID);
</del><ins>+    GLContextGLX(PlatformDisplay&amp;, XUniqueGLXContext&amp;&amp;, GLNativeWindowType);
</ins><span class="cx">     GLContextGLX(PlatformDisplay&amp;, XUniqueGLXContext&amp;&amp;, XUniqueGLXPbuffer&amp;&amp;);
</span><span class="cx">     GLContextGLX(PlatformDisplay&amp;, XUniqueGLXContext&amp;&amp;, XUniquePixmap&amp;&amp;, XUniqueGLXPixmap&amp;&amp;);
</span><span class="cx"> 
</span><del>-    static std::unique_ptr&lt;GLContextGLX&gt; createWindowContext(XID window, PlatformDisplay&amp;, GLXContext sharingContext = nullptr);
</del><ins>+    static std::unique_ptr&lt;GLContextGLX&gt; createWindowContext(GLNativeWindowType, PlatformDisplay&amp;, GLXContext sharingContext = nullptr);
</ins><span class="cx">     static std::unique_ptr&lt;GLContextGLX&gt; createPbufferContext(PlatformDisplay&amp;, GLXContext sharingContext = nullptr);
</span><span class="cx">     static std::unique_ptr&lt;GLContextGLX&gt; createPixmapContext(PlatformDisplay&amp;, GLXContext sharingContext = nullptr);
</span><span class="cx"> 
</span><span class="cx">     Display* m_x11Display { nullptr };
</span><span class="cx">     XUniqueGLXContext m_context;
</span><del>-    XID m_window { 0 };
</del><ins>+    Window m_window { 0 };
</ins><span class="cx">     XUniqueGLXPbuffer m_pbuffer;
</span><span class="cx">     XUniquePixmap m_pixmap;
</span><span class="cx">     XUniqueGLXPixmap m_glxPixmap;
</span><span class="lines">@@ -78,4 +77,3 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(GLX)
</span><span class="cx"> 
</span><del>-#endif // GLContextGLX_h
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicswaylandPlatformDisplayWaylandcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -30,7 +30,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;GLContextEGL.h&quot;
</span><span class="cx"> #include &lt;cstring&gt;
</span><ins>+// These includes need to be in this order because wayland-egl.h defines WL_EGL_PLATFORM
+// and egl.h checks that to decide whether it's Wayland platform.
</ins><span class="cx"> #include &lt;wayland-egl.h&gt;
</span><ins>+#include &lt;EGL/egl.h&gt;
</ins><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsx11PlatformDisplayX11cpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp (207976 => 207977)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp        2016-10-27 10:13:29 UTC (rev 207976)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp        2016-10-27 10:15:59 UTC (rev 207977)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;PlatformDisplayX11.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;GLContext.h&quot;
+
</ins><span class="cx"> #if PLATFORM(X11)
</span><span class="cx"> #include &lt;X11/Xlib.h&gt;
</span><span class="cx"> #include &lt;X11/extensions/Xcomposite.h&gt;
</span><span class="lines">@@ -35,14 +37,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(EGL)
</span><span class="cx"> #include &lt;EGL/egl.h&gt;
</span><del>-#include &lt;EGL/eglplatform.h&gt;
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-// FIXME: this needs to be here, after eglplatform.h, to avoid EGLNativeDisplayType to be defined as wl_display.
-// Since we support Wayland and X11 to be built at the same time, but eglplatform.h defines are decided at compile time
-// we need to ensure we only include eglplatform.h from X11 or Wayland specific files.
-#include &quot;GLContext.h&quot;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> PlatformDisplayX11::PlatformDisplayX11()
</span></span></pre>
</div>
</div>

</body>
</html>