[CoordinatedGraphics] Suspend or resume when visibility is changed
authorryuan.choi@navercorp.com <ryuan.choi@navercorp.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Jan 2015 02:47:04 +0000 (02:47 +0000)
committerryuan.choi@navercorp.com <ryuan.choi@navercorp.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Jan 2015 02:47:04 +0000 (02:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140285

Reviewed by Gyuyoung Kim.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: Copied the logic from TiledCoreAnimationDrawingArea.
(WebKit::CoordinatedDrawingArea::viewStateDidChange):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h

index 7924b02..04981e2 100644 (file)
@@ -1,3 +1,14 @@
+2015-01-11  Ryuan Choi  <ryuan.choi@navercorp.com>
+
+        [CoordinatedGraphics] Suspend or resume when visibility is changed
+        https://bugs.webkit.org/show_bug.cgi?id=140285
+
+        Reviewed by Gyuyoung Kim.
+
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: Copied the logic from TiledCoreAnimationDrawingArea.
+        (WebKit::CoordinatedDrawingArea::viewStateDidChange):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
+
 2015-01-10  Gwang Yoon Hwang  <yoon@igalia.com>
 
         [ThreadedCompositor] Prevent excessive rendering call.
index 8b92f39..ad2579d 100644 (file)
@@ -608,6 +608,16 @@ void CoordinatedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage(IPC::Conn
 }
 #endif
 
+void CoordinatedDrawingArea::viewStateDidChange(ViewState::Flags changed, bool, const Vector<uint64_t>&)
+{
+    if (changed & ViewState::IsVisible) {
+        if (m_webPage.isVisible())
+            resumePainting();
+        else
+            suspendPainting();
+    }
+}
+
 void CoordinatedDrawingArea::attachViewOverlayGraphicsLayer(WebCore::Frame* frame, WebCore::GraphicsLayer* viewOverlayRootLayer)
 {
     if (!frame->isMainFrame())
index 14d2b56..d705346 100644 (file)
@@ -68,6 +68,7 @@ private:
     virtual void didReceiveCoordinatedLayerTreeHostMessage(IPC::Connection&, IPC::MessageDecoder&);
 #endif
 
+    virtual void viewStateDidChange(WebCore::ViewState::Flags, bool /* wantsDidUpdateViewState */, const Vector<uint64_t>& /* callbackIDs */) override;
     virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
 
     // IPC message handlers.