Changeset 112434 in webkit


Ignore:
Timestamp:
Mar 28, 2012 1:36:39 PM (12 years ago)
Author:
andersca@apple.com
Message:

"Sticky" or slow scrolling on some sites
https://bugs.webkit.org/show_bug.cgi?id=82512
<rdar://problem/11000372>

Reviewed by Andreas Kling.

When we're in the slow mode and have to update the scroll layer position on the main thread,
get it from the scrolling thread so we'll be in sync with the scrolling tree when the main thread is busy.

  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition):

  • page/scrolling/ScrollingCoordinator.h:

(ScrollingCoordinator):

  • page/scrolling/ScrollingTree.cpp:

(WebCore::ScrollingTree::mainFrameScrollPosition):
(WebCore):
(WebCore::ScrollingTree::updateMainFrameScrollPositionAndScrollLayerPosition):

  • page/scrolling/ScrollingTree.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112432 r112434  
     12012-03-28  Anders Carlsson  <andersca@apple.com>
     2
     3        "Sticky" or slow scrolling on some sites
     4        https://bugs.webkit.org/show_bug.cgi?id=82512
     5        <rdar://problem/11000372>
     6
     7        Reviewed by Andreas Kling.
     8
     9        When we're in the slow mode and have to update the scroll layer position on the main thread,
     10        get it from the scrolling thread so we'll be in sync with the scrolling tree when the main thread is busy.
     11
     12        * page/scrolling/ScrollingCoordinator.cpp:
     13        (WebCore::ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition):
     14        * page/scrolling/ScrollingCoordinator.h:
     15        (ScrollingCoordinator):
     16        * page/scrolling/ScrollingTree.cpp:
     17        (WebCore::ScrollingTree::mainFrameScrollPosition):
     18        (WebCore):
     19        (WebCore::ScrollingTree::updateMainFrameScrollPositionAndScrollLayerPosition):
     20        * page/scrolling/ScrollingTree.h:
     21
    1222012-03-28  Adrienne Walker  <enne@google.com>
    223
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r112343 r112434  
    279279}
    280280
    281 void ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint& scrollPosition)
    282 {
    283 #if USE(ACCELERATED_COMPOSITING)
     281void ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition()
     282{
     283#if USE(ACCELERATED_COMPOSITING) && ENABLE(THREADED_SCROLLING)
    284284    ASSERT(isMainThread());
    285285
     
    290290    if (!frameView)
    291291        return;
     292
     293    IntPoint scrollPosition = m_scrollingTree->mainFrameScrollPosition();
    292294
    293295    // Make sure to update the main frame scroll position before changing the scroll layer position,
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r112325 r112434  
    109109
    110110    // Dispatched by the scrolling tree whenever the main frame scroll position changes and the scroll layer position needs to be updated as well.
    111     void updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint&);
     111    void updateMainFrameScrollPositionAndScrollLayerPosition();
    112112
    113113#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r109237 r112434  
    162162}
    163163
     164IntPoint ScrollingTree::mainFrameScrollPosition()
     165{
     166    MutexLocker lock(m_mutex);
     167    return m_mainFrameScrollPosition;
     168}
     169
    164170void ScrollingTree::updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint& scrollPosition)
    165171{
     
    172178    }
    173179
    174     callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition, m_scrollingCoordinator.get(), scrollPosition));
     180    callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition, m_scrollingCoordinator.get()));
    175181}
    176182
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r109237 r112434  
    8080    void updateMainFrameScrollPosition(const IntPoint& scrollPosition);
    8181    void updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint& scrollPosition);
     82    IntPoint mainFrameScrollPosition();
    8283
    8384#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
Note: See TracChangeset for help on using the changeset viewer.