<!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>[202621] trunk/Source/WebKit2</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/202621">202621</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-29 05:16:41 -0700 (Wed, 29 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Too much duplicated code in LayerTreeHosts implementations
https://bugs.webkit.org/show_bug.cgi?id=159144

Reviewed by Žan Doberšek.

There's some code common and duplicated in all current LayerTreeHosts implementations (Gtk, Coordinated, and
ThreadedCoordinated). The thing is even worse in the case of ThreadedCoordinated and Coordinated, where the
former is actually a special case of the later, and it seems like code was copy pasted and then modified to add
ThreadedCoordinated specific code. The problem of that approach, apart from the code duplication, is that common
parts end up diverging too. This patch moves the common parts to the base class LayerTreeHost and makes
ThreadedCoordinatedLayerTreeHost inherit from CoordinatedLayerTreeHost, to share the common code and simply add
the specific one.

* PlatformGTK.cmake:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
(WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
(WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
(WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
(WebKit::CoordinatedLayerTreeHost::invalidate):
(WebKit::CoordinatedLayerTreeHost::sizeDidChange):
(WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
(WebKit::CoordinatedLayerTreeHost::commitSceneState):
(WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
(WebKit::CoordinatedLayerTreeHost::cancelPendingLayerFlush): Deleted.
(WebKit::CoordinatedLayerTreeHost::forceRepaint): Deleted.
(WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): Deleted.
(WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): Deleted.
(WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Deleted.
(WebKit::CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Deleted.
(WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
(WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
(WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect):
(WebKit::ThreadedCoordinatedLayerTreeHost::commitSceneState):
(WebKit::ThreadedCoordinatedLayerTreeHost::create): Deleted.
(WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): Deleted.
(WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Deleted.
(WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted.
(WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged): Deleted.
(WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::layerHostDidFlushLayers):
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::~LayerTreeHost):
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
(WebKit::LayerTreeHost::pauseRendering):
(WebKit::LayerTreeHost::resumeRendering):
(WebKit::LayerTreeHost::invalidate):
* WebProcess/WebPage/LayerTreeHost.h:
(WebKit::LayerTreeHost::layerTreeContext):
(WebKit::LayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush):
(WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplay):
(WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplayInRect):
(WebKit::LayerTreeHost::scrollNonCompositedContents):
(WebKit::LayerTreeHost::graphicsLayerFactory):
(WebKit::LayerTreeHost::contentsSizeChanged):
(WebKit::LayerTreeHost::didChangeViewportProperties):
(WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::setViewOverlayRootLayer):
(WebKit::LayerTreeHost::forceRepaintAsync): Deleted.
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::invalidate):
(WebKit::LayerTreeHostGtk::setViewOverlayRootLayer):
(WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Deleted.
(WebKit::LayerTreeHostGtk::setRootCompositingLayer): Deleted.
(WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay): Deleted.
(WebKit::LayerTreeHostGtk::scrollNonCompositedContents): Deleted.
(WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing): Deleted.
* WebProcess/WebPage/gtk/LayerTreeHostGtk.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsCoordinatedDrawingAreacpp">trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsCoordinatedDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsCoordinatedLayerTreeHostcpp">trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsCoordinatedLayerTreeHosth">trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsThreadedCoordinatedLayerTreeHostcpp">trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsThreadedCoordinatedLayerTreeHosth">trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreaImplh">trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageLayerTreeHostcpp">trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageLayerTreeHosth">trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagegtkLayerTreeHostGtkcpp">trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagegtkLayerTreeHostGtkh">trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/ChangeLog        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -1,3 +1,82 @@
</span><ins>+2016-06-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        Too much duplicated code in LayerTreeHosts implementations
+        https://bugs.webkit.org/show_bug.cgi?id=159144
+
+        Reviewed by Žan Doberšek.
+
+        There's some code common and duplicated in all current LayerTreeHosts implementations (Gtk, Coordinated, and
+        ThreadedCoordinated). The thing is even worse in the case of ThreadedCoordinated and Coordinated, where the
+        former is actually a special case of the later, and it seems like code was copy pasted and then modified to add
+        ThreadedCoordinated specific code. The problem of that approach, apart from the code duplication, is that common
+        parts end up diverging too. This patch moves the common parts to the base class LayerTreeHost and makes
+        ThreadedCoordinatedLayerTreeHost inherit from CoordinatedLayerTreeHost, to share the common code and simply add
+        the specific one.
+
+        * PlatformGTK.cmake:
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
+        (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
+        (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
+        (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
+        (WebKit::CoordinatedLayerTreeHost::invalidate):
+        (WebKit::CoordinatedLayerTreeHost::sizeDidChange):
+        (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
+        (WebKit::CoordinatedLayerTreeHost::commitSceneState):
+        (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
+        (WebKit::CoordinatedLayerTreeHost::cancelPendingLayerFlush): Deleted.
+        (WebKit::CoordinatedLayerTreeHost::forceRepaint): Deleted.
+        (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): Deleted.
+        (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): Deleted.
+        (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Deleted.
+        (WebKit::CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Deleted.
+        (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory): Deleted.
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
+        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
+        (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
+        (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
+        (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
+        (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect):
+        (WebKit::ThreadedCoordinatedLayerTreeHost::commitSceneState):
+        (WebKit::ThreadedCoordinatedLayerTreeHost::create): Deleted.
+        (WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): Deleted.
+        (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Deleted.
+        (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted.
+        (WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged): Deleted.
+        (WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
+        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::layerHostDidFlushLayers):
+        * WebProcess/WebPage/DrawingAreaImpl.h:
+        * WebProcess/WebPage/LayerTreeHost.cpp:
+        (WebKit::LayerTreeHost::~LayerTreeHost):
+        (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
+        (WebKit::LayerTreeHost::pauseRendering):
+        (WebKit::LayerTreeHost::resumeRendering):
+        (WebKit::LayerTreeHost::invalidate):
+        * WebProcess/WebPage/LayerTreeHost.h:
+        (WebKit::LayerTreeHost::layerTreeContext):
+        (WebKit::LayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush):
+        (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplay):
+        (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplayInRect):
+        (WebKit::LayerTreeHost::scrollNonCompositedContents):
+        (WebKit::LayerTreeHost::graphicsLayerFactory):
+        (WebKit::LayerTreeHost::contentsSizeChanged):
+        (WebKit::LayerTreeHost::didChangeViewportProperties):
+        (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
+        (WebKit::LayerTreeHost::setViewOverlayRootLayer):
+        (WebKit::LayerTreeHost::forceRepaintAsync): Deleted.
+        * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
+        (WebKit::LayerTreeHostGtk::invalidate):
+        (WebKit::LayerTreeHostGtk::setViewOverlayRootLayer):
+        (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Deleted.
+        (WebKit::LayerTreeHostGtk::setRootCompositingLayer): Deleted.
+        (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay): Deleted.
+        (WebKit::LayerTreeHostGtk::scrollNonCompositedContents): Deleted.
+        (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing): Deleted.
+        * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
+
</ins><span class="cx"> 2016-06-28  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r202586 and r202595.
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -826,6 +826,7 @@
</span><span class="cx">         Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp
</span><span class="cx">         Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
</span><span class="cx"> 
</span><ins>+        WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
</ins><span class="cx">         WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
</span><span class="cx">     )
</span><span class="cx">     list(APPEND WebKit2_INCLUDE_DIRECTORIES
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsCoordinatedDrawingAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -348,8 +348,7 @@
</span><span class="cx">     if (!frame-&gt;isMainFrame())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CoordinatedLayerTreeHost* coordinatedLayerTreeHost = static_cast&lt;CoordinatedLayerTreeHost*&gt;(m_layerTreeHost.get());
-    coordinatedLayerTreeHost-&gt;setViewOverlayRootLayer(viewOverlayRootLayer);
</del><ins>+    m_layerTreeHost-&gt;setViewOverlayRootLayer(viewOverlayRootLayer);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsCoordinatedDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -41,8 +41,6 @@
</span><span class="cx">     CoordinatedDrawingArea(WebPage&amp;, const WebPageCreationParameters&amp;);
</span><span class="cx">     virtual ~CoordinatedDrawingArea();
</span><span class="cx"> 
</span><del>-    void layerHostDidFlushLayers();
-
</del><span class="cx"> private:
</span><span class="cx">     // DrawingArea
</span><span class="cx">     void setNeedsDisplay() override;
</span><span class="lines">@@ -69,6 +67,8 @@
</span><span class="cx">     void viewStateDidChange(WebCore::ViewState::Flags, bool /* wantsDidUpdateViewState */, const Vector&lt;uint64_t&gt;&amp; /* callbackIDs */) override;
</span><span class="cx">     void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
</span><span class="cx"> 
</span><ins>+    void layerHostDidFlushLayers() override;
+
</ins><span class="cx">     // IPC message handlers.
</span><span class="cx">     void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&amp;, const WebCore::IntSize&amp; scrollOffset) override;
</span><span class="cx">     virtual void suspendPainting();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsCoordinatedLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -30,21 +30,22 @@
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS)
</span><span class="cx"> #include &quot;CoordinatedLayerTreeHost.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;CoordinatedDrawingArea.h&quot;
-#include &quot;CoordinatedGraphicsArgumentCoders.h&quot;
-#include &quot;CoordinatedLayerTreeHostProxyMessages.h&quot;
-#include &quot;GraphicsContext.h&quot;
</del><ins>+#include &quot;DrawingArea.h&quot;
</ins><span class="cx"> #include &quot;WebCoordinatedSurface.h&quot;
</span><del>-#include &quot;WebCoreArgumentCoders.h&quot;
</del><span class="cx"> #include &quot;WebPage.h&quot;
</span><span class="cx"> #include &quot;WebPageProxyMessages.h&quot;
</span><del>-#include &lt;WebCore/Frame.h&gt;
</del><span class="cx"> #include &lt;WebCore/FrameView.h&gt;
</span><span class="cx"> #include &lt;WebCore/MainFrame.h&gt;
</span><span class="cx"> #include &lt;WebCore/PageOverlayController.h&gt;
</span><del>-#include &lt;WebCore/Settings.h&gt;
-#include &lt;wtf/CurrentTime.h&gt;
</del><span class="cx"> 
</span><ins>+#if USE(COORDINATED_GRAPHICS_THREADED)
+#include &quot;ThreadSafeCoordinatedSurface.h&quot;
+#elif USE(COORDINATED_GRAPHICS_MULTIPROCESS)
+#include &quot;CoordinatedGraphicsArgumentCoders.h&quot;
+#include &quot;CoordinatedLayerTreeHostProxyMessages.h&quot;
+#include &quot;WebCoreArgumentCoders.h&quot;
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -60,46 +61,24 @@
</span><span class="cx"> 
</span><span class="cx"> CoordinatedLayerTreeHost::CoordinatedLayerTreeHost(WebPage&amp; webPage)
</span><span class="cx">     : LayerTreeHost(webPage)
</span><del>-    , m_notifyAfterScheduledLayerFlush(false)
-    , m_isValid(true)
-    , m_isSuspended(false)
-    , m_isWaitingForRenderer(true)
-    , m_layerFlushTimer(*this, &amp;CoordinatedLayerTreeHost::layerFlushTimerFired)
-    , m_layerFlushSchedulingEnabled(true)
-    , m_forceRepaintAsyncCallbackID(0)
-    , m_viewOverlayRootLayer(nullptr)
</del><ins>+    , m_coordinator(std::make_unique&lt;CompositingCoordinator&gt;(webPage.corePage(), this))
+    , m_layerFlushTimer(RunLoop::main(), this, &amp;CoordinatedLayerTreeHost::layerFlushTimerFired)
</ins><span class="cx"> {
</span><del>-    m_coordinator = std::make_unique&lt;CompositingCoordinator&gt;(m_webPage.corePage(), this);
-
</del><span class="cx">     m_coordinator-&gt;createRootLayer(m_webPage.size());
</span><ins>+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
</ins><span class="cx">     m_layerTreeContext.contextID = toCoordinatedGraphicsLayer(m_coordinator-&gt;rootLayer())-&gt;id();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     CoordinatedSurface::setFactory(createCoordinatedSurface);
</span><del>-
</del><span class="cx">     scheduleLayerFlush();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CoordinatedLayerTreeHost::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
-{
-    if (m_layerFlushSchedulingEnabled == layerFlushingEnabled)
-        return;
-
-    m_layerFlushSchedulingEnabled = layerFlushingEnabled;
-
-    if (m_layerFlushSchedulingEnabled) {
-        scheduleLayerFlush();
-        return;
-    }
-
-    cancelPendingLayerFlush();
-}
-
</del><span class="cx"> void CoordinatedLayerTreeHost::scheduleLayerFlush()
</span><span class="cx"> {
</span><span class="cx">     if (!m_layerFlushSchedulingEnabled)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (!m_layerFlushTimer.isActive() || m_layerFlushTimer.nextFireInterval() &gt; 0)
</del><ins>+    if (!m_layerFlushTimer.isActive())
</ins><span class="cx">         m_layerFlushTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -108,18 +87,13 @@
</span><span class="cx">     m_layerFlushTimer.stop();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CoordinatedLayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush)
</del><ins>+void CoordinatedLayerTreeHost::setViewOverlayRootLayer(GraphicsLayer* viewOverlayRootLayer)
</ins><span class="cx"> {
</span><del>-    m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush;
-}
-
-void CoordinatedLayerTreeHost::setViewOverlayRootLayer(WebCore::GraphicsLayer* viewOverlayRootLayer)
-{
-    m_viewOverlayRootLayer = viewOverlayRootLayer;
</del><ins>+    LayerTreeHost::setViewOverlayRootLayer(viewOverlayRootLayer);
</ins><span class="cx">     m_coordinator-&gt;setViewOverlayRootLayer(viewOverlayRootLayer);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CoordinatedLayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer)
</del><ins>+void CoordinatedLayerTreeHost::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
</ins><span class="cx"> {
</span><span class="cx">     m_coordinator-&gt;setRootCompositingLayer(graphicsLayer);
</span><span class="cx"> }
</span><span class="lines">@@ -128,9 +102,8 @@
</span><span class="cx"> {
</span><span class="cx">     cancelPendingLayerFlush();
</span><span class="cx"> 
</span><del>-    ASSERT(m_isValid);
</del><span class="cx">     m_coordinator-&gt;clearRootLayer();
</span><del>-    m_isValid = false;
</del><ins>+    LayerTreeHost::invalidate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CoordinatedLayerTreeHost::forceRepaint()
</span><span class="lines">@@ -158,7 +131,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CoordinatedLayerTreeHost::sizeDidChange(const WebCore::IntSize&amp; newSize)
</del><ins>+void CoordinatedLayerTreeHost::sizeDidChange(const IntSize&amp; newSize)
</ins><span class="cx"> {
</span><span class="cx">     m_coordinator-&gt;sizeDidChange(newSize);
</span><span class="cx">     scheduleLayerFlush();
</span><span class="lines">@@ -189,7 +162,7 @@
</span><span class="cx">         m_viewOverlayRootLayer-&gt;flushCompositingState(visibleContentRect,  m_webPage.mainFrame()-&gt;view()-&gt;viewportIsStable());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CoordinatedLayerTreeHost::performScheduledLayerFlush()
</del><ins>+void CoordinatedLayerTreeHost::layerFlushTimerFired()
</ins><span class="cx"> {
</span><span class="cx">     if (m_isSuspended || m_isWaitingForRenderer)
</span><span class="cx">         return;
</span><span class="lines">@@ -207,29 +180,34 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_notifyAfterScheduledLayerFlush &amp;&amp; didSync) {
</span><del>-        static_cast&lt;CoordinatedDrawingArea*&gt;(m_webPage.drawingArea())-&gt;layerHostDidFlushLayers();
</del><ins>+        m_webPage.drawingArea()-&gt;layerHostDidFlushLayers();
</ins><span class="cx">         m_notifyAfterScheduledLayerFlush = false;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CoordinatedLayerTreeHost::layerFlushTimerFired()
-{
-    performScheduledLayerFlush();
-}
-
</del><span class="cx"> void CoordinatedLayerTreeHost::paintLayerContents(const GraphicsLayer*, GraphicsContext&amp;, const IntRect&amp;)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CoordinatedLayerTreeHost::commitSceneState(const WebCore::CoordinatedGraphicsState&amp; state)
</del><ins>+void CoordinatedLayerTreeHost::commitSceneState(const CoordinatedGraphicsState&amp; state)
</ins><span class="cx"> {
</span><ins>+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
</ins><span class="cx">     m_webPage.send(Messages::CoordinatedLayerTreeHostProxy::CommitCoordinatedGraphicsState(state));
</span><ins>+#endif
</ins><span class="cx">     m_isWaitingForRenderer = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CoordinatedSurface&gt; CoordinatedLayerTreeHost::createCoordinatedSurface(const IntSize&amp; size, CoordinatedSurface::Flags flags)
</span><span class="cx"> {
</span><ins>+#if USE(COORDINATED_GRAPHICS_THREADED)
+    return ThreadSafeCoordinatedSurface::create(size, flags);
+#elif USE(COORDINATED_GRAPHICS_MULTIPROCESS)
</ins><span class="cx">     return WebCoordinatedSurface::create(size, flags);
</span><ins>+#else
+    UNUSED_PARAM(size);
+    UNUSED_PARAM(flags);
+    return nullptr;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsCoordinatedLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -23,14 +23,13 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS)
</span><span class="cx"> 
</span><del>-#include &quot;LayerTreeContext.h&quot;
</del><span class="cx"> #include &quot;LayerTreeHost.h&quot;
</span><span class="cx"> #include &lt;WebCore/CompositingCoordinator.h&gt;
</span><del>-#include &lt;WebCore/GraphicsLayerFactory.h&gt;
-#include &lt;wtf/HashSet.h&gt;
</del><ins>+#include &lt;wtf/RunLoop.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class CoordinatedSurface;
</span><ins>+class GraphicsLayerFactory;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -43,28 +42,27 @@
</span><span class="cx">     static Ref&lt;CoordinatedLayerTreeHost&gt; create(WebPage&amp;);
</span><span class="cx">     virtual ~CoordinatedLayerTreeHost();
</span><span class="cx"> 
</span><del>-    const LayerTreeContext&amp; layerTreeContext() override { return m_layerTreeContext; }
-    void setLayerFlushSchedulingEnabled(bool) override;
</del><ins>+protected:
+    explicit CoordinatedLayerTreeHost(WebPage&amp;);
+
</ins><span class="cx">     void scheduleLayerFlush() override;
</span><del>-    void setShouldNotifyAfterNextScheduledLayerFlush(bool) override;
</del><ins>+    void cancelPendingLayerFlush() override;
</ins><span class="cx">     void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
</span><span class="cx">     void invalidate() override;
</span><span class="cx"> 
</span><del>-    void setNonCompositedContentsNeedDisplay() override { }
-    void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&amp;) override { }
-    void scrollNonCompositedContents(const WebCore::IntRect&amp;) override { }
</del><span class="cx">     void forceRepaint() override;
</span><span class="cx">     bool forceRepaintAsync(uint64_t callbackID) override;
</span><span class="cx">     void sizeDidChange(const WebCore::IntSize&amp; newSize) override;
</span><span class="cx"> 
</span><del>-    void pauseRendering() override { m_isSuspended = true; }
-    void resumeRendering() override { m_isSuspended = false; scheduleLayerFlush(); }
</del><span class="cx">     void deviceOrPageScaleFactorChanged() override;
</span><span class="cx">     void pageBackgroundTransparencyChanged() override;
</span><span class="cx"> 
</span><del>-    void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
</del><ins>+    void setVisibleContentsRect(const WebCore::FloatRect&amp;, const WebCore::FloatPoint&amp;);
+    void renderNextFrame();
+    void purgeBackingStores();
+    void commitScrollOffset(uint32_t layerID, const WebCore::IntSize&amp; offset);
+
</ins><span class="cx">     WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
</span><del>-    WebCore::CoordinatedGraphicsLayer* mainContentsLayer();
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><span class="cx">     void scheduleAnimation() override;
</span><span class="lines">@@ -72,22 +70,6 @@
</span><span class="cx"> 
</span><span class="cx">     void setViewOverlayRootLayer(WebCore::GraphicsLayer*) override;
</span><span class="cx"> 
</span><del>-    static RefPtr&lt;WebCore::CoordinatedSurface&gt; createCoordinatedSurface(const WebCore::IntSize&amp;, WebCore::CoordinatedSurface::Flags);
-
-protected:
-    explicit CoordinatedLayerTreeHost(WebPage&amp;);
-
-private:
-    // CoordinatedLayerTreeHost
-    void cancelPendingLayerFlush();
-    void performScheduledLayerFlush();
-    void setVisibleContentsRect(const WebCore::FloatRect&amp;, const WebCore::FloatPoint&amp;);
-    void renderNextFrame();
-    void purgeBackingStores();
-    void commitScrollOffset(uint32_t layerID, const WebCore::IntSize&amp; offset);
-
-    void layerFlushTimerFired();
-
</del><span class="cx">     // CompositingCoordinator::Client
</span><span class="cx">     void didFlushRootLayer(const WebCore::FloatRect&amp; visibleContentRect) override;
</span><span class="cx">     void notifyFlushRequired() override { scheduleLayerFlush(); };
</span><span class="lines">@@ -94,20 +76,19 @@
</span><span class="cx">     void commitSceneState(const WebCore::CoordinatedGraphicsState&amp;) override;
</span><span class="cx">     void paintLayerContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; clipRect) override;
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;WebCore::CompositingCoordinator&gt; m_coordinator;
</del><ins>+private:
+    void layerFlushTimerFired();
</ins><span class="cx"> 
</span><del>-    bool m_notifyAfterScheduledLayerFlush;
-    bool m_isValid;
-    bool m_isSuspended;
-    bool m_isWaitingForRenderer;
</del><ins>+#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
+    void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
+#endif
</ins><span class="cx"> 
</span><del>-    LayerTreeContext m_layerTreeContext;
</del><ins>+    static RefPtr&lt;WebCore::CoordinatedSurface&gt; createCoordinatedSurface(const WebCore::IntSize&amp;, WebCore::CoordinatedSurface::Flags);
</ins><span class="cx"> 
</span><del>-    WebCore::Timer m_layerFlushTimer;
-    bool m_layerFlushSchedulingEnabled;
-    uint64_t m_forceRepaintAsyncCallbackID;
-
-    WebCore::GraphicsLayer* m_viewOverlayRootLayer;
</del><ins>+    std::unique_ptr&lt;WebCore::CompositingCoordinator&gt; m_coordinator;
+    bool m_isWaitingForRenderer { true };
+    uint64_t m_forceRepaintAsyncCallbackID { 0 };
+    RunLoop::Timer&lt;CoordinatedLayerTreeHost&gt; m_layerFlushTimer;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsThreadedCoordinatedLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -30,19 +30,9 @@
</span><span class="cx"> #include &quot;ThreadedCoordinatedLayerTreeHost.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS_THREADED)
</span><del>-
-#include &quot;DrawingAreaImpl.h&quot;
-#include &quot;NotImplemented.h&quot;
-#include &quot;ThreadSafeCoordinatedSurface.h&quot;
</del><span class="cx"> #include &quot;WebPage.h&quot;
</span><del>-#include &lt;WebCore/CoordinatedGraphicsLayer.h&gt;
-#include &lt;WebCore/CoordinatedGraphicsState.h&gt;
-#include &lt;WebCore/Frame.h&gt;
</del><span class="cx"> #include &lt;WebCore/FrameView.h&gt;
</span><del>-#include &lt;WebCore/GraphicsContext.h&gt;
</del><span class="cx"> #include &lt;WebCore/MainFrame.h&gt;
</span><del>-#include &lt;WebCore/Page.h&gt;
-#include &lt;wtf/CurrentTime.h&gt;
</del><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -58,68 +48,12 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost(WebPage&amp; webPage)
</span><del>-    : LayerTreeHost(webPage)
-    , m_forceRepaintAsyncCallbackID(0)
-    , m_notifyAfterScheduledLayerFlush(false)
-    , m_isSuspended(false)
-    , m_isWaitingForRenderer(false)
-    , m_layerFlushTimer(RunLoop::main(), this, &amp;ThreadedCoordinatedLayerTreeHost::performScheduledLayerFlush)
-    , m_layerFlushSchedulingEnabled(true)
</del><ins>+    : CoordinatedLayerTreeHost(webPage)
+    , m_compositorClient(*this)
+    , m_compositor(ThreadedCompositor::create(&amp;m_compositorClient))
</ins><span class="cx"> {
</span><del>-    m_coordinator = std::make_unique&lt;CompositingCoordinator&gt;(m_webPage.corePage(), this);
-
-    m_coordinator-&gt;createRootLayer(m_webPage.size());
-
-    CoordinatedSurface::setFactory(createCoordinatedSurface);
-
-    m_compositor = ThreadedCompositor::create(this);
-    scheduleLayerFlush();
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CoordinatedSurface&gt; ThreadedCoordinatedLayerTreeHost::createCoordinatedSurface(const IntSize&amp; size, CoordinatedSurface::Flags flags)
-{
-    return ThreadSafeCoordinatedSurface::create(size, flags);
-}
-
-void ThreadedCoordinatedLayerTreeHost::scheduleLayerFlush()
-{
-    if (!m_layerFlushSchedulingEnabled)
-        return;
-
-    if (!m_layerFlushTimer.isActive())
-        m_layerFlushTimer.startOneShot(0);
-}
-
-void ThreadedCoordinatedLayerTreeHost::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
-{
-    if (m_layerFlushSchedulingEnabled == layerFlushingEnabled)
-        return;
-
-    m_layerFlushSchedulingEnabled = layerFlushingEnabled;
-
-    if (m_layerFlushSchedulingEnabled) {
-        scheduleLayerFlush();
-        return;
-    }
-
-    cancelPendingLayerFlush();
-}
-
-void ThreadedCoordinatedLayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush)
-{
-    m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush;
-}
-
-void ThreadedCoordinatedLayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer)
-{
-    m_coordinator-&gt;setRootCompositingLayer(graphicsLayer);
-}
-
-void ThreadedCoordinatedLayerTreeHost::invalidate()
-{
-    notImplemented();
-}
-
</del><span class="cx"> void ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents(const WebCore::IntRect&amp; rect)
</span><span class="cx"> {
</span><span class="cx">     m_compositor-&gt;scrollTo(rect.location());
</span><span class="lines">@@ -126,20 +60,6 @@
</span><span class="cx">     scheduleLayerFlush();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadedCoordinatedLayerTreeHost::forceRepaint()
-{
-    notImplemented();
-}
-
-bool ThreadedCoordinatedLayerTreeHost::forceRepaintAsync(uint64_t callbackID)
-{
-    // We expect the UI process to not require a new repaint until the previous one has finished.
-    ASSERT(!m_forceRepaintAsyncCallbackID);
-    m_forceRepaintAsyncCallbackID = callbackID;
-    scheduleLayerFlush();
-    return true;
-}
-
</del><span class="cx"> void ThreadedCoordinatedLayerTreeHost::contentsSizeChanged(const WebCore::IntSize&amp; newSize)
</span><span class="cx"> {
</span><span class="cx">     m_compositor-&gt;didChangeContentsSize(newSize);
</span><span class="lines">@@ -147,29 +67,13 @@
</span><span class="cx"> 
</span><span class="cx"> void ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged()
</span><span class="cx"> {
</span><del>-    m_coordinator-&gt;deviceOrPageScaleFactorChanged();
</del><ins>+    CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged();
</ins><span class="cx">     m_compositor-&gt;setDeviceScaleFactor(m_webPage.deviceScaleFactor());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadedCoordinatedLayerTreeHost::pauseRendering()
</del><ins>+void ThreadedCoordinatedLayerTreeHost::sizeDidChange(const IntSize&amp; size)
</ins><span class="cx"> {
</span><del>-    m_isSuspended = true;
-}
-
-void ThreadedCoordinatedLayerTreeHost::resumeRendering()
-{
-    m_isSuspended = false;
-    scheduleLayerFlush();
-}
-
-GraphicsLayerFactory* ThreadedCoordinatedLayerTreeHost::graphicsLayerFactory()
-{
-    return m_coordinator.get();
-}
-
-void ThreadedCoordinatedLayerTreeHost::sizeDidChange(const WebCore::IntSize&amp; size)
-{
-    m_coordinator-&gt;sizeDidChange(size);
</del><ins>+    CoordinatedLayerTreeHost::sizeDidChange(size);
</ins><span class="cx">     m_compositor-&gt;didChangeViewportSize(size);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -178,21 +82,11 @@
</span><span class="cx">     m_compositor-&gt;didChangeViewportAttribute(attr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadedCoordinatedLayerTreeHost::compositorDidFlushLayers()
-{
-    static_cast&lt;DrawingAreaImpl*&gt;(m_webPage.drawingArea())-&gt;layerHostDidFlushLayers();
-}
-
</del><span class="cx"> void ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged(float scale, const IntPoint&amp; origin)
</span><span class="cx"> {
</span><span class="cx">     m_webPage.scalePage(scale, origin);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer(GraphicsLayer* graphicsLayer)
-{
-    m_coordinator-&gt;setViewOverlayRootLayer(graphicsLayer);
-}
-
</del><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx"> void ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing(uint64_t handle)
</span><span class="cx"> {
</span><span class="lines">@@ -202,23 +96,9 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(REQUEST_ANIMATION_FRAME)
-void ThreadedCoordinatedLayerTreeHost::scheduleAnimation()
-{
-    if (m_isWaitingForRenderer)
-        return;
-
-    if (m_layerFlushTimer.isActive())
-        return;
-
-    m_layerFlushTimer.startOneShot(m_coordinator-&gt;nextAnimationServiceTime());
-    scheduleLayerFlush();
-}
-#endif
-
</del><span class="cx"> void ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect&amp; rect, const FloatPoint&amp; trajectoryVector, float scale)
</span><span class="cx"> {
</span><del>-    m_coordinator-&gt;setVisibleContentsRect(rect, trajectoryVector);
</del><ins>+    CoordinatedLayerTreeHost::setVisibleContentsRect(rect, trajectoryVector);
</ins><span class="cx">     if (m_lastScrollPosition != roundedIntPoint(rect.location())) {
</span><span class="cx">         m_lastScrollPosition = roundedIntPoint(rect.location());
</span><span class="cx"> 
</span><span class="lines">@@ -230,61 +110,14 @@
</span><span class="cx">         m_lastScaleFactor = scale;
</span><span class="cx">         didScaleFactorChanged(m_lastScaleFactor, m_lastScrollPosition);
</span><span class="cx">     }
</span><del>-
-    scheduleLayerFlush();
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadedCoordinatedLayerTreeHost::cancelPendingLayerFlush()
-{
-    m_layerFlushTimer.stop();
-}
-
-void ThreadedCoordinatedLayerTreeHost::performScheduledLayerFlush()
-{
-    if (m_isSuspended || m_isWaitingForRenderer)
-        return;
-
-    m_coordinator-&gt;syncDisplayState();
-    bool didSync = m_coordinator-&gt;flushPendingLayerChanges();
-
-    if (m_notifyAfterScheduledLayerFlush &amp;&amp; didSync) {
-        compositorDidFlushLayers();
-        m_notifyAfterScheduledLayerFlush = false;
-    }
-}
-
-void ThreadedCoordinatedLayerTreeHost::purgeBackingStores()
-{
-    m_coordinator-&gt;purgeBackingStores();
-}
-
-void ThreadedCoordinatedLayerTreeHost::renderNextFrame()
-{
-    m_isWaitingForRenderer = false;
-    m_coordinator-&gt;renderNextFrame();
-    scheduleLayerFlush();
-}
-
-void ThreadedCoordinatedLayerTreeHost::commitScrollOffset(uint32_t layerID, const IntSize&amp; offset)
-{
-    m_coordinator-&gt;commitScrollOffset(layerID, offset);
-}
-
-void ThreadedCoordinatedLayerTreeHost::notifyFlushRequired()
-{
-    scheduleLayerFlush();
-}
-
</del><span class="cx"> void ThreadedCoordinatedLayerTreeHost::commitSceneState(const CoordinatedGraphicsState&amp; state)
</span><span class="cx"> {
</span><del>-    m_isWaitingForRenderer = true;
</del><ins>+    CoordinatedLayerTreeHost::commitSceneState(state);
</ins><span class="cx">     m_compositor-&gt;updateSceneState(state);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadedCoordinatedLayerTreeHost::paintLayerContents(const GraphicsLayer*, GraphicsContext&amp;, const IntRect&amp;)
-{
-}
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(COORDINATED_GRAPHICS)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsThreadedCoordinatedLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -30,27 +30,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS_THREADED)
</span><span class="cx"> 
</span><del>-#include &quot;LayerTreeContext.h&quot;
-#include &quot;LayerTreeHost.h&quot;
</del><ins>+#include &quot;CoordinatedLayerTreeHost.h&quot;
</ins><span class="cx"> #include &quot;ThreadedCompositor.h&quot;
</span><del>-#include &lt;WebCore/CompositingCoordinator.h&gt;
-#include &lt;WebCore/FloatPoint.h&gt;
-#include &lt;WebCore/FloatRect.h&gt;
-#include &lt;WebCore/IntPoint.h&gt;
-#include &lt;WebCore/IntRect.h&gt;
-#include &lt;WebCore/IntSize.h&gt;
-#include &lt;WebCore/PageOverlay.h&gt;
-#include &lt;WebCore/Timer.h&gt;
-#include &lt;wtf/RunLoop.h&gt;
-#include &lt;wtf/Threading.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><del>-class CoordinatedSurface;
</del><span class="cx"> class GraphicsContext;
</span><span class="cx"> class GraphicsLayer;
</span><del>-class GraphicsLayerFactory;
-class GraphicsLayerFactory;
-struct CoordinatedGraphicsLayerState;
</del><span class="cx"> struct CoordinatedGraphicsState;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -58,34 +43,18 @@
</span><span class="cx"> 
</span><span class="cx"> class WebPage;
</span><span class="cx"> 
</span><del>-class ThreadedCoordinatedLayerTreeHost : public LayerTreeHost, public WebCore::CompositingCoordinator::Client, public ThreadedCompositor::Client {
-    WTF_MAKE_NONCOPYABLE(ThreadedCoordinatedLayerTreeHost); WTF_MAKE_FAST_ALLOCATED;
</del><ins>+class ThreadedCoordinatedLayerTreeHost final : public CoordinatedLayerTreeHost {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;ThreadedCoordinatedLayerTreeHost&gt; create(WebPage&amp;);
</span><span class="cx">     virtual ~ThreadedCoordinatedLayerTreeHost();
</span><span class="cx"> 
</span><del>-    const LayerTreeContext&amp; layerTreeContext() override { return m_layerTreeContext; };
</del><ins>+private:
+    explicit ThreadedCoordinatedLayerTreeHost(WebPage&amp;);
</ins><span class="cx"> 
</span><del>-    void scheduleLayerFlush() override;
-    void setLayerFlushSchedulingEnabled(bool) override;
-    void setShouldNotifyAfterNextScheduledLayerFlush(bool) override;
-    void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
-    void invalidate() override;
-
-    void setNonCompositedContentsNeedDisplay() override { };
-    void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&amp;) override { };
</del><span class="cx">     void scrollNonCompositedContents(const WebCore::IntRect&amp; scrollRect) override;
</span><del>-    void forceRepaint() override;
-    bool forceRepaintAsync(uint64_t /*callbackID*/) override;
</del><span class="cx">     void sizeDidChange(const WebCore::IntSize&amp;) override;
</span><span class="cx">     void deviceOrPageScaleFactorChanged() override;
</span><span class="cx"> 
</span><del>-    void pauseRendering() override;
-    void resumeRendering() override;
-
-    WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
-    void pageBackgroundTransparencyChanged() override { };
-
</del><span class="cx">     void contentsSizeChanged(const WebCore::IntSize&amp;) override;
</span><span class="cx">     void didChangeViewportProperties(const WebCore::ViewportAttributes&amp;) override;
</span><span class="cx"> 
</span><span class="lines">@@ -93,55 +62,51 @@
</span><span class="cx">     void setNativeSurfaceHandleForCompositing(uint64_t) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(REQUEST_ANIMATION_FRAME)
-    void scheduleAnimation() override;
-#endif
</del><ins>+    class CompositorClient final : public ThreadedCompositor::Client {
+        WTF_MAKE_NONCOPYABLE(CompositorClient);
+    public:
+        CompositorClient(ThreadedCoordinatedLayerTreeHost&amp; layerTreeHost)
+            : m_layerTreeHost(layerTreeHost)
+        {
+        }
</ins><span class="cx"> 
</span><del>-    void setViewOverlayRootLayer(WebCore::GraphicsLayer*) override;
-    static RefPtr&lt;WebCore::CoordinatedSurface&gt; createCoordinatedSurface(const WebCore::IntSize&amp;, WebCore::CoordinatedSurface::Flags);
</del><ins>+    private:
+        void setVisibleContentsRect(const WebCore::FloatRect&amp; rect, const WebCore::FloatPoint&amp; trajectoryVector, float scale) override
+        {
+            m_layerTreeHost.setVisibleContentsRect(rect, trajectoryVector, scale);
+        }
</ins><span class="cx"> 
</span><del>-protected:
-    explicit ThreadedCoordinatedLayerTreeHost(WebPage&amp;);
</del><ins>+        void purgeBackingStores() override
+        {
+            m_layerTreeHost.purgeBackingStores();
+        }
</ins><span class="cx"> 
</span><del>-private:
</del><ins>+        void renderNextFrame() override
+        {
+            m_layerTreeHost.renderNextFrame();
+        }
</ins><span class="cx"> 
</span><del>-    void compositorDidFlushLayers();
-    void didScaleFactorChanged(float scale, const WebCore::IntPoint&amp; origin);
</del><ins>+        void commitScrollOffset(uint32_t layerID, const WebCore::IntSize&amp; offset) override
+        {
+            m_layerTreeHost.commitScrollOffset(layerID, offset);
+        }
</ins><span class="cx"> 
</span><del>-    void cancelPendingLayerFlush();
-    void performScheduledLayerFlush();
</del><ins>+        ThreadedCoordinatedLayerTreeHost&amp; m_layerTreeHost;
+    };
</ins><span class="cx"> 
</span><del>-    WebCore::GraphicsLayer* rootLayer() { return m_coordinator-&gt;rootLayer(); }
</del><ins>+    void didScaleFactorChanged(float scale, const WebCore::IntPoint&amp; origin);
</ins><span class="cx"> 
</span><del>-    // ThreadedCompositor::Client
-    void setVisibleContentsRect(const WebCore::FloatRect&amp;, const WebCore::FloatPoint&amp;, float) override;
-    void purgeBackingStores() override;
-    void renderNextFrame() override;
-    void commitScrollOffset(uint32_t layerID, const WebCore::IntSize&amp; offset) override;
</del><ins>+    void setVisibleContentsRect(const WebCore::FloatRect&amp;, const WebCore::FloatPoint&amp;, float);
</ins><span class="cx"> 
</span><span class="cx">     // CompositingCoordinator::Client
</span><span class="cx">     void didFlushRootLayer(const WebCore::FloatRect&amp;) override { }
</span><del>-    void notifyFlushRequired() override;
</del><span class="cx">     void commitSceneState(const WebCore::CoordinatedGraphicsState&amp;) override;
</span><del>-    void paintLayerContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; clipRect) override;
</del><span class="cx"> 
</span><del>-    LayerTreeContext m_layerTreeContext;
-    uint64_t m_forceRepaintAsyncCallbackID;
-
</del><span class="cx">     WebCore::IntPoint m_prevScrollPosition;
</span><del>-
-    std::unique_ptr&lt;WebCore::CompositingCoordinator&gt; m_coordinator;
</del><ins>+    CompositorClient m_compositorClient;
</ins><span class="cx">     RefPtr&lt;ThreadedCompositor&gt; m_compositor;
</span><del>-
-    bool m_notifyAfterScheduledLayerFlush;
-    bool m_isSuspended;
-    bool m_isWaitingForRenderer;
-
-    float m_lastScaleFactor;
</del><ins>+    float m_lastScaleFactor { 1 };
</ins><span class="cx">     WebCore::IntPoint m_lastScrollPosition;
</span><del>-
-    RunLoop::Timer&lt;ThreadedCoordinatedLayerTreeHost&gt; m_layerFlushTimer;
-    bool m_layerFlushSchedulingEnabled;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -138,6 +138,8 @@
</span><span class="cx">     virtual void updateGeometry(const WebCore::IntSize&amp; viewSize, const WebCore::IntSize&amp; layerPosition, bool flushSynchronously, const WebCore::MachSendRight&amp; fencePort) { }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    virtual void layerHostDidFlushLayers() { };
+
</ins><span class="cx"> protected:
</span><span class="cx">     DrawingArea(DrawingAreaType, WebPage&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreaImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -45,8 +45,6 @@
</span><span class="cx">     DrawingAreaImpl(WebPage&amp;, const WebPageCreationParameters&amp;);
</span><span class="cx">     virtual ~DrawingAreaImpl();
</span><span class="cx"> 
</span><del>-    void layerHostDidFlushLayers();
-
</del><span class="cx"> private:
</span><span class="cx">     // DrawingArea
</span><span class="cx">     void setNeedsDisplay() override;
</span><span class="lines">@@ -75,6 +73,8 @@
</span><span class="cx">     void destroyNativeSurfaceHandleForCompositing(bool&amp;) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    void layerHostDidFlushLayers() override;
+
</ins><span class="cx">     // IPC message handlers.
</span><span class="cx">     void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize&amp;, const WebCore::IntSize&amp; scrollOffset) override;
</span><span class="cx">     void didUpdate() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -62,8 +62,41 @@
</span><span class="cx"> 
</span><span class="cx"> LayerTreeHost::~LayerTreeHost()
</span><span class="cx"> {
</span><ins>+    ASSERT(!m_isValid);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void LayerTreeHost::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
+{
+    if (m_layerFlushSchedulingEnabled == layerFlushingEnabled)
+        return;
+
+    m_layerFlushSchedulingEnabled = layerFlushingEnabled;
+
+    if (m_layerFlushSchedulingEnabled) {
+        scheduleLayerFlush();
+        return;
+    }
+
+    cancelPendingLayerFlush();
+}
+
+void LayerTreeHost::pauseRendering()
+{
+    m_isSuspended = true;
+}
+
+void LayerTreeHost::resumeRendering()
+{
+    m_isSuspended = false;
+    scheduleLayerFlush();
+}
+
+void LayerTreeHost::invalidate()
+{
+    ASSERT(m_isValid);
+    m_isValid = false;
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -29,8 +29,7 @@
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;LayerTreeContext.h&quot;
</span><del>-#include &lt;WebCore/Color.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
</del><ins>+#include &lt;wtf/Forward.h&gt;
</ins><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><span class="lines">@@ -39,8 +38,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><del>-class FloatPoint;
-class FloatRect;
</del><span class="cx"> class IntRect;
</span><span class="cx"> class IntSize;
</span><span class="cx"> class GraphicsLayer;
</span><span class="lines">@@ -52,7 +49,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class UpdateInfo;
</del><span class="cx"> class WebPage;
</span><span class="cx"> 
</span><span class="cx"> class LayerTreeHost : public RefCounted&lt;LayerTreeHost&gt; {
</span><span class="lines">@@ -60,16 +56,18 @@
</span><span class="cx">     static RefPtr&lt;LayerTreeHost&gt; create(WebPage&amp;);
</span><span class="cx">     virtual ~LayerTreeHost();
</span><span class="cx"> 
</span><del>-    virtual const LayerTreeContext&amp; layerTreeContext() = 0;
</del><ins>+    const LayerTreeContext&amp; layerTreeContext() const { return m_layerTreeContext; }
+    void setLayerFlushSchedulingEnabled(bool);
+    void setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush) { m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush; }
+
</ins><span class="cx">     virtual void scheduleLayerFlush() = 0;
</span><del>-    virtual void setLayerFlushSchedulingEnabled(bool) = 0;
-    virtual void setShouldNotifyAfterNextScheduledLayerFlush(bool) = 0;
</del><ins>+    virtual void cancelPendingLayerFlush() = 0;
</ins><span class="cx">     virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0;
</span><del>-    virtual void invalidate() = 0;
</del><ins>+    virtual void invalidate();
</ins><span class="cx"> 
</span><del>-    virtual void setNonCompositedContentsNeedDisplay() = 0;
-    virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&amp;) = 0;
-    virtual void scrollNonCompositedContents(const WebCore::IntRect&amp; scrollRect) = 0;
</del><ins>+    virtual void setNonCompositedContentsNeedDisplay() { };
+    virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&amp;) { };
+    virtual void scrollNonCompositedContents(const WebCore::IntRect&amp;) { };
</ins><span class="cx">     virtual void forceRepaint() = 0;
</span><span class="cx">     virtual bool forceRepaintAsync(uint64_t /*callbackID*/) { return false; }
</span><span class="cx">     virtual void sizeDidChange(const WebCore::IntSize&amp; newSize) = 0;
</span><span class="lines">@@ -76,10 +74,10 @@
</span><span class="cx">     virtual void deviceOrPageScaleFactorChanged() = 0;
</span><span class="cx">     virtual void pageBackgroundTransparencyChanged() = 0;
</span><span class="cx"> 
</span><del>-    virtual void pauseRendering() { }
-    virtual void resumeRendering() { }
</del><ins>+    virtual void pauseRendering();
+    virtual void resumeRendering();
</ins><span class="cx"> 
</span><del>-    virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return 0; }
</del><ins>+    virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return nullptr; }
</ins><span class="cx"> 
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
</span><span class="cx">     virtual void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) = 0;
</span><span class="lines">@@ -86,8 +84,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS_THREADED)
</span><del>-    virtual void contentsSizeChanged(const WebCore::IntSize&amp;) = 0;
-    virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&amp;) = 0;
</del><ins>+    virtual void contentsSizeChanged(const WebCore::IntSize&amp;) { };
+    virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&amp;) { };
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS) &amp;&amp; ENABLE(REQUEST_ANIMATION_FRAME)
</span><span class="lines">@@ -95,15 +93,21 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(TEXTURE_MAPPER) &amp;&amp; PLATFORM(GTK)
</span><del>-    virtual void setNativeSurfaceHandleForCompositing(uint64_t) = 0;
</del><ins>+    virtual void setNativeSurfaceHandleForCompositing(uint64_t) { };
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    virtual void setViewOverlayRootLayer(WebCore::GraphicsLayer*) = 0;
</del><ins>+    virtual void setViewOverlayRootLayer(WebCore::GraphicsLayer* viewOverlayRootLayer) { m_viewOverlayRootLayer = viewOverlayRootLayer; }
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     explicit LayerTreeHost(WebPage&amp;);
</span><span class="cx"> 
</span><span class="cx">     WebPage&amp; m_webPage;
</span><ins>+    LayerTreeContext m_layerTreeContext;
+    bool m_layerFlushSchedulingEnabled { true };
+    bool m_notifyAfterScheduledLayerFlush { false };
+    bool m_isSuspended { false };
+    bool m_isValid { true };
+    WebCore::GraphicsLayer* m_viewOverlayRootLayer { nullptr };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagegtkLayerTreeHostGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -133,10 +133,6 @@
</span><span class="cx"> 
</span><span class="cx"> LayerTreeHostGtk::LayerTreeHostGtk(WebPage&amp; webPage)
</span><span class="cx">     : LayerTreeHost(webPage)
</span><del>-    , m_isValid(true)
-    , m_notifyAfterScheduledLayerFlush(false)
-    , m_layerFlushSchedulingEnabled(true)
-    , m_viewOverlayRootLayer(nullptr)
</del><span class="cx">     , m_renderFrameScheduler(std::bind(&amp;LayerTreeHostGtk::renderFrame, this))
</span><span class="cx"> {
</span><span class="cx">     m_rootLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
</span><span class="lines">@@ -183,21 +179,10 @@
</span><span class="cx"> 
</span><span class="cx"> LayerTreeHostGtk::~LayerTreeHostGtk()
</span><span class="cx"> {
</span><del>-    ASSERT(!m_isValid);
</del><span class="cx">     ASSERT(!m_rootLayer);
</span><span class="cx">     cancelPendingLayerFlush();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const LayerTreeContext&amp; LayerTreeHostGtk::layerTreeContext()
-{
-    return m_layerTreeContext;
-}
-
-void LayerTreeHostGtk::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush)
-{
-    m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush;
-}
-
</del><span class="cx"> void LayerTreeHostGtk::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
</span><span class="cx"> {
</span><span class="cx">     m_nonCompositedContentLayer-&gt;removeAllChildren();
</span><span class="lines">@@ -211,8 +196,6 @@
</span><span class="cx"> 
</span><span class="cx"> void LayerTreeHostGtk::invalidate()
</span><span class="cx"> {
</span><del>-    ASSERT(m_isValid);
-
</del><span class="cx">     // This can trigger destruction of GL objects so let's make sure that
</span><span class="cx">     // we have the right active context
</span><span class="cx">     if (m_context)
</span><span class="lines">@@ -224,7 +207,7 @@
</span><span class="cx">     m_textureMapper = nullptr;
</span><span class="cx"> 
</span><span class="cx">     m_context = nullptr;
</span><del>-    m_isValid = false;
</del><ins>+    LayerTreeHost::invalidate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void LayerTreeHostGtk::setNonCompositedContentsNeedDisplay()
</span><span class="lines">@@ -365,7 +348,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_notifyAfterScheduledLayerFlush) {
</span><span class="cx">         // Let the drawing area know that we've done a flush of the layer changes.
</span><del>-        static_cast&lt;DrawingAreaImpl*&gt;(m_webPage.drawingArea())-&gt;layerHostDidFlushLayers();
</del><ins>+        m_webPage.drawingArea()-&gt;layerHostDidFlushLayers();
</ins><span class="cx">         m_notifyAfterScheduledLayerFlush = false;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -378,21 +361,6 @@
</span><span class="cx">     m_renderFrameScheduler.start();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void LayerTreeHostGtk::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
-{
-    if (m_layerFlushSchedulingEnabled == layerFlushingEnabled)
-        return;
-
-    m_layerFlushSchedulingEnabled = layerFlushingEnabled;
-
-    if (m_layerFlushSchedulingEnabled) {
-        scheduleLayerFlush();
-        return;
-    }
-
-    cancelPendingLayerFlush();
-}
-
</del><span class="cx"> void LayerTreeHostGtk::pageBackgroundTransparencyChanged()
</span><span class="cx"> {
</span><span class="cx">     m_nonCompositedContentLayer-&gt;setContentsOpaque(m_webPage.drawsBackground());
</span><span class="lines">@@ -403,9 +371,9 @@
</span><span class="cx">     m_renderFrameScheduler.stop();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void LayerTreeHostGtk::setViewOverlayRootLayer(WebCore::GraphicsLayer* viewOverlayRootLayer)
</del><ins>+void LayerTreeHostGtk::setViewOverlayRootLayer(GraphicsLayer* viewOverlayRootLayer)
</ins><span class="cx"> {
</span><del>-    m_viewOverlayRootLayer = viewOverlayRootLayer;
</del><ins>+    LayerTreeHost::setViewOverlayRootLayer(viewOverlayRootLayer);
</ins><span class="cx">     if (m_viewOverlayRootLayer)
</span><span class="cx">         m_rootLayer-&gt;addChild(m_viewOverlayRootLayer);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagegtkLayerTreeHostGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h (202620 => 202621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h        2016-06-29 11:52:32 UTC (rev 202620)
+++ trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h        2016-06-29 12:16:41 UTC (rev 202621)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> 
</span><span class="cx">     // LayerTreeHost
</span><span class="cx">     void scheduleLayerFlush() override;
</span><del>-    void setLayerFlushSchedulingEnabled(bool layerFlushingEnabled) override;
</del><ins>+    void cancelPendingLayerFlush() override;
</ins><span class="cx">     void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
</span><span class="cx">     void invalidate() override;
</span><span class="cx"> 
</span><span class="lines">@@ -60,6 +60,11 @@
</span><span class="cx">     void deviceOrPageScaleFactorChanged() override;
</span><span class="cx">     void pageBackgroundTransparencyChanged() override;
</span><span class="cx"> 
</span><ins>+    void setNonCompositedContentsNeedDisplay() override;
+    void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&amp;) override;
+    void scrollNonCompositedContents(const WebCore::IntRect&amp; scrollRect) override;
+    void setViewOverlayRootLayer(WebCore::GraphicsLayer*) override;
+
</ins><span class="cx">     void setNativeSurfaceHandleForCompositing(uint64_t) override;
</span><span class="cx"> 
</span><span class="cx">     class RenderFrameScheduler {
</span><span class="lines">@@ -80,15 +85,6 @@
</span><span class="cx">         double m_lastImmediateFlushTime { 0 };
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    // LayerTreeHost
-    const LayerTreeContext&amp; layerTreeContext() override;
-    void setShouldNotifyAfterNextScheduledLayerFlush(bool) override;
-
-    void setNonCompositedContentsNeedDisplay() override;
-    void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&amp;) override;
-    void scrollNonCompositedContents(const WebCore::IntRect&amp; scrollRect) override;
-    void setViewOverlayRootLayer(WebCore::GraphicsLayer*) override;
-
</del><span class="cx">     // GraphicsLayerClient
</span><span class="cx">     void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&amp;, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect&amp; clipRect) override;
</span><span class="cx">     float deviceScaleFactor() const override;
</span><span class="lines">@@ -100,21 +96,13 @@
</span><span class="cx">     void compositeLayersToContext(CompositePurpose = NotForResize);
</span><span class="cx"> 
</span><span class="cx">     void flushAndRenderLayers();
</span><del>-    void cancelPendingLayerFlush();
-
</del><span class="cx">     bool renderFrame();
</span><del>-
</del><span class="cx">     bool makeContextCurrent();
</span><span class="cx"> 
</span><del>-    LayerTreeContext m_layerTreeContext;
-    bool m_isValid;
-    bool m_notifyAfterScheduledLayerFlush;
</del><span class="cx">     std::unique_ptr&lt;WebCore::GraphicsLayer&gt; m_rootLayer;
</span><span class="cx">     std::unique_ptr&lt;WebCore::GraphicsLayer&gt; m_nonCompositedContentLayer;
</span><span class="cx">     std::unique_ptr&lt;WebCore::TextureMapper&gt; m_textureMapper;
</span><span class="cx">     std::unique_ptr&lt;WebCore::GLContext&gt; m_context;
</span><del>-    bool m_layerFlushSchedulingEnabled;
-    WebCore::GraphicsLayer* m_viewOverlayRootLayer;
</del><span class="cx">     WebCore::TransformationMatrix m_scaleMatrix;
</span><span class="cx">     RenderFrameScheduler m_renderFrameScheduler;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>