Title: [88127] trunk/Source/WebKit2
Revision
88127
Author
[email protected]
Date
2011-06-04 19:08:54 -0700 (Sat, 04 Jun 2011)

Log Message

2011-06-04  Sam Weinig  <[email protected]>

        Reviewed by Anders Carlsson.

        Disable WebProcess side display throttling when in a user scroll
        <rdar://problem/9517175>
        https://bugs.webkit.org/show_bug.cgi?id=62095

        Add the ability to disable WebProcess side display throttling that
        takes place in DrawingAreaImpl::displayTimerFired. Disable the throttling
        when in a user or animated scroll.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::didStartRubberBandForFrame):
        (WebKit::WebChromeClient::didCompleteRubberBandForFrame):
        (WebKit::WebChromeClient::didStartAnimatedScroll):
        (WebKit::WebChromeClient::didCompleteAnimatedScroll):
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::enableDisplayThrottling):
        (WebKit::DrawingArea::disableDisplayThrottling):
        * WebProcess/WebPage/DrawingAreaImpl.cpp:
        (WebKit::DrawingAreaImpl::DrawingAreaImpl):
        (WebKit::DrawingAreaImpl::enableDisplayThrottling):
        (WebKit::DrawingAreaImpl::disableDisplayThrottling):
        (WebKit::DrawingAreaImpl::displayTimerFired):
        * WebProcess/WebPage/DrawingAreaImpl.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::wheelEvent):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (88126 => 88127)


--- trunk/Source/WebKit2/ChangeLog	2011-06-05 00:46:12 UTC (rev 88126)
+++ trunk/Source/WebKit2/ChangeLog	2011-06-05 02:08:54 UTC (rev 88127)
@@ -1,3 +1,32 @@
+2011-06-04  Sam Weinig  <[email protected]>
+
+        Reviewed by Anders Carlsson.
+
+        Disable WebProcess side display throttling when in a user scroll
+        <rdar://problem/9517175>
+        https://bugs.webkit.org/show_bug.cgi?id=62095
+
+        Add the ability to disable WebProcess side display throttling that
+        takes place in DrawingAreaImpl::displayTimerFired. Disable the throttling
+        when in a user or animated scroll.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::didStartRubberBandForFrame):
+        (WebKit::WebChromeClient::didCompleteRubberBandForFrame):
+        (WebKit::WebChromeClient::didStartAnimatedScroll):
+        (WebKit::WebChromeClient::didCompleteAnimatedScroll):
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::enableDisplayThrottling):
+        (WebKit::DrawingArea::disableDisplayThrottling):
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::DrawingAreaImpl):
+        (WebKit::DrawingAreaImpl::enableDisplayThrottling):
+        (WebKit::DrawingAreaImpl::disableDisplayThrottling):
+        (WebKit::DrawingAreaImpl::displayTimerFired):
+        * WebProcess/WebPage/DrawingAreaImpl.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::wheelEvent):
+
 2011-06-04  Darin Adler  <[email protected]>
 
         Reviewed by Anders Carlsson.

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (88126 => 88127)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-06-05 00:46:12 UTC (rev 88126)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-06-05 02:08:54 UTC (rev 88127)
@@ -770,10 +770,13 @@
 
 void WebChromeClient::didStartRubberBandForFrame(Frame*, const IntSize&) const
 {
+    m_page->drawingArea()->disableDisplayThrottling();
 }
 
 void WebChromeClient::didCompleteRubberBandForFrame(Frame* frame, const IntSize& initialOverhang) const
 {
+    m_page->drawingArea()->enableDisplayThrottling();
+
     if (frame != frame->page()->mainFrame())
         return;
     m_page->send(Messages::WebPageProxy::DidCompleteRubberBandForMainFrame(initialOverhang));
@@ -781,10 +784,12 @@
 
 void WebChromeClient::didStartAnimatedScroll() const
 {
+    m_page->drawingArea()->disableDisplayThrottling();
 }
 
 void WebChromeClient::didCompleteAnimatedScroll() const
 {
+    m_page->drawingArea()->enableDisplayThrottling();
 }
     
 void WebChromeClient::notifyScrollerThumbIsVisibleInRect(const IntRect& scrollerThumb)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (88126 => 88127)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h	2011-06-05 00:46:12 UTC (rev 88126)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h	2011-06-05 02:08:54 UTC (rev 88127)
@@ -63,6 +63,8 @@
     virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) = 0;
 
     // FIXME: These should be pure virtual.
+    virtual void enableDisplayThrottling() { }
+    virtual void disableDisplayThrottling() { }
     virtual void pageBackgroundTransparencyChanged() { }
     virtual void forceRepaint() { }
     virtual void setLayerTreeStateIsFrozen(bool) { }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (88126 => 88127)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2011-06-05 00:46:12 UTC (rev 88126)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2011-06-05 02:08:54 UTC (rev 88127)
@@ -64,6 +64,7 @@
     , m_wantsToExitAcceleratedCompositingMode(false)
     , m_isPaintingSuspended(!parameters.isVisible)
     , m_alwaysUseCompositing(false)
+    , m_shouldThrottleDisplay(true)
     , m_lastDisplayTime(0)
     , m_displayTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::displayTimerFired)
     , m_exitCompositingTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::exitAcceleratedCompositingMode)
@@ -192,6 +193,16 @@
     display();
 }
 
+void DrawingAreaImpl::enableDisplayThrottling()
+{
+    m_shouldThrottleDisplay = true;
+}
+
+void DrawingAreaImpl::disableDisplayThrottling()
+{
+    m_shouldThrottleDisplay = false;
+}
+
 void DrawingAreaImpl::didInstallPageOverlay()
 {
     if (m_layerTreeHost)
@@ -514,12 +525,14 @@
     static const double minimumFrameInterval = 1.0 / 60.0;
 #endif
 
-    double timeSinceLastDisplay = currentTime() - m_lastDisplayTime;
-    double timeUntilNextDisplay = minimumFrameInterval - timeSinceLastDisplay;
+    if (m_shouldThrottleDisplay) {
+        double timeSinceLastDisplay = currentTime() - m_lastDisplayTime;
+        double timeUntilNextDisplay = minimumFrameInterval - timeSinceLastDisplay;
 
-    if (timeUntilNextDisplay > 0) {
-        m_displayTimer.startOneShot(timeUntilNextDisplay);
-        return;
+        if (timeUntilNextDisplay > 0) {
+            m_displayTimer.startOneShot(timeUntilNextDisplay);
+            return;
+        }
     }
 
     display();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h (88126 => 88127)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h	2011-06-05 00:46:12 UTC (rev 88126)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h	2011-06-05 02:08:54 UTC (rev 88127)
@@ -51,6 +51,9 @@
     virtual void setLayerTreeStateIsFrozen(bool);
     virtual void forceRepaint();
 
+    virtual void enableDisplayThrottling();
+    virtual void disableDisplayThrottling();
+
     virtual void didInstallPageOverlay();
     virtual void didUninstallPageOverlay();
     virtual void setPageOverlayNeedsDisplay(const WebCore::IntRect&);
@@ -115,6 +118,9 @@
     bool m_isPaintingSuspended;
     bool m_alwaysUseCompositing;
 
+    // Whether we should throttle displays to a set update rate on the WebProcess side.
+    bool m_shouldThrottleDisplay;
+
     double m_lastDisplayTime;
 
     RunLoop::Timer<DrawingAreaImpl> m_displayTimer;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (88126 => 88127)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2011-06-05 00:46:12 UTC (rev 88126)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2011-06-05 02:08:54 UTC (rev 88127)
@@ -1069,6 +1069,13 @@
 {
     CurrentEvent currentEvent(wheelEvent);
 
+#if PLATFORM(MAC)
+    if (wheelEvent.momentumPhase() == WebWheelEvent::PhaseBegan || wheelEvent.phase() == WebWheelEvent::PhaseBegan)
+        m_drawingArea->disableDisplayThrottling();
+    else if (wheelEvent.momentumPhase() == WebWheelEvent::PhaseEnded || wheelEvent.phase() == WebWheelEvent::PhaseEnded)
+        m_drawingArea->enableDisplayThrottling();
+#endif
+
     bool handled = handleWheelEvent(wheelEvent, m_page.get());
     send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(wheelEvent.type()), handled));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to