<!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>[191340] 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/191340">191340</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-20 05:03:56 -0700 (Tue, 20 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Graphics corruption when entering/leaving AC mode quickly
https://bugs.webkit.org/show_bug.cgi?id=150323

Reviewed by Mario Sanchez Prada.

The UI process is notified when entering accelerated compositing
mode after the layers have been flushed and rendered to avoid
flickering. However, this is producing flickering in the GTK+
port, because we use an offscreen redirected window that is
resized to a minimium size to save memory when not in AC mode. The
web process always uses the current size of the redirected window,
so when entering AC mode, contents are rendered into the 1x1
window, then the UI process is notified, the redirected window is
resized to its actual size, and we force a resize to ask the web
process to render again, now at the correct size. Rendering at 1x1
and then resizing the window is what produces the flickering when
entering AC mode, but it's also inefficient, since we need to
render again after the redirected window is resized. So, this
patch adds a WillEnterAcceleratedCompositing message that is sent
to the UI process when the layer tree host is created but before
the contents have been composited and rendered. This is
implemented by the GTK+ port to prepare for entering AC mode, by
resizing the redirected window. When we actually enter AC mode,
the contents have already been rendered in the web process at the
correct size, so we can just use the redirected window surface
instead of the drawing area one, and paint in the web view without
any flickering. We no longer need the forceResize either.
When leaving accelerated compositing mode, we now clear the redirected
window resources after a short delay. This ensures that we have
already rendered the update sent in the ExitAcceleratedCompositingMode
message, but also that entering/leaving AC mode quickly doesn't
produce any redirected window resize.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::willEnterAcceleratedCompositingMode):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseClearRedirectedWindowSoon):
(webkitWebViewBaseWillEnterAcceleratedCompositingMode):
(webkitWebViewBaseEnterAcceleratedCompositingMode):
(webkitWebViewBaseExitAcceleratedCompositingMode):
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::willEnterAcceleratedCompositingMode):
* UIProcess/DrawingAreaProxy.messages.in:
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::willEnterAcceleratedCompositingMode):
* UIProcess/DrawingAreaProxyImpl.h:
(WebKit::DrawingAreaProxyImpl::forceResize): Deleted.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willEnterAcceleratedCompositingMode):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::willEnterAcceleratedCompositingMode):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::willEnterAcceleratedCompositingMode):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkPageClientImplcpp">trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkPageClientImplh">trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasePrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewh">trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDrawingAreaProxyh">trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDrawingAreaProxymessagesin">trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDrawingAreaProxyImplcpp">trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDrawingAreaProxyImplh">trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplh">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreaImplcpp">trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -1,3 +1,68 @@
</span><ins>+2015-10-20  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Graphics corruption when entering/leaving AC mode quickly
+        https://bugs.webkit.org/show_bug.cgi?id=150323
+
+        Reviewed by Mario Sanchez Prada.
+
+        The UI process is notified when entering accelerated compositing
+        mode after the layers have been flushed and rendered to avoid
+        flickering. However, this is producing flickering in the GTK+
+        port, because we use an offscreen redirected window that is
+        resized to a minimium size to save memory when not in AC mode. The
+        web process always uses the current size of the redirected window,
+        so when entering AC mode, contents are rendered into the 1x1
+        window, then the UI process is notified, the redirected window is
+        resized to its actual size, and we force a resize to ask the web
+        process to render again, now at the correct size. Rendering at 1x1
+        and then resizing the window is what produces the flickering when
+        entering AC mode, but it's also inefficient, since we need to
+        render again after the redirected window is resized. So, this
+        patch adds a WillEnterAcceleratedCompositing message that is sent
+        to the UI process when the layer tree host is created but before
+        the contents have been composited and rendered. This is
+        implemented by the GTK+ port to prepare for entering AC mode, by
+        resizing the redirected window. When we actually enter AC mode,
+        the contents have already been rendered in the web process at the
+        correct size, so we can just use the redirected window surface
+        instead of the drawing area one, and paint in the web view without
+        any flickering. We no longer need the forceResize either.
+        When leaving accelerated compositing mode, we now clear the redirected
+        window resources after a short delay. This ensures that we have
+        already rendered the update sent in the ExitAcceleratedCompositingMode
+        message, but also that entering/leaving AC mode quickly doesn't
+        produce any redirected window resize.
+
+        * UIProcess/API/gtk/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::willEnterAcceleratedCompositingMode):
+        * UIProcess/API/gtk/PageClientImpl.h:
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseClearRedirectedWindowSoon):
+        (webkitWebViewBaseWillEnterAcceleratedCompositingMode):
+        (webkitWebViewBaseEnterAcceleratedCompositingMode):
+        (webkitWebViewBaseExitAcceleratedCompositingMode):
+        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+        * UIProcess/CoordinatedGraphics/WebView.h:
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::willEnterAcceleratedCompositingMode):
+        * UIProcess/DrawingAreaProxy.messages.in:
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        (WebKit::DrawingAreaProxyImpl::willEnterAcceleratedCompositingMode):
+        * UIProcess/DrawingAreaProxyImpl.h:
+        (WebKit::DrawingAreaProxyImpl::forceResize): Deleted.
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::willEnterAcceleratedCompositingMode):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::willEnterAcceleratedCompositingMode):
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::willEnterAcceleratedCompositingMode):
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
+
</ins><span class="cx"> 2015-10-20  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Fix build for ENABLE_PLUGIN_PROCESS_GTK2=OFF
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkPageClientImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -233,6 +233,11 @@
</span><span class="cx">     webkitWebViewBaseExitAcceleratedCompositingMode(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageClientImpl::willEnterAcceleratedCompositingMode()
+{
+    webkitWebViewBaseWillEnterAcceleratedCompositingMode(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
+}
+
</ins><span class="cx"> void PageClientImpl::updateAcceleratedCompositingMode(const LayerTreeContext&amp;)
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -95,6 +95,7 @@
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><span class="cx">     virtual void exitAcceleratedCompositingMode() override;
</span><span class="cx">     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><ins>+    void willEnterAcceleratedCompositingMode() override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void handleDownloadRequest(DownloadProxy*) override;
</span><span class="cx">     virtual void didChangeContentSize(const WebCore::IntSize&amp;) override { }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -189,6 +189,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
</span><span class="cx">     std::unique_ptr&lt;RedirectedXCompositeWindow&gt; redirectedWindow;
</span><ins>+    GMainLoopSource clearRedirectedWindowSoon;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="lines">@@ -1338,8 +1339,18 @@
</span><span class="cx">     webkitWebViewBase-&gt;priv-&gt;clickCounter.reset();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase)
</del><ins>+static void webkitWebViewBaseClearRedirectedWindowSoon(WebKitWebViewBase* webkitWebViewBase)
</ins><span class="cx"> {
</span><ins>+    WebKitWebViewBasePrivate* priv = webkitWebViewBase-&gt;priv;
+    static const std::chrono::seconds clearRedirectedWindowSoonDelay = 2_s;
+    priv-&gt;clearRedirectedWindowSoon.scheduleAfterDelay(&quot;[WebKit] Clear RedirectedWindow soon&quot;, [priv]() {
+        if (priv-&gt;redirectedWindow)
+            priv-&gt;redirectedWindow-&gt;resize(IntSize());
+    }, clearRedirectedWindowSoonDelay);
+}
+
+void webkitWebViewBaseWillEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase)
+{
</ins><span class="cx"> #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
</span><span class="cx">     WebKitWebViewBasePrivate* priv = webkitWebViewBase-&gt;priv;
</span><span class="cx">     if (!priv-&gt;redirectedWindow)
</span><span class="lines">@@ -1350,19 +1361,30 @@
</span><span class="cx"> 
</span><span class="cx">     priv-&gt;redirectedWindow-&gt;setDeviceScaleFactor(webkitWebViewBase-&gt;priv-&gt;pageProxy-&gt;deviceScaleFactor());
</span><span class="cx">     priv-&gt;redirectedWindow-&gt;resize(drawingArea-&gt;size());
</span><del>-    // Force a resize to ensure the new redirected window size is used by the WebProcess.
-    drawingArea-&gt;forceResize();
</del><ins>+
+    // Clear the redirected window if we don't enter AC mode in the end.
+    webkitWebViewBaseClearRedirectedWindowSoon(webkitWebViewBase);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(webkitWebViewBase);
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase)
+{
+#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
+    webkitWebViewBase-&gt;priv-&gt;clearRedirectedWindowSoon.cancel();
+#else
+    UNUSED_PARAM(webkitWebViewBase);
+#endif
+}
+
</ins><span class="cx"> void webkitWebViewBaseExitAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase)
</span><span class="cx"> {
</span><span class="cx"> #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
</span><del>-    WebKitWebViewBasePrivate* priv = webkitWebViewBase-&gt;priv;
-    if (priv-&gt;redirectedWindow)
-        priv-&gt;redirectedWindow-&gt;resize(IntSize());
</del><ins>+    // Resize the window later to ensure we have already rendered the
+    // non composited contents and avoid flickering. We can also avoid the
+    // window resize entirely if we switch back to AC mode quickly.
+    webkitWebViewBaseClearRedirectedWindowSoon(webkitWebViewBase);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(webkitWebViewBase);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> void webkitWebViewBaseCancelAuthenticationDialog(WebKitWebViewBase*);
</span><span class="cx"> void webkitWebViewBaseAddWebInspector(WebKitWebViewBase*, GtkWidget* inspector, WebKit::AttachmentSide);
</span><span class="cx"> void webkitWebViewBaseResetClickCounter(WebKitWebViewBase*);
</span><ins>+void webkitWebViewBaseWillEnterAcceleratedCompositingMode(WebKitWebViewBase*);
</ins><span class="cx"> void webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase*);
</span><span class="cx"> void webkitWebViewBaseExitAcceleratedCompositingMode(WebKitWebViewBase*);
</span><span class="cx"> void webkitWebViewBaseDidRelaunchWebProcess(WebKitWebViewBase*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -188,6 +188,7 @@
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><span class="cx">     virtual void exitAcceleratedCompositingMode() override;
</span><span class="cx">     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><ins>+    virtual void willEnterAcceleratedCompositingMode() override { }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     WebFullScreenManagerProxyClient&amp; fullScreenManagerProxyClient() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDrawingAreaProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -122,6 +122,7 @@
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(uint64_t /* backingStoreStateID */, const LayerTreeContext&amp;) { }
</span><span class="cx">     virtual void exitAcceleratedCompositingMode(uint64_t /* backingStoreStateID */, const UpdateInfo&amp;) { }
</span><span class="cx">     virtual void updateAcceleratedCompositingMode(uint64_t /* backingStoreStateID */, const LayerTreeContext&amp;) { }
</span><ins>+    virtual void willEnterAcceleratedCompositingMode(uint64_t /* backingStoreStateID */) { }
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     virtual void didUpdateGeometry() { }
</span><span class="cx">     virtual void intrinsicContentSizeDidChange(const WebCore::IntSize&amp;) { }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDrawingAreaProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx">     EnterAcceleratedCompositingMode(uint64_t backingStoreStateID, WebKit::LayerTreeContext context)
</span><span class="cx">     ExitAcceleratedCompositingMode(uint64_t backingStoreStateID, WebKit::UpdateInfo updateInfo)
</span><span class="cx">     UpdateAcceleratedCompositingMode(uint64_t backingStoreStateID, WebKit::LayerTreeContext context)
</span><ins>+    WillEnterAcceleratedCompositingMode(uint64_t backingStoreStateID)
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     // Used by TiledCoreAnimationDrawingAreaProxy.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDrawingAreaProxyImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -208,6 +208,15 @@
</span><span class="cx">     updateAcceleratedCompositingMode(layerTreeContext);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void DrawingAreaProxyImpl::willEnterAcceleratedCompositingMode(uint64_t backingStoreStateID)
+{
+    ASSERT_ARG(backingStoreStateID, backingStoreStateID &lt;= m_currentBackingStoreStateID);
+    if (backingStoreStateID &lt; m_currentBackingStoreStateID)
+        return;
+
+    m_webPageProxy.willEnterAcceleratedCompositingMode();
+}
+
</ins><span class="cx"> void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo&amp; updateInfo)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!isInAcceleratedCompositingMode());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDrawingAreaProxyImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -52,8 +52,6 @@
</span><span class="cx">     void setNativeSurfaceHandleForCompositing(uint64_t);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void forceResize() { sizeDidChange(); }
-
</del><span class="cx"> private:
</span><span class="cx">     // DrawingAreaProxy
</span><span class="cx">     virtual void sizeDidChange();
</span><span class="lines">@@ -63,11 +61,12 @@
</span><span class="cx">     virtual void waitForBackingStoreUpdateOnNextPaint();
</span><span class="cx"> 
</span><span class="cx">     // IPC message handlers
</span><del>-    virtual void update(uint64_t backingStoreStateID, const UpdateInfo&amp;);
-    virtual void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&amp;, const LayerTreeContext&amp;);
-    virtual void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&amp;);
-    virtual void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&amp;);
-    virtual void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&amp;);
</del><ins>+    virtual void update(uint64_t backingStoreStateID, const UpdateInfo&amp;) override;
+    virtual void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&amp;, const LayerTreeContext&amp;) override;
+    virtual void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&amp;) override;
+    virtual void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&amp;) override;
+    virtual void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&amp;) override;
+    virtual void willEnterAcceleratedCompositingMode(uint64_t backingStoreStateID) override;
</ins><span class="cx"> 
</span><span class="cx">     void incorporateUpdate(const UpdateInfo&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -240,6 +240,7 @@
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) = 0;
</span><span class="cx">     virtual void exitAcceleratedCompositingMode() = 0;
</span><span class="cx">     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&amp;) = 0;
</span><ins>+    virtual void willEnterAcceleratedCompositingMode() = 0;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     virtual void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -5160,6 +5160,11 @@
</span><span class="cx">     m_pageClient.updateAcceleratedCompositingMode(layerTreeContext);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::willEnterAcceleratedCompositingMode()
+{
+    m_pageClient.willEnterAcceleratedCompositingMode();
+}
+
</ins><span class="cx"> void WebPageProxy::backForwardClear()
</span><span class="cx"> {
</span><span class="cx">     m_backForwardList-&gt;clear();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -813,7 +813,8 @@
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;);
</span><span class="cx">     virtual void exitAcceleratedCompositingMode();
</span><span class="cx">     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&amp;);
</span><del>-    
</del><ins>+    void willEnterAcceleratedCompositingMode();
+
</ins><span class="cx">     enum UndoOrRedo { Undo, Redo };
</span><span class="cx">     void addEditCommand(WebEditCommandProxy*);
</span><span class="cx">     void removeEditCommand(WebEditCommandProxy*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -106,6 +106,7 @@
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><span class="cx">     virtual void exitAcceleratedCompositingMode() override;
</span><span class="cx">     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><ins>+    virtual void willEnterAcceleratedCompositingMode() override;
</ins><span class="cx">     virtual void setAcceleratedCompositingRootLayer(LayerOrView *) override;
</span><span class="cx">     virtual LayerOrView *acceleratedCompositingRootLayer() const override;
</span><span class="cx">     virtual LayerHostingMode viewLayerHostingMode() override { return LayerHostingMode::OutOfProcess; }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -475,6 +475,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageClientImpl::willEnterAcceleratedCompositingMode()
+{
+}
+
</ins><span class="cx"> void PageClientImpl::setAcceleratedCompositingRootLayer(LayerOrView *rootLayer)
</span><span class="cx"> {
</span><span class="cx">     [m_contentView _setAcceleratedCompositingRootView:rootLayer];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -141,6 +141,7 @@
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><span class="cx">     virtual void exitAcceleratedCompositingMode() override;
</span><span class="cx">     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><ins>+    virtual void willEnterAcceleratedCompositingMode() override;
</ins><span class="cx"> 
</span><span class="cx">     virtual PassRefPtr&lt;ViewSnapshot&gt; takeViewSnapshot() override;
</span><span class="cx">     virtual void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -555,6 +555,10 @@
</span><span class="cx">     [m_wkView _setAcceleratedCompositingModeRootLayer:renderLayer];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageClientImpl::willEnterAcceleratedCompositingMode()
+{
+}
+
</ins><span class="cx"> void PageClientImpl::setAcceleratedCompositingRootLayer(CALayer *rootLayer)
</span><span class="cx"> {
</span><span class="cx">     [m_wkView _setAcceleratedCompositingModeRootLayer:rootLayer];
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreaImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (191339 => 191340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp        2015-10-20 11:37:52 UTC (rev 191339)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp        2015-10-20 12:03:56 UTC (rev 191340)
</span><span class="lines">@@ -465,6 +465,8 @@
</span><span class="cx">     m_exitCompositingTimer.stop();
</span><span class="cx">     m_wantsToExitAcceleratedCompositingMode = false;
</span><span class="cx"> 
</span><ins>+    m_webPage.send(Messages::DrawingAreaProxy::WillEnterAcceleratedCompositingMode(m_backingStoreStateID));
+
</ins><span class="cx">     ASSERT(!m_layerTreeHost);
</span><span class="cx"> 
</span><span class="cx">     m_layerTreeHost = LayerTreeHost::create(&amp;m_webPage);
</span></span></pre>
</div>
</div>

</body>
</html>