[chromium] Fix continuous painting mode
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 08:34:53 +0000 (08:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 08:34:53 +0000 (08:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=110788

Patch by James Robinson <jamesr@chromium.org> on 2013-02-26
Reviewed by Adrienne Walker.

Recent instrumentation shuffling caused WebViewImpl::didBeginFrame to no longer be called, which
broke continuous painting.  Since continuous painting mode is meant to simply invalidate layers
on each frame, it's a better fit for the animation system. This moves the invalidation calls
into WebViewImpl::updateAnimations along with other animation type things.

Tested manually by enabling continuous painting mode in the inspector. There aren't any automated
tests in WebKit for this feature.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setContinuousPaintingEnabled):
(WebKit::WebViewImpl::didBeginFrame):
(WebKit::WebViewImpl::updateAnimations):
* src/painting/ContinuousPainter.cpp:
(WebKit::ContinuousPainter::setNeedsDisplayRecursive):

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

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/painting/ContinuousPainter.cpp

index 167e49a..7602513 100644 (file)
@@ -1,3 +1,25 @@
+2013-02-26  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Fix continuous painting mode
+        https://bugs.webkit.org/show_bug.cgi?id=110788
+
+        Reviewed by Adrienne Walker.
+
+        Recent instrumentation shuffling caused WebViewImpl::didBeginFrame to no longer be called, which
+        broke continuous painting.  Since continuous painting mode is meant to simply invalidate layers
+        on each frame, it's a better fit for the animation system. This moves the invalidation calls
+        into WebViewImpl::updateAnimations along with other animation type things.
+
+        Tested manually by enabling continuous painting mode in the inspector. There aren't any automated
+        tests in WebKit for this feature.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::setContinuousPaintingEnabled):
+        (WebKit::WebViewImpl::didBeginFrame):
+        (WebKit::WebViewImpl::updateAnimations):
+        * src/painting/ContinuousPainter.cpp:
+        (WebKit::ContinuousPainter::setNeedsDisplayRecursive):
+
 2013-02-26  James Weatherall  <wez@chromium.org>
 
         keydown and keyup events have zero keycode for some numeric pad keys under Chromium on Linux
index 77b0607..7547bba 100644 (file)
@@ -930,6 +930,7 @@ void WebViewImpl::setContinuousPaintingEnabled(bool enabled)
         m_layerTreeView->setContinuousPaintingEnabled(enabled);
     }
     m_continuousPaintingEnabled = enabled;
+    m_client->scheduleAnimation();
 }
 
 bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
@@ -1852,9 +1853,6 @@ void WebViewImpl::didBeginFrame()
 {
     if (m_devToolsAgent)
         m_devToolsAgent->didComposite();
-
-    if (m_continuousPaintingEnabled)
-        ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, m_pageOverlays.get());
 }
 
 void WebViewImpl::updateAnimations(double monotonicFrameBeginTime)
@@ -1876,6 +1874,11 @@ void WebViewImpl::updateAnimations(double monotonicFrameBeginTime)
     if (!m_page)
         return;
 
+    if (m_continuousPaintingEnabled) {
+        ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, m_pageOverlays.get());
+        m_client->scheduleAnimation();
+    }
+
     PageWidgetDelegate::animate(m_page.get(), monotonicFrameBeginTime);
 #endif
 }
index d384c35..b5c3682 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "GraphicsLayer.h"
 #include "PageOverlayList.h"
+#include "TraceEvent.h"
 
 using namespace WebCore;
 
@@ -44,6 +45,7 @@ void ContinuousPainter::setNeedsDisplayRecursive(GraphicsLayer* layer, PageOverl
     if (pageOverlays && pageOverlays->findGraphicsLayer(layer) != WTF::notFound)
         return;
 
+    TRACE_EVENT0("webkit", "ContinuousPainter::setNeedsDisplayRecursive");
     layer->setNeedsDisplay();
 
     setNeedsDisplayRecursive(layer->maskLayer(), pageOverlays);