Remote Layer Tree: Force repaint
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Dec 2013 23:28:10 +0000 (23:28 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Dec 2013 23:28:10 +0000 (23:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=125189
<rdar://problem/15541789>

Reviewed by Anders Carlsson.

* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::forceRepaint):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::forceRepaint):
Implement WebProcess-synchronous force repaint.
We don't need the async variant because it is only needed
to synchronize with the WebProcess-side threaded scrolling
tree, which is not a component of the remote layer tree model.
The UI process will not handle the callback until after
RemoteLayerTreeHost::commit is complete, ensuring that the commit
is actually done.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160052 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm

index 4094b17..caab370 100644 (file)
@@ -1,3 +1,25 @@
+2013-12-03  Tim Horton  <timothy_horton@apple.com>
+
+        Remote Layer Tree: Force repaint
+        https://bugs.webkit.org/show_bug.cgi?id=125189
+        <rdar://problem/15541789>
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
+        (WebKit::RemoteLayerTreeContext::forceRepaint):
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::forceRepaint):
+        Implement WebProcess-synchronous force repaint.
+        We don't need the async variant because it is only needed
+        to synchronize with the WebProcess-side threaded scrolling
+        tree, which is not a component of the remote layer tree model.
+        The UI process will not handle the callback until after
+        RemoteLayerTreeHost::commit is complete, ensuring that the commit
+        is actually done.
+
 2013-12-03  Simon Fraser  <simon.fraser@apple.com>
 
         Remove some iOS-related documentScale code
index ccb4e5c..3e5e2cc 100644 (file)
@@ -58,6 +58,8 @@ public:
 
     void setIsFlushingSuspended(bool);
 
+    void forceRepaint();
+
 private:
     // WebCore::GraphicsLayerFactory
     virtual std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE;
index 447448e..7386962 100644 (file)
@@ -26,6 +26,7 @@
 #import "config.h"
 #import "RemoteLayerTreeContext.h"
 
+#import "GenericCallback.h"
 #import "GraphicsLayerCARemote.h"
 #import "PlatformCALayerRemote.h"
 #import "RemoteLayerTreeTransaction.h"
@@ -151,4 +152,20 @@ void RemoteLayerTreeContext::setIsFlushingSuspended(bool isFrozen)
     }
 }
 
+void RemoteLayerTreeContext::forceRepaint()
+{
+    if (m_isFlushingSuspended)
+        return;
+
+    for (Frame* frame = &m_webPage->corePage()->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+        FrameView* frameView = frame->view();
+        if (!frameView || !frameView->tiledBacking())
+            continue;
+
+        frameView->tiledBacking()->forceRepaint();
+    }
+
+    flushLayers();
+}
+
 } // namespace WebKit
index 58c3ff7..7995c1b 100644 (file)
@@ -66,6 +66,9 @@ private:
 
     virtual void setLayerTreeStateIsFrozen(bool) OVERRIDE;
 
+    virtual void forceRepaint() OVERRIDE;
+    virtual bool forceRepaintAsync(uint64_t) OVERRIDE { return false; }
+
     // WebCore::GraphicsLayerClient
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) OVERRIDE { }
     virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) OVERRIDE { }
index 4dd4987..8af23be 100644 (file)
@@ -202,4 +202,9 @@ void RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen(bool isFrozen)
     m_remoteLayerTreeContext->setIsFlushingSuspended(isFrozen);
 }
 
+void RemoteLayerTreeDrawingArea::forceRepaint()
+{
+    m_remoteLayerTreeContext->forceRepaint();
+}
+
 } // namespace WebKit