Changeset 109386 in webkit


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

Glitchy scrolling on pages where the scroll layer needs to be updated on the main thread
https://bugs.webkit.org/show_bug.cgi?id=80038
<rdar://problem/10933831>

Reviewed by Simon Fraser.

When we need to update the scroll layer position on the main thread, we need to cache the
scroll position we sent to the main thread and assume that that's the correct scroll position.

  • page/scrolling/mac/ScrollingTreeNodeMac.h:

(ScrollingTreeNodeMac):

  • page/scrolling/mac/ScrollingTreeNodeMac.mm:

(WebCore::ScrollingTreeNodeMac::update):
(WebCore::ScrollingTreeNodeMac::setScrollPosition):
(WebCore::ScrollingTreeNodeMac::scrollPosition):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109383 r109386  
     12012-03-01  Anders Carlsson  <andersca@apple.com>
     2
     3        Glitchy scrolling on pages where the scroll layer needs to be updated on the main thread
     4        https://bugs.webkit.org/show_bug.cgi?id=80038
     5        <rdar://problem/10933831>
     6
     7        Reviewed by Simon Fraser.
     8
     9        When we need to update the scroll layer position on the main thread, we need to cache the
     10        scroll position we sent to the main thread and assume that that's the correct scroll position.
     11
     12        * page/scrolling/mac/ScrollingTreeNodeMac.h:
     13        (ScrollingTreeNodeMac):
     14        * page/scrolling/mac/ScrollingTreeNodeMac.mm:
     15        (WebCore::ScrollingTreeNodeMac::update):
     16        (WebCore::ScrollingTreeNodeMac::setScrollPosition):
     17        (WebCore::ScrollingTreeNodeMac::scrollPosition):
     18
    1192012-03-01  Julien Chaffraix  <jchaffraix@webkit.org>
    220
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h

    r108636 r109386  
    7777
    7878    RetainPtr<CALayer> m_scrollLayer;
     79    IntPoint m_probableMainThreadScrollPosition;
    7980};
    8081
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm

    r109237 r109386  
    6161    if (state->changedProperties() & (ScrollingTreeState::ScrollLayer | ScrollingTreeState::ContentsSize | ScrollingTreeState::ViewportRect))
    6262        updateMainFramePinState(scrollPosition());
     63
     64    if ((state->changedProperties() & ScrollingTreeState::ShouldUpdateScrollLayerPositionOnMainThread) && shouldUpdateScrollLayerPositionOnMainThread()) {
     65        // We're transitioning to the slow "update scroll layer position on the main thread" mode.
     66        // Initialize the probable main thread scroll position with the current scroll layer position.
     67        CGPoint scrollLayerPosition = m_scrollLayer.get().position;
     68        m_probableMainThreadScrollPosition = IntPoint(-scrollLayerPosition.x, -scrollLayerPosition.y);
     69    }
    6370}
    6471
     
    7481
    7582    if (shouldUpdateScrollLayerPositionOnMainThread()) {
     83        m_probableMainThreadScrollPosition = scrollPosition;
    7684        scrollingTree()->updateMainFrameScrollPositionAndScrollLayerPosition(scrollPosition);
    7785        return;
     
    216224IntPoint ScrollingTreeNodeMac::scrollPosition() const
    217225{
     226    if (shouldUpdateScrollLayerPositionOnMainThread())
     227        return m_probableMainThreadScrollPosition;
     228
    218229    CGPoint scrollLayerPosition = m_scrollLayer.get().position;
    219230    return IntPoint(-scrollLayerPosition.x, -scrollLayerPosition.y);
Note: See TracChangeset for help on using the changeset viewer.