Changeset 88127 in webkit


Ignore:
Timestamp:
Jun 4, 2011 7:08:54 PM (13 years ago)
Author:
weinig@apple.com
Message:

2011-06-04 Sam Weinig <sam@webkit.org>

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):
Location:
trunk/Source/WebKit2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r88123 r88127  
     12011-06-04  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Disable WebProcess side display throttling when in a user scroll
     6        <rdar://problem/9517175>
     7        https://bugs.webkit.org/show_bug.cgi?id=62095
     8
     9        Add the ability to disable WebProcess side display throttling that
     10        takes place in DrawingAreaImpl::displayTimerFired. Disable the throttling
     11        when in a user or animated scroll.
     12
     13        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     14        (WebKit::WebChromeClient::didStartRubberBandForFrame):
     15        (WebKit::WebChromeClient::didCompleteRubberBandForFrame):
     16        (WebKit::WebChromeClient::didStartAnimatedScroll):
     17        (WebKit::WebChromeClient::didCompleteAnimatedScroll):
     18        * WebProcess/WebPage/DrawingArea.h:
     19        (WebKit::DrawingArea::enableDisplayThrottling):
     20        (WebKit::DrawingArea::disableDisplayThrottling):
     21        * WebProcess/WebPage/DrawingAreaImpl.cpp:
     22        (WebKit::DrawingAreaImpl::DrawingAreaImpl):
     23        (WebKit::DrawingAreaImpl::enableDisplayThrottling):
     24        (WebKit::DrawingAreaImpl::disableDisplayThrottling):
     25        (WebKit::DrawingAreaImpl::displayTimerFired):
     26        * WebProcess/WebPage/DrawingAreaImpl.h:
     27        * WebProcess/WebPage/WebPage.cpp:
     28        (WebKit::WebPage::wheelEvent):
     29
    1302011-06-04  Darin Adler  <darin@apple.com>
    231
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r88121 r88127  
    771771void WebChromeClient::didStartRubberBandForFrame(Frame*, const IntSize&) const
    772772{
     773    m_page->drawingArea()->disableDisplayThrottling();
    773774}
    774775
    775776void WebChromeClient::didCompleteRubberBandForFrame(Frame* frame, const IntSize& initialOverhang) const
    776777{
     778    m_page->drawingArea()->enableDisplayThrottling();
     779
    777780    if (frame != frame->page()->mainFrame())
    778781        return;
     
    782785void WebChromeClient::didStartAnimatedScroll() const
    783786{
     787    m_page->drawingArea()->disableDisplayThrottling();
    784788}
    785789
    786790void WebChromeClient::didCompleteAnimatedScroll() const
    787791{
     792    m_page->drawingArea()->enableDisplayThrottling();
    788793}
    789794   
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h

    r87806 r88127  
    6464
    6565    // FIXME: These should be pure virtual.
     66    virtual void enableDisplayThrottling() { }
     67    virtual void disableDisplayThrottling() { }
    6668    virtual void pageBackgroundTransparencyChanged() { }
    6769    virtual void forceRepaint() { }
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp

    r87832 r88127  
    6565    , m_isPaintingSuspended(!parameters.isVisible)
    6666    , m_alwaysUseCompositing(false)
     67    , m_shouldThrottleDisplay(true)
    6768    , m_lastDisplayTime(0)
    6869    , m_displayTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::displayTimerFired)
     
    191192    m_isWaitingForDidUpdate = false;
    192193    display();
     194}
     195
     196void DrawingAreaImpl::enableDisplayThrottling()
     197{
     198    m_shouldThrottleDisplay = true;
     199}
     200
     201void DrawingAreaImpl::disableDisplayThrottling()
     202{
     203    m_shouldThrottleDisplay = false;
    193204}
    194205
     
    515526#endif
    516527
    517     double timeSinceLastDisplay = currentTime() - m_lastDisplayTime;
    518     double timeUntilNextDisplay = minimumFrameInterval - timeSinceLastDisplay;
    519 
    520     if (timeUntilNextDisplay > 0) {
    521         m_displayTimer.startOneShot(timeUntilNextDisplay);
    522         return;
     528    if (m_shouldThrottleDisplay) {
     529        double timeSinceLastDisplay = currentTime() - m_lastDisplayTime;
     530        double timeUntilNextDisplay = minimumFrameInterval - timeSinceLastDisplay;
     531
     532        if (timeUntilNextDisplay > 0) {
     533            m_displayTimer.startOneShot(timeUntilNextDisplay);
     534            return;
     535        }
    523536    }
    524537
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h

    r87832 r88127  
    5151    virtual void setLayerTreeStateIsFrozen(bool);
    5252    virtual void forceRepaint();
     53
     54    virtual void enableDisplayThrottling();
     55    virtual void disableDisplayThrottling();
    5356
    5457    virtual void didInstallPageOverlay();
     
    116119    bool m_alwaysUseCompositing;
    117120
     121    // Whether we should throttle displays to a set update rate on the WebProcess side.
     122    bool m_shouldThrottleDisplay;
     123
    118124    double m_lastDisplayTime;
    119125
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r87458 r88127  
    10701070    CurrentEvent currentEvent(wheelEvent);
    10711071
     1072#if PLATFORM(MAC)
     1073    if (wheelEvent.momentumPhase() == WebWheelEvent::PhaseBegan || wheelEvent.phase() == WebWheelEvent::PhaseBegan)
     1074        m_drawingArea->disableDisplayThrottling();
     1075    else if (wheelEvent.momentumPhase() == WebWheelEvent::PhaseEnded || wheelEvent.phase() == WebWheelEvent::PhaseEnded)
     1076        m_drawingArea->enableDisplayThrottling();
     1077#endif
     1078
    10721079    bool handled = handleWheelEvent(wheelEvent, m_page.get());
    10731080    send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(wheelEvent.type()), handled));
Note: See TracChangeset for help on using the changeset viewer.