<!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>[245807] trunk</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/245807">245807</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2019-05-27 23:36:34 -0700 (Mon, 27 May 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
https://bugs.webkit.org/show_bug.cgi?id=197944

Reviewed by Michael Catanzaro.

.:

Add USE_WPE_RENDERER option to use WPEBackend-fdo.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::createContextForWindow): Check current display is X11 before trying to create a GLX context.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay): Use USE(WPE_RENDERER) instead of USE(LIBWPE).
* platform/graphics/PlatformDisplay.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
(WebCore::GLContextEGL::createContext): Ditto.
(WebCore::GLContextEGL::createSharingContext): Ditto.
(WebCore::GLContextEGL::~GLContextEGL): Ditto.
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLLibWPE.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto.
* platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
(WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE): In GTK port set the display as the shared one for compositing.
* platform/graphics/libwpe/PlatformDisplayLibWPE.h:

Source/WebKit:

The WPEBackend-fdo implementation is quite similar to our Wayland nested compositor, but more efficient (using
linux dmabuf, resource caching, etc.). This allows us to share even more code with WPE port too.

* PlatformGTK.cmake:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::forceRepaint): WPE doesn't support force repaint yet.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
(WebKit::WebPageCreationParameters::decode): Ditto.
* Shared/WebPageCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const): Ditto.
(WebKit::WebProcessCreationParameters::decode): Ditto.
* Shared/WebProcessCreationParameters.h:
* SourcesGTK.txt:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::hostFileDescriptor): Implement it when using WPE just calling webkitWebViewBaseRenderHostFileDescriptor().
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCreateWebPage): Initialize the web page after the accelerated backing store is created, since
it's used now during intialization.
(webkitWebViewBaseRenderHostFileDescriptor): Return AcceleratedBackingStore::renderHostFileDescriptor()
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess): Remove wayland display name initialization.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Initialize wayland display name when not using WPE here
now. In case of using WPE, initialize hostClientFileDescriptor and implementationLibraryName.
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions): Remove unused wayland socket command line process parameter.
* UIProcess/gtk/AcceleratedBackingStore.h:
(WebKit::AcceleratedBackingStore::renderHostFileDescriptor): Return -1 by default.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::create): When using WPE call wpe_fdo_initialize_for_egl_display() and
check we have the required extensions.
(WebKit::AcceleratedBackingStoreWayland::AcceleratedBackingStoreWayland): When using WPE initialize the view backend.
(WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland): When using WPE release the EGL images
still in use and the view texture.
(WebKit::AcceleratedBackingStoreWayland::renderHostFileDescriptor): Call wpe_view_backend_get_renderer_host_fd().
(WebKit::AcceleratedBackingStoreWayland::displayBuffer): Create the view texture if needed, save the pending
image and schedule a redraw.
(WebKit::AcceleratedBackingStoreWayland::paint): When using WPE commit the pending image and use it as target of
the view texture.
* UIProcess/gtk/AcceleratedBackingStoreWayland.h:
* UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager): When using WPE disable hardware acceleration
if wpe_fdo_initialize_for_egl_display() fails.
* UIProcess/gtk/WaylandCompositor.cpp:
* UIProcess/gtk/WaylandCompositor.h:
* WebProcess/WebPage/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::create): Create an AcceleratedSurfaceLibWPE for GTK port when using WPE and shared
display is Wayland.
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp:
(WebKit::AcceleratedSurfaceLibWPE::initialize): Use the shared display for compositing instead of shared display.
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h:
* WebProcess/WebProcess.h:
* WebProcess/glib/WebProcessGLib.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Initialize the wpe display when using WPE.

Tools:

Add WPEBackend-fdo to jhbuild moduleset.

* gtk/jhbuild.modules:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCoreSourcesGTKtxt">trunk/Source/WebCore/SourcesGTK.txt</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGLContextcpp">trunk/Source/WebCore/platform/graphics/GLContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPlatformDisplaycpp">trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPlatformDisplayh">trunk/Source/WebCore/platform/graphics/PlatformDisplay.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicseglGLContextEGLcpp">trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicseglGLContextEGLh">trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicseglGLContextEGLLibWPEcpp">trunk/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBasecpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicslibwpePlatformDisplayLibWPEcpp">trunk/Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicslibwpePlatformDisplayLibWPEh">trunk/Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitPlatformGTKcmake">trunk/Source/WebKit/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKitSharedCoordinatedGraphicsthreadedcompositorThreadedCompositorcpp">trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedWebPageCreationParameterscpp">trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedWebPageCreationParametersh">trunk/Source/WebKit/Shared/WebPageCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKitSharedWebProcessCreationParameterscpp">trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedWebProcessCreationParametersh">trunk/Source/WebKit/Shared/WebProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKitSourcesGTKtxt">trunk/Source/WebKit/SourcesGTK.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkPageClientImplcpp">trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkPageClientImplh">trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkWebKitWebViewBasecpp">trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkWebKitWebViewBasePrivateh">trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessCoordinatedGraphicsDrawingAreaProxyCoordinatedGraphicscpp">trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessPageClienth">trunk/Source/WebKit/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxycpp">trunk/Source/WebKit/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebProcessPoolcpp">trunk/Source/WebKit/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessglibWebProcessPoolGLibcpp">trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessglibWebProcessProxyGLibcpp">trunk/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessgtkAcceleratedBackingStoreh">trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessgtkAcceleratedBackingStoreWaylandcpp">trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessgtkAcceleratedBackingStoreWaylandh">trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessgtkHardwareAccelerationManagercpp">trunk/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessgtkWaylandCompositorcpp">trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessgtkWaylandCompositorh">trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageAcceleratedSurfacecpp">trunk/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagelibwpeAcceleratedSurfaceLibWPEcpp">trunk/Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagelibwpeAcceleratedSurfaceLibWPEh">trunk/Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebProcessh">trunk/Source/WebKit/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessglibWebProcessGLibcpp">trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp</a></li>
<li><a href="#trunkSourcecmakeOptionsGTKcmake">trunk/Source/cmake/OptionsGTK.cmake</a></li>
<li><a href="#trunkSourcecmakeOptionsPlayStationcmake">trunk/Source/cmake/OptionsPlayStation.cmake</a></li>
<li><a href="#trunkSourcecmakeOptionsWPEcmake">trunk/Source/cmake/OptionsWPE.cmake</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsgtkjhbuildmodules">trunk/Tools/gtk/jhbuild.modules</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog  2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/ChangeLog     2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -1,5 +1,18 @@
</span><span class="cx"> 2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><ins>+        [GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
+        https://bugs.webkit.org/show_bug.cgi?id=197944
+
+        Reviewed by Michael Catanzaro.
+
+        Add USE_WPE_RENDERER option to use WPEBackend-fdo.
+
+        * Source/cmake/OptionsGTK.cmake:
+        * Source/cmake/OptionsPlayStation.cmake:
+        * Source/cmake/OptionsWPE.cmake:
+
+2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
+
</ins><span class="cx">         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.1 release
</span><span class="cx"> 
</span><span class="cx">         * Source/cmake/OptionsGTK.cmake: Bump version numbers
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/ChangeLog      2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
+        https://bugs.webkit.org/show_bug.cgi?id=197944
+
+        Reviewed by Michael Catanzaro.
+
+        * PlatformGTK.cmake:
+        * SourcesGTK.txt:
+        * platform/graphics/GLContext.cpp:
+        (WebCore::GLContext::createContextForWindow): Check current display is X11 before trying to create a GLX context.
+        * platform/graphics/PlatformDisplay.cpp:
+        (WebCore::PlatformDisplay::createPlatformDisplay): Use USE(WPE_RENDERER) instead of USE(LIBWPE).
+        * platform/graphics/PlatformDisplay.h:
+        * platform/graphics/egl/GLContextEGL.cpp:
+        (WebCore::GLContextEGL::createWindowContext): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
+        (WebCore::GLContextEGL::createContext): Ditto.
+        (WebCore::GLContextEGL::createSharingContext): Ditto.
+        (WebCore::GLContextEGL::~GLContextEGL): Ditto.
+        * platform/graphics/egl/GLContextEGL.h:
+        * platform/graphics/egl/GLContextEGLLibWPE.cpp:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto.
+        * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
+        (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE): In GTK port set the display as the shared one for compositing.
+        * platform/graphics/libwpe/PlatformDisplayLibWPE.h:
+
</ins><span class="cx"> 2019-05-27  Takashi Komori  <Takashi.Komori@sony.com>
</span><span class="cx"> 
</span><span class="cx">         [CURL] Fix crashing SocketStreamHandle.
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake   2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/PlatformGTK.cmake      2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -36,6 +36,12 @@
</span><span class="cx">     "${WEBCORE_DIR}/platform/text/gtk"
</span><span class="cx"> )
</span><span class="cx"> 
</span><ins>+if (USE_WPE_RENDERER)
+    list(APPEND WebCore_INCLUDE_DIRECTORIES
+        "${WEBCORE_DIR}/platform/graphics/libwpe"
+    )
+endif ()
+
</ins><span class="cx"> list(APPEND WebCorePlatformGTK_SOURCES
</span><span class="cx">     editing/gtk/EditorGtk.cpp
</span><span class="cx"> 
</span><span class="lines">@@ -120,6 +126,12 @@
</span><span class="cx">     ${ZLIB_LIBRARIES}
</span><span class="cx"> )
</span><span class="cx"> 
</span><ins>+if (USE_WPE_RENDERER)
+    list(APPEND WebCore_LIBRARIES
+        ${WPE_LIBRARIES}
+    )
+endif ()
+
</ins><span class="cx"> list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
</span><span class="cx">     ${ATK_INCLUDE_DIRS}
</span><span class="cx">     ${ENCHANT_INCLUDE_DIRS}
</span><span class="lines">@@ -132,6 +144,12 @@
</span><span class="cx">     ${ZLIB_INCLUDE_DIRS}
</span><span class="cx"> )
</span><span class="cx"> 
</span><ins>+if (USE_WPE_RENDERER)
+    list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
+        ${WPE_INCLUDE_DIRS}
+    )
+endif ()
+
</ins><span class="cx"> if (USE_OPENGL_ES)
</span><span class="cx">     list(APPEND WebCore_SOURCES
</span><span class="cx">         platform/graphics/opengl/Extensions3DOpenGLES.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcesGTKtxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/SourcesGTK.txt (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/SourcesGTK.txt      2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/SourcesGTK.txt 2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> platform/graphics/cairo/BackingStoreBackendCairoX11.cpp @no-unify
</span><span class="cx"> 
</span><span class="cx"> platform/graphics/egl/GLContextEGL.cpp
</span><ins>+platform/graphics/egl/GLContextEGLLibWPE.cpp
</ins><span class="cx"> platform/graphics/egl/GLContextEGLWayland.cpp @no-unify
</span><span class="cx"> platform/graphics/egl/GLContextEGLX11.cpp @no-unify
</span><span class="cx"> 
</span><span class="lines">@@ -74,6 +75,8 @@
</span><span class="cx"> 
</span><span class="cx"> platform/graphics/gstreamer/ImageGStreamerCairo.cpp
</span><span class="cx"> 
</span><ins>+platform/graphics/libwpe/PlatformDisplayLibWPE.cpp
+
</ins><span class="cx"> platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
</span><span class="cx"> platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
</span><span class="cx"> platform/graphics/opengl/TemporaryOpenGLSetting.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGLContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GLContext.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GLContext.cpp     2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/platform/graphics/GLContext.cpp        2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -90,8 +90,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(GLX)
</span><del>-    if (auto glxContext = GLContextGLX::createContext(windowHandle, display))
-        return glxContext;
</del><ins>+    if (display.type() == PlatformDisplay::Type::X11) {
+        if (auto glxContext = GLContextGLX::createContext(windowHandle, display))
+            return glxContext;
+    }
</ins><span class="cx"> #endif
</span><span class="cx"> #if USE(EGL)
</span><span class="cx">     if (auto eglContext = GLContextEGL::createContext(windowHandle, display))
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPlatformDisplaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp       2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp  2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> #include "PlatformDisplayWin.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx"> #include "PlatformDisplayLibWPE.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif // PLATFORM(GTK)
</span><span class="cx"> 
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     return PlatformDisplayLibWPE::create();
</span><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx">     return PlatformDisplayWin::create();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPlatformDisplayh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PlatformDisplay.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformDisplay.h 2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/platform/graphics/PlatformDisplay.h    2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">         Windows,
</span><span class="cx"> #endif
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">         WPE,
</span><span class="cx"> #endif
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicseglGLContextEGLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp      2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp 2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -182,7 +182,9 @@
</span><span class="cx">     if (platformDisplay.type() == PlatformDisplay::Type::Wayland)
</span><span class="cx">         surface = createWindowSurfaceWayland(display, config, window);
</span><span class="cx"> #endif
</span><del>-#elif PLATFORM(WPE)
</del><ins>+#endif
+
+#if USE(WPE_RENDERER)
</ins><span class="cx">     if (platformDisplay.type() == PlatformDisplay::Type::WPE)
</span><span class="cx">         surface = createWindowSurfaceWPE(display, config, window);
</span><span class="cx"> #else
</span><span class="lines">@@ -279,7 +281,7 @@
</span><span class="cx">         if (platformDisplay.type() == PlatformDisplay::Type::Wayland)
</span><span class="cx">             context = createWaylandContext(platformDisplay, eglSharingContext);
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">         if (platformDisplay.type() == PlatformDisplay::Type::WPE)
</span><span class="cx">             context = createWPEContext(platformDisplay, eglSharingContext);
</span><span class="cx"> #endif
</span><span class="lines">@@ -316,7 +318,7 @@
</span><span class="cx">         if (platformDisplay.type() == PlatformDisplay::Type::Wayland)
</span><span class="cx">             context = createWaylandContext(platformDisplay);
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">         if (platformDisplay.type() == PlatformDisplay::Type::WPE)
</span><span class="cx">             context = createWPEContext(platformDisplay);
</span><span class="cx"> #endif
</span><span class="lines">@@ -359,7 +361,7 @@
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><span class="cx">     destroyWaylandWindow();
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     destroyWPETarget();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicseglGLContextEGLh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.h        2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.h   2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> struct wl_egl_window;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx"> struct wpe_renderer_backend_egl_offscreen_target;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">     GLContextEGL(PlatformDisplay&, EGLContext, EGLSurface, WlUniquePtr<struct wl_surface>&&, struct wl_egl_window*);
</span><span class="cx">     void destroyWaylandWindow();
</span><span class="cx"> #endif
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     GLContextEGL(PlatformDisplay&, EGLContext, EGLSurface, struct wpe_renderer_backend_egl_offscreen_target*);
</span><span class="cx">     void destroyWPETarget();
</span><span class="cx"> #endif
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     static std::unique_ptr<GLContextEGL> createWaylandContext(PlatformDisplay&, EGLContext sharingContext = nullptr);
</span><span class="cx">     static EGLSurface createWindowSurfaceWayland(EGLDisplay, EGLConfig, GLNativeWindowType);
</span><span class="cx"> #endif
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     static std::unique_ptr<GLContextEGL> createWPEContext(PlatformDisplay&, EGLContext sharingContext = nullptr);
</span><span class="cx">     static EGLSurface createWindowSurfaceWPE(EGLDisplay, EGLConfig, GLNativeWindowType);
</span><span class="cx"> #endif
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">     WlUniquePtr<struct wl_surface> m_wlSurface;
</span><span class="cx">     struct wl_egl_window* m_wlWindow { nullptr };
</span><span class="cx"> #endif
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     struct wpe_renderer_backend_egl_offscreen_target* m_wpeTarget { nullptr };
</span><span class="cx"> #endif
</span><span class="cx"> #if USE(CAIRO)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicseglGLContextEGLLibWPEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp        2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp   2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -19,8 +19,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "GLContextEGL.h"
</span><span class="cx"> 
</span><del>-#if USE(EGL) && USE(LIBWPE)
-
</del><ins>+#if USE(EGL) && USE(WPE_RENDERER)
</ins><span class="cx"> #include "PlatformDisplayLibWPE.h"
</span><span class="cx"> 
</span><span class="cx"> #if USE(LIBEPOXY)
</span><span class="lines">@@ -29,6 +28,11 @@
</span><span class="cx"> #define __GBM__ 1
</span><span class="cx"> #include "EpoxyEGL.h"
</span><span class="cx"> #else
</span><ins>+#if PLATFORM(WAYLAND)
+// These includes need to be in this order because wayland-egl.h defines WL_EGL_PLATFORM
+// and eglplatform.h, included by egl.h, checks that to decide whether it's Wayland platform.
+#include <wayland-egl.h>
+#endif
</ins><span class="cx"> #include <EGL/egl.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -96,4 +100,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-#endif // USE(EGL) && USE(LIBWPE)
</del><ins>+#endif // USE(EGL) && USE(WPE_RENDERER)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp     2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp        2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -102,7 +102,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><span class="cx"> #include "PlatformDisplayWayland.h"
</span><del>-#elif PLATFORM(WPE)
</del><ins>+#endif
+
+#if USE(WPE_RENDERER)
</ins><span class="cx"> #include "PlatformDisplayLibWPE.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -448,7 +450,7 @@
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">         ASSERT(is<PlatformDisplayLibWPE>(sharedDisplay));
</span><span class="cx">         GST_DEBUG_OBJECT(pipeline(), "Creating WPE shared EGL display");
</span><span class="cx">         if (shouldAdoptRef)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicslibwpePlatformDisplayLibWPEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.cpp  2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.cpp     2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PlatformDisplayLibWPE.h"
</span><span class="cx"> 
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx"> 
</span><span class="cx"> #include "GLContextEGL.h"
</span><span class="cx"> 
</span><span class="lines">@@ -36,6 +36,11 @@
</span><span class="cx"> #define __GBM__ 1
</span><span class="cx"> #include "EpoxyEGL.h"
</span><span class="cx"> #else
</span><ins>+#if PLATFORM(WAYLAND)
+// These includes need to be in this order because wayland-egl.h defines WL_EGL_PLATFORM
+// and eglplatform.h, included by egl.h, checks that to decide whether it's Wayland platform.
+#include <wayland-egl.h>
+#endif
</ins><span class="cx"> #include <EGL/egl.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -51,6 +56,9 @@
</span><span class="cx"> PlatformDisplayLibWPE::PlatformDisplayLibWPE()
</span><span class="cx">     : PlatformDisplay(NativeDisplayOwned::No)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(GTK)
+    PlatformDisplay::setSharedDisplayForCompositing(*this);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PlatformDisplayLibWPE::~PlatformDisplayLibWPE()
</span><span class="lines">@@ -73,4 +81,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-#endif // USE(LIBWPE)
</del><ins>+#endif // USE(WPE_RENDERER)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicslibwpePlatformDisplayLibWPEh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.h    2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.h       2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx"> 
</span><span class="cx"> #include "PlatformDisplay.h"
</span><span class="cx"> 
</span><span class="lines">@@ -55,4 +55,4 @@
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_PLATFORM_DISPLAY(PlatformDisplayLibWPE, WPE)
</span><span class="cx"> 
</span><del>-#endif // USE(LIBWPE)
</del><ins>+#endif // USE(WPE_RENDERER)
</ins></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/ChangeLog       2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -1,3 +1,75 @@
</span><ins>+2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
+        https://bugs.webkit.org/show_bug.cgi?id=197944
+
+        Reviewed by Michael Catanzaro.
+
+        The WPEBackend-fdo implementation is quite similar to our Wayland nested compositor, but more efficient (using
+        linux dmabuf, resource caching, etc.). This allows us to share even more code with WPE port too.
+
+        * PlatformGTK.cmake:
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+        (WebKit::ThreadedCompositor::forceRepaint): WPE doesn't support force repaint yet.
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode const): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
+        (WebKit::WebPageCreationParameters::decode): Ditto.
+        * Shared/WebPageCreationParameters.h:
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode const): Ditto.
+        (WebKit::WebProcessCreationParameters::decode): Ditto.
+        * Shared/WebProcessCreationParameters.h:
+        * SourcesGTK.txt:
+        * UIProcess/API/gtk/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::hostFileDescriptor): Implement it when using WPE just calling webkitWebViewBaseRenderHostFileDescriptor().
+        * UIProcess/API/gtk/PageClientImpl.h:
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseCreateWebPage): Initialize the web page after the accelerated backing store is created, since
+        it's used now during intialization.
+        (webkitWebViewBaseRenderHostFileDescriptor): Return AcceleratedBackingStore::renderHostFileDescriptor()
+        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::creationParameters): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::initializeNewWebProcess): Remove wayland display name initialization.
+        * UIProcess/glib/WebProcessPoolGLib.cpp:
+        (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize wayland display name when not using WPE here
+        now. In case of using WPE, initialize hostClientFileDescriptor and implementationLibraryName.
+        * UIProcess/glib/WebProcessProxyGLib.cpp:
+        (WebKit::WebProcessProxy::platformGetLaunchOptions): Remove unused wayland socket command line process parameter.
+        * UIProcess/gtk/AcceleratedBackingStore.h:
+        (WebKit::AcceleratedBackingStore::renderHostFileDescriptor): Return -1 by default.
+        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
+        (WebKit::AcceleratedBackingStoreWayland::create): When using WPE call wpe_fdo_initialize_for_egl_display() and
+        check we have the required extensions.
+        (WebKit::AcceleratedBackingStoreWayland::AcceleratedBackingStoreWayland): When using WPE initialize the view backend.
+        (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland): When using WPE release the EGL images
+        still in use and the view texture.
+        (WebKit::AcceleratedBackingStoreWayland::renderHostFileDescriptor): Call wpe_view_backend_get_renderer_host_fd().
+        (WebKit::AcceleratedBackingStoreWayland::displayBuffer): Create the view texture if needed, save the pending
+        image and schedule a redraw.
+        (WebKit::AcceleratedBackingStoreWayland::paint): When using WPE commit the pending image and use it as target of
+        the view texture.
+        * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
+        * UIProcess/gtk/HardwareAccelerationManager.cpp:
+        (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): When using WPE disable hardware acceleration
+        if wpe_fdo_initialize_for_egl_display() fails.
+        * UIProcess/gtk/WaylandCompositor.cpp:
+        * UIProcess/gtk/WaylandCompositor.h:
+        * WebProcess/WebPage/AcceleratedSurface.cpp:
+        (WebKit::AcceleratedSurface::create): Create an AcceleratedSurfaceLibWPE for GTK port when using WPE and shared
+        display is Wayland.
+        * WebProcess/WebPage/WebPage.cpp:
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp:
+        (WebKit::AcceleratedSurfaceLibWPE::initialize): Use the shared display for compositing instead of shared display.
+        * WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h:
+        * WebProcess/WebProcess.h:
+        * WebProcess/glib/WebProcessGLib.cpp:
+        (WebKit::WebProcess::platformInitializeWebProcess): Initialize the wpe display when using WPE.
+
</ins><span class="cx"> 2019-05-27  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] Dropping in an editable element should result in a ranged selection
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/PlatformGTK.cmake (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/PlatformGTK.cmake    2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/PlatformGTK.cmake       2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -428,6 +428,16 @@
</span><span class="cx">     ${LIBSOUP_INCLUDE_DIRS}
</span><span class="cx"> )
</span><span class="cx"> 
</span><ins>+if (USE_WPE_RENDERER)
+    list(APPEND WebKit_INCLUDE_DIRECTORIES
+        "${WEBKIT_DIR}/WebProcess/WebPage/libwpe"
+    )
+    list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
+        ${WPE_INCLUDE_DIRS}
+        ${WPEBACKEND_FDO_INCLUDE_DIRS}
+    )
+endif ()
+
</ins><span class="cx"> if (USE_LIBNOTIFY)
</span><span class="cx"> list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
</span><span class="cx">     ${LIBNOTIFY_INCLUDE_DIRS}
</span><span class="lines">@@ -464,6 +474,13 @@
</span><span class="cx"> # WebCore should be specifed before and after WebCorePlatformGTK
</span><span class="cx"> list(APPEND WebKit_LIBRARIES PRIVATE WebCore)
</span><span class="cx"> 
</span><ins>+if (USE_WPE_RENDERER)
+    list(APPEND WebKit_LIBRARIES
+      ${WPE_LIBRARIES}
+      ${WPEBACKEND_FDO_LIBRARIES}
+    )
+endif ()
+
</ins><span class="cx"> if (LIBNOTIFY_FOUND)
</span><span class="cx"> list(APPEND WebKit_LIBRARIES
</span><span class="cx">     PRIVATE ${LIBNOTIFY_LIBRARIES}
</span></span></pre></div>
<a id="trunkSourceWebKitSharedCoordinatedGraphicsthreadedcompositorThreadedCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp    2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Enable this for WPE once it's possible to do these forced updates
</span><span class="cx">     // in a way that doesn't starve out the underlying graphics buffers.
</span><del>-#if PLATFORM(GTK)
</del><ins>+#if PLATFORM(GTK) && !USE(WPE_RENDERER)
</ins><span class="cx">     m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] {
</span><span class="cx">         SetForScope<bool> change(m_inForceRepaint, true);
</span><span class="cx">         renderLayerTree();
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebPageCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp 2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp    2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">     encoder << smartInsertDeleteEnabled;
</span><span class="cx">     encoder << additionalSupportedImageTypes;
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     encoder << hostFileDescriptor;
</span><span class="cx"> #endif
</span><span class="cx">     encoder << appleMailPaginationQuirkEnabled;
</span><span class="lines">@@ -302,7 +302,7 @@
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     if (!decoder.decode(parameters.hostFileDescriptor))
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebPageCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebPageCreationParameters.h   2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.h      2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx">     bool smartInsertDeleteEnabled;
</span><span class="cx">     Vector<String> additionalSupportedImageTypes;
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     IPC::Attachment hostFileDescriptor;
</span><span class="cx"> #endif
</span><span class="cx">     bool appleMailPaginationQuirkEnabled;
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp      2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp 2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx">     encoder << useOverlayScrollbars;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     encoder << isServiceWorkerProcess;
</span><span class="cx">     encoder << hostClientFileDescriptor;
</span><span class="cx">     encoder << implementationLibraryName;
</span><span class="lines">@@ -371,7 +371,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     if (!decoder.decode(parameters.isServiceWorkerProcess))
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(parameters.hostClientFileDescriptor))
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h        2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h   2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx">     bool useOverlayScrollbars { true };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     bool isServiceWorkerProcess { false };
</span><span class="cx">     IPC::Attachment hostClientFileDescriptor;
</span><span class="cx">     CString implementationLibraryName;
</span></span></pre></div>
<a id="trunkSourceWebKitSourcesGTKtxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesGTK.txt (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesGTK.txt       2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/SourcesGTK.txt  2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -420,6 +420,8 @@
</span><span class="cx"> WebProcess/WebPage/gtk/WebPageGtk.cpp
</span><span class="cx"> WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
</span><span class="cx"> 
</span><ins>+WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp
+
</ins><span class="cx"> WebProcess/glib/WebProcessGLib.cpp
</span><span class="cx"> 
</span><span class="cx"> WebProcess/gtk/WaylandCompositorDisplay.cpp
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkPageClientImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp 2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp    2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -552,4 +552,11 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(WPE_RENDERER)
+IPC::Attachment PageClientImpl::hostFileDescriptor()
+{
+    return webkitWebViewBaseRenderHostFileDescriptor(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
+}
+#endif
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h   2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h      2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -164,6 +164,10 @@
</span><span class="cx"> 
</span><span class="cx">     bool effectiveAppearanceIsDark() const override;
</span><span class="cx"> 
</span><ins>+#if USE(WPE_RENDERER)
+    IPC::Attachment hostFileDescriptor() override;
+#endif
+
</ins><span class="cx">     // Members of PageClientImpl class
</span><span class="cx">     GtkWidget* m_viewWidget;
</span><span class="cx">     DefaultUndoController m_undoController;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkWebKitWebViewBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp      2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp 2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -1459,10 +1459,9 @@
</span><span class="cx">     WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
</span><span class="cx">     WebProcessPool* processPool = configuration->processPool();
</span><span class="cx">     priv->pageProxy = processPool->createWebPage(*priv->pageClient, WTFMove(configuration));
</span><ins>+    priv->acceleratedBackingStore = AcceleratedBackingStore::create(*priv->pageProxy);
</ins><span class="cx">     priv->pageProxy->initializeWebPage();
</span><span class="cx"> 
</span><del>-    priv->acceleratedBackingStore = AcceleratedBackingStore::create(*priv->pageProxy);
-
</del><span class="cx">     priv->inputMethodFilter.setPage(priv->pageProxy.get());
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(GTK_SCALE_FACTOR)
</span><span class="lines">@@ -1829,3 +1828,12 @@
</span><span class="cx">     completionHandler(emptyString());
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><ins>+
+#if USE(WPE_RENDERER)
+int webkitWebViewBaseRenderHostFileDescriptor(WebKitWebViewBase* webkitWebViewBase)
+{
+    if (webkitWebViewBase->priv->acceleratedBackingStore)
+        return webkitWebViewBase->priv->acceleratedBackingStore->renderHostFileDescriptor();
+    return -1;
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkWebKitWebViewBasePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h 2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h    2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -95,3 +95,7 @@
</span><span class="cx"> void webkitWebViewBaseDidRestoreScrollPosition(WebKitWebViewBase*);
</span><span class="cx"> 
</span><span class="cx"> void webkitWebViewBaseShowEmojiChooser(WebKitWebViewBase*, const WebCore::IntRect&, CompletionHandler<void(String)>&&);
</span><ins>+
+#if USE(WPE_RENDERER)
+int webkitWebViewBaseRenderHostFileDescriptor(WebKitWebViewBase*);
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessCoordinatedGraphicsDrawingAreaProxyCoordinatedGraphicscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp        2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp   2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "WebPageProxy.h"
</span><span class="cx"> #include "WebPreferences.h"
</span><span class="cx"> #include "WebProcessProxy.h"
</span><ins>+#include <WebCore/PlatformDisplay.h>
</ins><span class="cx"> #include <WebCore/Region.h>
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="lines">@@ -41,11 +42,6 @@
</span><span class="cx"> #include <gtk/gtk.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WAYLAND)
-#include "WaylandCompositor.h"
-#include <WebCore/PlatformDisplay.h>
-#endif
-
</del><span class="cx"> #if USE(GLIB_EVENT_LOOP)
</span><span class="cx"> #include <wtf/glib/RunLoopSourcePriority.h>
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/PageClient.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/PageClient.h       2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/PageClient.h  2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -505,7 +505,7 @@
</span><span class="cx">     virtual WTF::Optional<unsigned> activeTouchIdentifierForGestureRecognizer(UIGestureRecognizer*) { return WTF::nullopt; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     virtual IPC::Attachment hostFileDescriptor() = 0;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp   2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp      2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -7182,7 +7182,7 @@
</span><span class="cx">     parameters.overrideContentSecurityPolicy = m_overrideContentSecurityPolicy;
</span><span class="cx">     parameters.cpuLimit = m_cpuLimit;
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     parameters.hostFileDescriptor = pageClient().hostFileDescriptor();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp    2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -117,11 +117,6 @@
</span><span class="cx"> #include "MemoryPressureMonitor.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WAYLAND)
-#include "WaylandCompositor.h"
-#include <WebCore/PlatformDisplay.h>
-#endif
-
</del><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> #include "VersionChecks.h"
</span><span class="cx"> #endif
</span><span class="lines">@@ -979,11 +974,6 @@
</span><span class="cx">     parameters.shouldEnableMemoryPressureReliefLogging = true;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WAYLAND) && USE(EGL)
-    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland)
-        parameters.waylandCompositorDisplayName = WaylandCompositor::singleton().displayName();
-#endif
-
</del><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx">     parameters.shouldCaptureAudioInUIProcess = m_configuration->shouldCaptureAudioInUIProcess();
</span><span class="cx">     parameters.shouldCaptureVideoInUIProcess = m_configuration->shouldCaptureVideoInUIProcess();
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessglibWebProcessPoolGLibcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp        2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp   2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -31,15 +31,23 @@
</span><span class="cx"> #include "WebMemoryPressureHandler.h"
</span><span class="cx"> #include "WebProcessCreationParameters.h"
</span><span class="cx"> #include <JavaScriptCore/RemoteInspectorServer.h>
</span><ins>+#include <WebCore/PlatformDisplay.h>
+#include <wtf/FileSystem.h>
+#include <wtf/glib/GUniquePtr.h>
</ins><span class="cx"> 
</span><span class="cx"> #if USE(GSTREAMER)
</span><span class="cx"> #include <WebCore/GStreamerCommon.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#include <wtf/FileSystem.h>
-#include <wtf/glib/GUniquePtr.h>
</del><ins>+#if PLATFORM(WAYLAND)
+#if USE(WPE_RENDERER)
+#include <wpe/fdo-egl.h>
+#else
+#include "WaylandCompositor.h"
+#endif
+#endif
</ins><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx"> #include <wpe/wpe.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -108,6 +116,20 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(WAYLAND)
+    if (WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::Wayland) {
+#if USE(WPE_RENDERER)
+        wpe_loader_init("libWPEBackend-fdo-1.0.so");
+        if (wpe_fdo_initialize_for_egl_display(WebCore::PlatformDisplay::sharedDisplay().eglDisplay())) {
+            parameters.hostClientFileDescriptor = wpe_renderer_host_create_client();
+            parameters.implementationLibraryName = FileSystem::fileSystemRepresentation(wpe_loader_get_loaded_implementation_library_name());
+        }
+#else
+        parameters.waylandCompositorDisplayName = WaylandCompositor::singleton().displayName();
+#endif
+    }
+#endif
+
</ins><span class="cx">     parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModel::DocumentViewer;
</span><span class="cx">     parameters.proxySettings = m_networkProxySettings;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessglibWebProcessProxyGLibcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp       2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp  2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -26,9 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "WebProcessProxy.h"
</span><span class="cx"> 
</span><del>-#if PLATFORM(WAYLAND) && USE(EGL)
-#include "WaylandCompositor.h"
-#endif
</del><span class="cx"> #include "WebProcessPool.h"
</span><span class="cx"> #include "WebsiteDataStore.h"
</span><span class="cx"> #include <WebCore/PlatformDisplay.h>
</span><span class="lines">@@ -47,15 +44,6 @@
</span><span class="cx">     launchOptions.extraInitializationData.set("applicationCacheDirectory", websiteDataStore().resolvedApplicationCacheDirectory());
</span><span class="cx"> 
</span><span class="cx">     launchOptions.extraWebProcessSandboxPaths = m_processPool->sandboxPaths();
</span><del>-
-#if PLATFORM(WAYLAND) && USE(EGL)
-    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland) {
-        String displayName = WaylandCompositor::singleton().displayName();
-        String runtimeDir(g_get_user_runtime_dir());
-        String waylandSocket = FileSystem::pathByAppendingComponent(runtimeDir, displayName);
-        launchOptions.extraInitializationData.set("waylandSocket", waylandSocket);
-    }
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessgtkAcceleratedBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h      2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h 2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">     virtual void update(const LayerTreeContext&) { }
</span><span class="cx">     virtual bool paint(cairo_t*, const WebCore::IntRect&) = 0;
</span><span class="cx">     virtual bool makeContextCurrent() { return false; }
</span><ins>+    virtual int renderHostFileDescriptor() { return -1; }
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     AcceleratedBackingStore(WebPageProxy&);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessgtkAcceleratedBackingStoreWaylandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp     2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp        2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016 Igalia S.L.
</del><ins>+ * Copyright (C) 2016, 2019 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,24 +28,72 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WAYLAND) && USE(EGL)
</span><span class="cx"> 
</span><del>-#include "WaylandCompositor.h"
</del><span class="cx"> #include "WebPageProxy.h"
</span><ins>+// These includes need to be in this order because wayland-egl.h defines WL_EGL_PLATFORM
+// and eglplatform.h, included by egl.h, checks that to decide whether it's Wayland platform.
+#include <gdk/gdkwayland.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
</ins><span class="cx"> #include <WebCore/CairoUtilities.h>
</span><span class="cx"> #include <WebCore/GLContext.h>
</span><span class="cx"> 
</span><span class="cx"> #if USE(OPENGL_ES)
</span><span class="cx"> #include <GLES2/gl2.h>
</span><ins>+#include <GLES2/gl2ext.h>
+#include <WebCore/Extensions3DOpenGLES.h>
</ins><span class="cx"> #else
</span><ins>+#include <WebCore/Extensions3DOpenGL.h>
</ins><span class="cx"> #include <WebCore/OpenGLShims.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(WPE_RENDERER)
+#include <wpe/fdo-egl.h>
+#else
+#include "WaylandCompositor.h"
+#endif
+
+#if USE(WPE_RENDERER)
+#if !defined(PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)
+typedef void (*PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES);
+#endif
+
+static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glImageTargetTexture2D;
+#endif
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr<AcceleratedBackingStoreWayland> AcceleratedBackingStoreWayland::create(WebPageProxy& webPage)
</span><span class="cx"> {
</span><ins>+#if USE(WPE_RENDERER)
+    if (!glImageTargetTexture2D) {
+        if (!wpe_fdo_initialize_for_egl_display(PlatformDisplay::sharedDisplay().eglDisplay()))
+            return nullptr;
+
+        std::unique_ptr<WebCore::GLContext> eglContext = GLContext::createOffscreenContext();
+        if (!eglContext)
+            return nullptr;
+
+        if (!eglContext->makeContextCurrent())
+            return nullptr;
+
+#if USE(OPENGL_ES)
+        std::unique_ptr<Extensions3DOpenGLES> glExtensions = std::make_unique<Extensions3DOpenGLES>(nullptr,  false);
+#else
+        std::unique_ptr<Extensions3DOpenGL> glExtensions = std::make_unique<Extensions3DOpenGL>(nullptr, GLContext::current()->version() >= 320);
+#endif
+        if (glExtensions->supports("GL_OES_EGL_image") || glExtensions->supports("GL_OES_EGL_image_external"))
+            glImageTargetTexture2D = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
+    }
+
+    if (!glImageTargetTexture2D) {
+        WTFLogAlways("AcceleratedBackingStoreWPE requires glEGLImageTargetTexture2D.");
+        return nullptr;
+    }
+#else
</ins><span class="cx">     if (!WaylandCompositor::singleton().isRunning())
</span><span class="cx">         return nullptr;
</span><ins>+#endif
</ins><span class="cx">     return std::unique_ptr<AcceleratedBackingStoreWayland>(new AcceleratedBackingStoreWayland(webPage));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -52,12 +100,41 @@
</span><span class="cx"> AcceleratedBackingStoreWayland::AcceleratedBackingStoreWayland(WebPageProxy& webPage)
</span><span class="cx">     : AcceleratedBackingStore(webPage)
</span><span class="cx"> {
</span><ins>+#if USE(WPE_RENDERER)
+    static struct wpe_view_backend_exportable_fdo_egl_client exportableClient = {
+        // export_egl_image
+        nullptr,
+        // export_fdo_egl_image
+        [](void* data, struct wpe_fdo_egl_exported_image* image)
+        {
+            static_cast<AcceleratedBackingStoreWayland*>(data)->displayBuffer(image);
+        },
+        // padding
+        nullptr, nullptr, nullptr
+    };
+
+    auto viewSize = webPage.viewSize();
+    m_exportable = wpe_view_backend_exportable_fdo_egl_create(&exportableClient, this, viewSize.width(), viewSize.height());
+    wpe_view_backend_initialize(wpe_view_backend_exportable_fdo_get_view_backend(m_exportable));
+#else
</ins><span class="cx">     WaylandCompositor::singleton().registerWebPage(m_webPage);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland()
</span><span class="cx"> {
</span><ins>+#if USE(WPE_RENDERER)
+    if (m_pendingImage)
+        wpe_view_backend_exportable_fdo_egl_dispatch_release_exported_image(m_exportable, m_pendingImage);
+    if (m_committedImage)
+        wpe_view_backend_exportable_fdo_egl_dispatch_release_exported_image(m_exportable, m_committedImage);
+    if (m_viewTexture) {
+        if (makeContextCurrent())
+            glDeleteTextures(1, &m_viewTexture);
+    }
+#else
</ins><span class="cx">     WaylandCompositor::singleton().unregisterWebPage(m_webPage);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if GTK_CHECK_VERSION(3, 16, 0)
</span><span class="cx">     if (m_gdkGLContext && m_gdkGLContext.get() == gdk_gl_context_get_current())
</span><span class="lines">@@ -102,12 +179,64 @@
</span><span class="cx">     return m_glContext ? m_glContext->makeContextCurrent() : false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(WPE_RENDERER)
+int AcceleratedBackingStoreWayland::renderHostFileDescriptor()
+{
+    return wpe_view_backend_get_renderer_host_fd(wpe_view_backend_exportable_fdo_get_view_backend(m_exportable));
+}
+
+void AcceleratedBackingStoreWayland::displayBuffer(struct wpe_fdo_egl_exported_image* image)
+{
+    if (!m_viewTexture) {
+        if (!makeContextCurrent())
+            return;
+
+        glGenTextures(1, &m_viewTexture);
+        glBindTexture(GL_TEXTURE_2D, m_viewTexture);
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+    }
+
+    if (m_pendingImage)
+        wpe_view_backend_exportable_fdo_egl_dispatch_release_image(m_exportable, m_pendingImage);
+    m_pendingImage = image;
+
+    m_webPage.setViewNeedsDisplay(IntRect(IntPoint::zero(), m_webPage.viewSize()));
+}
+#endif
+
</ins><span class="cx"> bool AcceleratedBackingStoreWayland::paint(cairo_t* cr, const IntRect& clipRect)
</span><span class="cx"> {
</span><span class="cx">     GLuint texture;
</span><span class="cx">     IntSize textureSize;
</span><ins>+
+#if USE(WPE_RENDERER)
+    if (!makeContextCurrent())
+        return false;
+
+    if (m_pendingImage) {
+        wpe_view_backend_exportable_fdo_dispatch_frame_complete(m_exportable);
+
+        if (m_committedImage)
+            wpe_view_backend_exportable_fdo_egl_dispatch_release_exported_image(m_exportable, m_committedImage);
+        m_committedImage = m_pendingImage;
+        m_pendingImage = nullptr;
+    }
+
+    if (!m_committedImage)
+        return true;
+
+    glBindTexture(GL_TEXTURE_2D, m_viewTexture);
+    glImageTargetTexture2D(GL_TEXTURE_2D, wpe_fdo_egl_exported_image_get_egl_image(m_committedImage));
+
+    texture = m_viewTexture;
+    textureSize = { static_cast<int>(wpe_fdo_egl_exported_image_get_width(m_committedImage)), static_cast<int>(wpe_fdo_egl_exported_image_get_height(m_committedImage)) };
+#else
</ins><span class="cx">     if (!WaylandCompositor::singleton().getTexture(m_webPage, texture, textureSize))
</span><span class="cx">         return false;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     cairo_save(cr);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessgtkAcceleratedBackingStoreWaylandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.h       2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.h  2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -33,7 +33,13 @@
</span><span class="cx"> #include <gtk/gtk.h>
</span><span class="cx"> #include <wtf/glib/GRefPtr.h>
</span><span class="cx"> 
</span><ins>+#if USE(WPE_RENDERER)
+#include <wpe/fdo.h>
+#endif
+
+typedef void* EGLImageKHR;
</ins><span class="cx"> typedef struct _GdkGLContext GdkGLContext;
</span><ins>+struct wpe_fdo_egl_exported_image;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class GLContext;
</span><span class="lines">@@ -53,9 +59,15 @@
</span><span class="cx">     AcceleratedBackingStoreWayland(WebPageProxy&);
</span><span class="cx"> 
</span><span class="cx">     void tryEnsureGLContext();
</span><ins>+#if USE(WPE_RENDERER)
+    void displayBuffer(struct wpe_fdo_egl_exported_image*);
+#endif
</ins><span class="cx"> 
</span><span class="cx">     bool paint(cairo_t*, const WebCore::IntRect&) override;
</span><span class="cx">     bool makeContextCurrent() override;
</span><ins>+#if USE(WPE_RENDERER)
+    int renderHostFileDescriptor() override;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     RefPtr<cairo_surface_t> m_surface;
</span><span class="cx">     bool m_glContextInitialized { false };
</span><span class="lines">@@ -63,6 +75,13 @@
</span><span class="cx">     GRefPtr<GdkGLContext> m_gdkGLContext;
</span><span class="cx"> #endif
</span><span class="cx">     std::unique_ptr<WebCore::GLContext> m_glContext;
</span><ins>+
+#if USE(WPE_RENDERER)
+    struct wpe_view_backend_exportable_fdo* m_exportable { nullptr };
+    unsigned m_viewTexture { 0 };
+    struct wpe_fdo_egl_exported_image* m_committedImage { nullptr };
+    struct wpe_fdo_egl_exported_image* m_pendingImage { nullptr };
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessgtkHardwareAccelerationManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp        2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp   2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "HardwareAccelerationManager.h"
</span><span class="cx"> 
</span><del>-#include "WaylandCompositor.h"
</del><span class="cx"> #include <WebCore/NotImplemented.h>
</span><span class="cx"> #include <WebCore/PlatformDisplay.h>
</span><span class="cx"> 
</span><span class="lines">@@ -34,6 +33,14 @@
</span><span class="cx"> #include <WebCore/PlatformDisplayX11.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(WAYLAND)
+#if USE(WPE_RENDERER)
+#include <wpe/fdo-egl.h>
+#else
+#include "WaylandCompositor.h"
+#endif
+#endif
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -71,10 +78,17 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WAYLAND) && USE(EGL)
</span><span class="cx">     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland) {
</span><ins>+#if USE(WPE_RENDERER)
+        if (!wpe_fdo_initialize_for_egl_display(PlatformDisplay::sharedDisplay().eglDisplay())) {
+            m_canUseHardwareAcceleration = false;
+            return;
+        }
+#else
</ins><span class="cx">         if (!WaylandCompositor::singleton().isRunning()) {
</span><span class="cx">             m_canUseHardwareAcceleration = false;
</span><span class="cx">             return;
</span><span class="cx">         }
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessgtkWaylandCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp  2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp     2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "WaylandCompositor.h"
</span><span class="cx"> 
</span><del>-#if PLATFORM(WAYLAND) && USE(EGL)
</del><ins>+#if PLATFORM(WAYLAND) && USE(EGL) && !USE(WPE_RENDERER)
</ins><span class="cx"> 
</span><span class="cx"> #include "WebKitWaylandServerProtocol.h"
</span><span class="cx"> #include <EGL/egl.h>
</span><span class="lines">@@ -576,4 +576,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><del>-#endif // PLATFORM(WAYLAND) && USE(EGL)
</del><ins>+#endif // PLATFORM(WAYLAND) && USE(EGL) && !USE(WPE_RENDERER)
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessgtkWaylandCompositorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.h    2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.h       2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#if PLATFORM(WAYLAND) && USE(EGL)
</del><ins>+#if PLATFORM(WAYLAND) && USE(EGL) && !USE(WPE_RENDERER)
</ins><span class="cx"> 
</span><span class="cx"> #include "WebPageProxy.h"
</span><span class="cx"> #include <WebCore/RefPtrCairo.h>
</span><span class="lines">@@ -129,4 +129,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><del>-#endif // PLATFORM(WAYLAND) && USE(EGL)
</del><ins>+#endif // PLATFORM(WAYLAND) && USE(EGL) && !USE(WPE_RENDERER)
</ins></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageAcceleratedSurfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp    2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp       2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> #include "AcceleratedSurfaceX11.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(LIBWPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx"> #include "AcceleratedSurfaceLibWPE.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -48,8 +48,12 @@
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><span class="cx">     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland)
</span><ins>+#if USE(WPE_RENDERER)
+        return AcceleratedSurfaceLibWPE::create(webPage, client);
+#else
</ins><span class="cx">         return AcceleratedSurfaceWayland::create(webPage, client);
</span><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
</span><span class="cx">     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11)
</span><span class="cx">         return AcceleratedSurfaceX11::create(webPage, client);
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -423,7 +423,7 @@
</span><span class="cx">     , m_userInterfaceLayoutDirection(parameters.userInterfaceLayoutDirection)
</span><span class="cx">     , m_overrideContentSecurityPolicy { parameters.overrideContentSecurityPolicy }
</span><span class="cx">     , m_cpuLimit(parameters.cpuLimit)
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     , m_hostFileDescriptor(WTFMove(parameters.hostFileDescriptor))
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(VIEWPORT_RESIZING)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -1155,7 +1155,7 @@
</span><span class="cx">     void didFinishLoadingApplicationManifest(uint64_t, const Optional<WebCore::ApplicationManifest>&);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     int releaseHostFileDescriptor() { return m_hostFileDescriptor.releaseFileDescriptor(); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -1917,7 +1917,7 @@
</span><span class="cx">     const String m_overrideContentSecurityPolicy;
</span><span class="cx">     const Optional<double> m_cpuLimit;
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx">     IPC::Attachment m_hostFileDescriptor;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagelibwpeAcceleratedSurfaceLibWPEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp       2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp  2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "AcceleratedSurfaceLibWPE.h"
</span><span class="cx"> 
</span><ins>+#if USE(WPE_RENDERER)
+
</ins><span class="cx"> #include "WebPage.h"
</span><span class="cx"> #include <WebCore/PlatformDisplayLibWPE.h>
</span><span class="cx"> #include <wpe/wpe-egl.h>
</span><span class="lines">@@ -65,7 +67,7 @@
</span><span class="cx">         nullptr
</span><span class="cx">     };
</span><span class="cx">     wpe_renderer_backend_egl_target_set_client(m_backend, &s_client, this);
</span><del>-    wpe_renderer_backend_egl_target_initialize(m_backend, downcast<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()).backend(),
</del><ins>+    wpe_renderer_backend_egl_target_initialize(m_backend, downcast<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplayForCompositing()).backend(),
</ins><span class="cx">         std::max(1, m_size.width()), std::max(1, m_size.height()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -111,3 +113,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><ins>+#endif // USE(WPE_RENDERER)
</ins></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagelibwpeAcceleratedSurfaceLibWPEh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h 2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h    2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx"> 
</span><span class="cx"> #include "AcceleratedSurface.h"
</span><span class="cx"> 
</span><span class="lines">@@ -44,7 +44,14 @@
</span><span class="cx">     uint64_t window() const override;
</span><span class="cx">     uint64_t surfaceID() const override;
</span><span class="cx">     void clientResize(const WebCore::IntSize&) override;
</span><del>-    bool shouldPaintMirrored() const override { return false; }
</del><ins>+    bool shouldPaintMirrored() const override
+    {
+#if PLATFORM(GTK)
+        return true;
+#else
+        return false;
+#endif
+    }
</ins><span class="cx"> 
</span><span class="cx">     void initialize() override;
</span><span class="cx">     void finalize() override;
</span><span class="lines">@@ -59,4 +66,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><del>-#endif // PLATFORM(WPE)
</del><ins>+#endif // USE(WPE_RENDERER)
</ins></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebProcess.h      2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h 2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -63,6 +63,10 @@
</span><span class="cx"> #include "ProcessTaskStateObserver.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(WAYLAND) && USE(WPE_RENDERER)
+#include <WebCore/PlatformDisplayLibWPE.h>
+#endif
+
</ins><span class="cx"> namespace API {
</span><span class="cx"> class Object;
</span><span class="cx"> }
</span><span class="lines">@@ -552,6 +556,11 @@
</span><span class="cx"> #if PLATFORM(WAYLAND)
</span><span class="cx">     std::unique_ptr<WaylandCompositorDisplay> m_waylandCompositorDisplay;
</span><span class="cx"> #endif
</span><ins>+
+#if PLATFORM(WAYLAND) && USE(WPE_RENDERER)
+    std::unique_ptr<WebCore::PlatformDisplayLibWPE> m_wpeDisplay;
+#endif
+
</ins><span class="cx">     bool m_hasSuspendedPageProxy { false };
</span><span class="cx">     bool m_isSuspending { false };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessglibWebProcessGLibcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp   2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp      2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> #include "WaylandCompositorDisplay.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(WPE)
</del><ins>+#if USE(WPE_RENDERER)
</ins><span class="cx"> #include <WebCore/PlatformDisplayLibWPE.h>
</span><span class="cx"> #include <wpe/wpe.h>
</span><span class="cx"> #endif
</span><span class="lines">@@ -65,9 +65,24 @@
</span><span class="cx">         downcast<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()).initialize(parameters.hostClientFileDescriptor.releaseFileDescriptor());
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(WAYLAND)
</span><del>-    m_waylandCompositorDisplay = WaylandCompositorDisplay::create(parameters.waylandCompositorDisplayName);
</del><ins>+    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland) {
+#if USE(WPE_RENDERER)
+        if (!parameters.isServiceWorkerProcess) {
+            auto hostClientFileDescriptor = parameters.hostClientFileDescriptor.releaseFileDescriptor();
+            if (hostClientFileDescriptor != -1) {
+                wpe_loader_init(parameters.implementationLibraryName.data());
+                m_wpeDisplay = WebCore::PlatformDisplayLibWPE::create();
+                m_wpeDisplay->initialize(hostClientFileDescriptor);
+            }
+        }
+#else
+        m_waylandCompositorDisplay = WaylandCompositorDisplay::create(parameters.waylandCompositorDisplayName);
</ins><span class="cx"> #endif
</span><ins>+    }
+#endif
+
</ins><span class="cx"> #if USE(GSTREAMER)
</span><span class="cx">     WebCore::initializeGStreamer(WTFMove(parameters.gstreamerOptions));
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourcecmakeOptionsGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsGTK.cmake (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsGTK.cmake      2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/cmake/OptionsGTK.cmake 2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -86,6 +86,7 @@
</span><span class="cx"> WEBKIT_OPTION_DEFINE(USE_LIBSECRET "Whether to enable the persistent credential storage using libsecret." PUBLIC ON)
</span><span class="cx"> WEBKIT_OPTION_DEFINE(USE_OPENJPEG "Whether to enable support for JPEG2000 images." PUBLIC ON)
</span><span class="cx"> WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON)
</span><ins>+WEBKIT_OPTION_DEFINE(USE_WPE_RENDERER "Whether to enable WPE rendering" PUBLIC ON)
</ins><span class="cx"> 
</span><span class="cx"> # Private options specific to the GTK+ port. Changing these options is
</span><span class="cx"> # completely unsupported. They are intended for use only by WebKit developers.
</span><span class="lines">@@ -103,6 +104,8 @@
</span><span class="cx"> WEBKIT_OPTION_DEPEND(ENABLE_WEBGL ENABLE_OPENGL)
</span><span class="cx"> WEBKIT_OPTION_DEPEND(USE_REDIRECTED_XCOMPOSITE_WINDOW ENABLE_OPENGL)
</span><span class="cx"> WEBKIT_OPTION_DEPEND(USE_REDIRECTED_XCOMPOSITE_WINDOW ENABLE_X11_TARGET)
</span><ins>+WEBKIT_OPTION_DEPEND(USE_WPE_RENDERER ENABLE_OPENGL)
+WEBKIT_OPTION_DEPEND(USE_WPE_RENDERER ENABLE_WAYLAND_TARGET)
</ins><span class="cx"> 
</span><span class="cx"> SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE})
</span><span class="cx"> if (DEVELOPER_MODE)
</span><span class="lines">@@ -199,6 +202,18 @@
</span><span class="cx"> set(glib_components gio gio-unix gobject gthread gmodule)
</span><span class="cx"> find_package(GLIB 2.36 REQUIRED COMPONENTS ${glib_components})
</span><span class="cx"> 
</span><ins>+if (USE_WPE_RENDERER)
+    find_package(WPE 1.3.0)
+    if (NOT WPE_FOUND)
+        message(FATAL_ERROR "libwpe is required for USE_WPE_RENDERER")
+    endif ()
+
+    find_package(WPEBackend-fdo 1.3.0)
+    if (NOT WPEBACKEND_FDO_FOUND)
+        message(FATAL_ERROR "WPEBackend-fdo is required for USE_WPE_RENDERER")
+    endif ()
+endif ()
+
</ins><span class="cx"> if (ENABLE_XSLT)
</span><span class="cx">     find_package(LibXslt 1.1.7 REQUIRED)
</span><span class="cx"> endif ()
</span></span></pre></div>
<a id="trunkSourcecmakeOptionsPlayStationcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsPlayStation.cmake (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsPlayStation.cmake      2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/cmake/OptionsPlayStation.cmake 2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx"> SET_AND_EXPOSE_TO_BUILD(USE_FREETYPE ON)
</span><span class="cx"> SET_AND_EXPOSE_TO_BUILD(USE_HARFBUZZ ON)
</span><span class="cx"> SET_AND_EXPOSE_TO_BUILD(USE_LIBWPE ON)
</span><ins>+SET_AND_EXPOSE_TO_BUILD(USE_WPE_RENDERER ON)
</ins><span class="cx"> 
</span><span class="cx"> SET_AND_EXPOSE_TO_BUILD(USE_INSPECTOR_SOCKET_SERVER ${ENABLE_REMOTE_INSPECTOR})
</span><span class="cx"> SET_AND_EXPOSE_TO_BUILD(USE_UNIX_DOMAIN_SOCKETS ON)
</span></span></pre></div>
<a id="trunkSourcecmakeOptionsWPEcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsWPE.cmake (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsWPE.cmake      2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Source/cmake/OptionsWPE.cmake 2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -172,6 +172,7 @@
</span><span class="cx"> SET_AND_EXPOSE_TO_BUILD(USE_LIBEPOXY TRUE)
</span><span class="cx"> SET_AND_EXPOSE_TO_BUILD(USE_LIBWPE TRUE)
</span><span class="cx"> SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES TRUE)
</span><ins>+SET_AND_EXPOSE_TO_BUILD(USE_WPE_RENDERER TRUE)
</ins><span class="cx"> SET_AND_EXPOSE_TO_BUILD(USE_XDGMIME TRUE)
</span><span class="cx"> 
</span><span class="cx"> if (WTF_CPU_ARM OR WTF_CPU_MIPS)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Tools/ChangeLog       2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
+        https://bugs.webkit.org/show_bug.cgi?id=197944
+
+        Reviewed by Michael Catanzaro.
+
+        Add WPEBackend-fdo to jhbuild moduleset.
+
+        * gtk/jhbuild.modules:
+
</ins><span class="cx"> 2019-05-27  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] Dropping in an editable element should result in a ranged selection
</span></span></pre></div>
<a id="trunkToolsgtkjhbuildmodules"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/jhbuild.modules (245806 => 245807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/jhbuild.modules  2019-05-28 04:06:07 UTC (rev 245806)
+++ trunk/Tools/gtk/jhbuild.modules     2019-05-28 06:36:34 UTC (rev 245807)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx">       <dep package="libgpg-error"/>
</span><span class="cx">       <dep package="libgcrypt"/>
</span><span class="cx">       <dep package="openjpeg"/>
</span><ins>+      <dep package="wpebackend-fdo"/>
</ins><span class="cx">       <if condition-set="linux">
</span><span class="cx">           <dep package="xdg-dbus-proxy"/>
</span><span class="cx">           <dep package="xserver"/>
</span><span class="lines">@@ -81,6 +82,8 @@
</span><span class="cx">       href="http://webkitgtk.org/jhbuild_mirror/"/>
</span><span class="cx">   <repository type="tarball" name="gnupg.org"
</span><span class="cx">       href="https://www.gnupg.org/ftp/gcrypt/"/>
</span><ins>+  <repository type="tarball" name="wpewebkit"
+      href="https://wpewebkit.org/releases/"/>
</ins><span class="cx"> 
</span><span class="cx">   <cmake id="brotli">
</span><span class="cx">     <branch repo="github.com" module="google/brotli.git" checkoutdir="brotli" tag="v1.0.5"/>
</span><span class="lines">@@ -464,6 +467,20 @@
</span><span class="cx">             hash="sha256:3dc787c1bb6023ba846c2a0d9b1f6e179f1cd255172bde9eb75b01f1e6c7d71a"/>
</span><span class="cx">   </cmake>
</span><span class="cx"> 
</span><ins>+  <cmake id="libwpe">
+    <branch repo="wpewebkit" module="libwpe-1.3.0.tar.xz" version="1.3.0"
+            hash="sha256:68986647af2433e74f830a06a497ed536dbc8721b04026ed82611a584be71148"/>
+  </cmake>
+
+  <cmake id="wpebackend-fdo">
+    <dependencies>
+      <dep package="libwpe"/>
+      <dep package="glib"/>
+    </dependencies>
+    <branch repo="wpewebkit" module="wpebackend-fdo-1.3.0.tar.xz" version="1.3.0"
+            hash="sha256:fed9ab29f5d53cf465188da80d014f3aa067c77704f8508c6bd17971fded359d"/>
+  </cmake>
+
</ins><span class="cx">   <!-- Dependencies listed below this point are not thought to affect test results, and are only
</span><span class="cx">        included because they themselves depend on other dependencies built by jhbuild. -->
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>