Changeset 128132 in webkit


Ignore:
Timestamp:
Sep 10, 2012 5:12:38 PM (12 years ago)
Author:
jamesr@google.com
Message:

Unreviewed, rolling out r127837.
http://trac.webkit.org/changeset/127837
https://bugs.webkit.org/show_bug.cgi?id=93898

Broke ScrollingCoordinator on chromium

Source/WebCore:

  • WebCore.xcodeproj/project.pbxproj:
  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
(WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
(WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::ScrollingCoordinator::hasNonLayerFixedObjects):
(WebCore::ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread):
(WebCore::ScrollingCoordinator::setForceMainThreadScrollLayerPositionUpdates):
(WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):

  • page/scrolling/ScrollingCoordinator.h:

(ScrollingCoordinator):

  • page/scrolling/ScrollingCoordinatorNone.cpp:

(WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):

  • page/scrolling/ScrollingTree.cpp:

(WebCore::ScrollingTree::scrollingPeformanceLoggingEnabled):

  • page/scrolling/ScrollingTree.h:
  • page/scrolling/ScrollingTreeNode.cpp:

(WebCore::ScrollingTreeNode::ScrollingTreeNode):
(WebCore::ScrollingTreeNode::update):

  • page/scrolling/ScrollingTreeNode.h:

(WebCore::ScrollingTreeNode::shouldUpdateScrollLayerPositionOnMainThread):
(ScrollingTreeNode):

  • page/scrolling/ScrollingTreeState.cpp:

(WebCore::ScrollingTreeState::ScrollingTreeState):
(WebCore::ScrollingTreeState::setShouldUpdateScrollLayerPositionOnMainThread):

  • page/scrolling/ScrollingTreeState.h:

(WebCore::ScrollingTreeState::shouldUpdateScrollLayerPositionOnMainThread):
(ScrollingTreeState):

  • page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:

(WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):

  • page/scrolling/mac/ScrollingTreeMac.mm:

(WebCore::ScrollingTree::updateDebugRootLayer):

  • page/scrolling/mac/ScrollingTreeNodeMac.mm:

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

Source/WebKit2:

  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):

Location:
trunk/Source
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128131 r128132  
     12012-09-10  James Robinson  <jamesr@chromium.org>
     2
     3        Unreviewed, rolling out r127837.
     4        http://trac.webkit.org/changeset/127837
     5        https://bugs.webkit.org/show_bug.cgi?id=93898
     6
     7        Broke ScrollingCoordinator on chromium
     8
     9        * WebCore.xcodeproj/project.pbxproj:
     10        * page/scrolling/ScrollingCoordinator.cpp:
     11        (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
     12        (WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
     13        (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
     14        (WebCore::ScrollingCoordinator::hasNonLayerFixedObjects):
     15        (WebCore::ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread):
     16        (WebCore::ScrollingCoordinator::setForceMainThreadScrollLayerPositionUpdates):
     17        (WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):
     18        * page/scrolling/ScrollingCoordinator.h:
     19        (ScrollingCoordinator):
     20        * page/scrolling/ScrollingCoordinatorNone.cpp:
     21        (WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):
     22        * page/scrolling/ScrollingTree.cpp:
     23        (WebCore::ScrollingTree::scrollingPeformanceLoggingEnabled):
     24        * page/scrolling/ScrollingTree.h:
     25        * page/scrolling/ScrollingTreeNode.cpp:
     26        (WebCore::ScrollingTreeNode::ScrollingTreeNode):
     27        (WebCore::ScrollingTreeNode::update):
     28        * page/scrolling/ScrollingTreeNode.h:
     29        (WebCore::ScrollingTreeNode::shouldUpdateScrollLayerPositionOnMainThread):
     30        (ScrollingTreeNode):
     31        * page/scrolling/ScrollingTreeState.cpp:
     32        (WebCore::ScrollingTreeState::ScrollingTreeState):
     33        (WebCore::ScrollingTreeState::setShouldUpdateScrollLayerPositionOnMainThread):
     34        * page/scrolling/ScrollingTreeState.h:
     35        (WebCore::ScrollingTreeState::shouldUpdateScrollLayerPositionOnMainThread):
     36        (ScrollingTreeState):
     37        * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
     38        (WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):
     39        * page/scrolling/mac/ScrollingTreeMac.mm:
     40        (WebCore::ScrollingTree::updateDebugRootLayer):
     41        * page/scrolling/mac/ScrollingTreeNodeMac.mm:
     42        (WebCore::ScrollingTreeNodeMac::update):
     43        (WebCore::ScrollingTreeNodeMac::scrollPosition):
     44        (WebCore::ScrollingTreeNodeMac::setScrollPosition):
     45        (WebCore::ScrollingTreeNodeMac::setScrollPositionWithoutContentEdgeConstraints):
     46        (WebCore::ScrollingTreeNodeMac::setScrollLayerPosition):
     47
    1482012-09-10  Philip Rogers  <pdr@google.com>
    249
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r128114 r128132  
    512512                1AAADDA414DB409F00AF64B3 /* ScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
    513513                1AAADDBE14DC640700AF64B3 /* ScrollingTreeState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDBC14DC640600AF64B3 /* ScrollingTreeState.cpp */; };
    514                 1AAADDBF14DC640700AF64B3 /* ScrollingTreeState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDBD14DC640600AF64B3 /* ScrollingTreeState.h */; settings = {ATTRIBUTES = (Private, ); }; };
     514                1AAADDBF14DC640700AF64B3 /* ScrollingTreeState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDBD14DC640600AF64B3 /* ScrollingTreeState.h */; };
    515515                1AAADDDA14DC74EC00AF64B3 /* ScrollingTreeStateMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDD814DC74EC00AF64B3 /* ScrollingTreeStateMac.mm */; };
    516516                1AAADDE314DC8C8F00AF64B3 /* ScrollingTreeNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDE114DC8C8F00AF64B3 /* ScrollingTreeNode.cpp */; };
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r127837 r128132  
    3737#include "RenderView.h"
    3838#include "ScrollAnimator.h"
     39#include "ScrollingTreeState.h"
    3940#include <wtf/MainThread.h>
    4041
     
    4647#include "ScrollingThread.h"
    4748#include "ScrollingTree.h"
    48 #include "ScrollingTreeState.h"
    4949#include <wtf/Functional.h>
    5050#include <wtf/PassRefPtr.h>
     
    193193        return;
    194194
    195     updateShouldUpdateScrollLayerPositionOnMainThreadReason();
     195    updateShouldUpdateScrollLayerPositionOnMainThread();
    196196}
    197197
     
    204204        return;
    205205
    206     updateShouldUpdateScrollLayerPositionOnMainThreadReason();
     206    updateShouldUpdateScrollLayerPositionOnMainThread();
    207207}
    208208
     
    233233    frameViewLayoutUpdated(frameView);
    234234    recomputeWheelEventHandlerCount();
    235     updateShouldUpdateScrollLayerPositionOnMainThreadReason();
     235    updateShouldUpdateScrollLayerPositionOnMainThread();
    236236    setScrollLayer(scrollLayerForFrameView(frameView));
    237237}
     
    360360}
    361361
    362 bool ScrollingCoordinator::hasNonLayerViewportConstrainedObjects(FrameView* frameView)
     362bool ScrollingCoordinator::hasNonLayerFixedObjects(FrameView* frameView)
    363363{
    364364    const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects = frameView->viewportConstrainedObjects();
     
    381381}
    382382
    383 void ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThreadReason()
    384 {
    385 #if ENABLE(THREADED_SCROLLING)
     383void ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread()
     384{
    386385    FrameView* frameView = m_page->mainFrame()->view();
    387386
    388     ReasonForUpdatingScrollLayerPositionOnMainThreadFlags reasonsForUpdatingScrollLayerPositionOnMainThread = (ReasonForUpdatingScrollLayerPositionOnMainThreadFlags)0;
    389 
    390     if (m_forceMainThreadScrollLayerPositionUpdates)
    391         reasonsForUpdatingScrollLayerPositionOnMainThread |= ScrollingTreeState::ForcedOnMainThread;
    392     if (frameView->hasSlowRepaintObjects())
    393         reasonsForUpdatingScrollLayerPositionOnMainThread |= ScrollingTreeState::HasSlowRepaintObjects;
    394     if (!supportsFixedPositionLayers() && frameView->hasViewportConstrainedObjects())
    395         reasonsForUpdatingScrollLayerPositionOnMainThread |= ScrollingTreeState::HasNonCompositedViewportConstrainedObjects;
    396     if (supportsFixedPositionLayers() && hasNonLayerViewportConstrainedObjects(frameView))
    397         reasonsForUpdatingScrollLayerPositionOnMainThread |= ScrollingTreeState::HasNonLayerViewportConstrainedObjects;
    398     if (m_page->mainFrame()->document()->isImageDocument())
    399         reasonsForUpdatingScrollLayerPositionOnMainThread |= ScrollingTreeState::IsImageDocument;
    400 
    401     setShouldUpdateScrollLayerPositionOnMainThreadReason(reasonsForUpdatingScrollLayerPositionOnMainThread);
    402 #endif
     387    setShouldUpdateScrollLayerPositionOnMainThread(m_forceMainThreadScrollLayerPositionUpdates
     388        || frameView->hasSlowRepaintObjects()
     389        || (!supportsFixedPositionLayers() && frameView->hasViewportConstrainedObjects())
     390        || (supportsFixedPositionLayers() && hasNonLayerFixedObjects(frameView))
     391        || m_page->mainFrame()->document()->isImageDocument());
    403392}
    404393
     
    409398
    410399    m_forceMainThreadScrollLayerPositionUpdates = forceMainThreadScrollLayerPositionUpdates;
    411     updateShouldUpdateScrollLayerPositionOnMainThreadReason();
     400    updateShouldUpdateScrollLayerPositionOnMainThread();
    412401}
    413402
     
    447436}
    448437
    449 #if ENABLE(THREADED_SCROLLING)
    450 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThreadReason(ReasonForUpdatingScrollLayerPositionOnMainThreadFlags reasons)
     438void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool shouldUpdateScrollLayerPositionOnMainThread)
    451439{
    452440    // The FrameView's GraphicsLayer is likely to be out-of-synch with the PlatformLayer
    453441    // at this point. So we'll update it before we switch back to main thread scrolling
    454442    // in order to avoid layer positioning bugs.
    455     if (reasons)
     443    if (shouldUpdateScrollLayerPositionOnMainThread)
    456444        updateMainFrameScrollLayerPosition();
    457     m_scrollingTreeState->setShouldUpdateScrollLayerPositionOnMainThreadReason(reasons);
     445    m_scrollingTreeState->setShouldUpdateScrollLayerPositionOnMainThread(shouldUpdateScrollLayerPositionOnMainThread);
    458446    scheduleTreeStateCommit();
    459447}
    460 #endif
    461448
    462449void ScrollingCoordinator::scheduleTreeStateCommit()
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r127837 r128132  
    3535
    3636#if ENABLE(THREADED_SCROLLING)
    37 #include "ScrollingTreeState.h"
    3837#include <wtf/ThreadSafeRefCounted.h>
    3938#include <wtf/Threading.h>
     
    133132
    134133    void recomputeWheelEventHandlerCount();
    135     bool hasNonLayerViewportConstrainedObjects(FrameView*);
    136     void updateShouldUpdateScrollLayerPositionOnMainThreadReason();
     134    bool hasNonLayerFixedObjects(FrameView*);
     135    void updateShouldUpdateScrollLayerPositionOnMainThread();
    137136
    138137    void setScrollLayer(GraphicsLayer*);
     
    157156    void setScrollParameters(const ScrollParameters&);
    158157    void setWheelEventHandlerCount(unsigned);
    159 #if ENABLE(THREADED_SCROLLING)
    160     void setShouldUpdateScrollLayerPositionOnMainThreadReason(ReasonForUpdatingScrollLayerPositionOnMainThreadFlags);
    161 #endif
     158    void setShouldUpdateScrollLayerPositionOnMainThread(bool);
    162159
    163160    void updateMainFrameScrollLayerPosition();
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp

    r127837 r128132  
    6868}
    6969
    70 #if ENABLE(THREADED_SCROLLING)
    71 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThreadReason(ReasonForUpdatingScrollLayerPositionOnMainThreadFlags)
     70void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool)
    7271{
    7372}
    74 #endif
    7573
    7674bool ScrollingCoordinator::supportsFixedPositionLayers() const
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r127837 r128132  
    225225}
    226226
    227 bool ScrollingTree::scrollingPerformanceLoggingEnabled()
     227bool ScrollingTree::scrollingPeformanceLoggingEnabled()
    228228{
    229229    return m_scrollingPerformanceLoggingEnabled;
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r127837 r128132  
    9999
    100100    void setScrollingPerformanceLoggingEnabled(bool flag);
    101     bool scrollingPerformanceLoggingEnabled();
     101    bool scrollingPeformanceLoggingEnabled();
    102102
    103103private:
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp

    r127837 r128132  
    3535ScrollingTreeNode::ScrollingTreeNode(ScrollingTree* scrollingTree)
    3636    : m_scrollingTree(scrollingTree)
    37     , m_shouldUpdateScrollLayerPositionOnMainThreadReason(0)
     37    , m_shouldUpdateScrollLayerPositionOnMainThread(false)
    3838    , m_horizontalScrollElasticity(ScrollElasticityNone)
    3939    , m_verticalScrollElasticity(ScrollElasticityNone)
     
    5757        m_contentsSize = state->contentsSize();
    5858
    59     if (state->changedProperties() & ScrollingTreeState::ShouldUpdateScrollLayerPositionOnMainThreadReason)
    60         m_shouldUpdateScrollLayerPositionOnMainThreadReason = state->shouldUpdateScrollLayerPositionOnMainThreadReason();
     59    if (state->changedProperties() & ScrollingTreeState::ShouldUpdateScrollLayerPositionOnMainThread)
     60        m_shouldUpdateScrollLayerPositionOnMainThread = state->shouldUpdateScrollLayerPositionOnMainThread();
    6161
    6262    if (state->changedProperties() & ScrollingTreeState::HorizontalScrollElasticity)
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.h

    r127837 r128132  
    3131#include "IntRect.h"
    3232#include "ScrollTypes.h"
    33 #include "ScrollingTreeState.h"
    3433#include <wtf/PassOwnPtr.h>
    3534
     
    4948    virtual void setScrollPosition(const IntPoint&) = 0;
    5049
    51     ReasonForUpdatingScrollLayerPositionOnMainThreadFlags shouldUpdateScrollLayerPositionOnMainThreadReason() const { return m_shouldUpdateScrollLayerPositionOnMainThreadReason; }
     50    bool shouldUpdateScrollLayerPositionOnMainThread() const { return m_shouldUpdateScrollLayerPositionOnMainThread; }
    5251
    5352protected:
     
    7675    IntPoint m_scrollOrigin;
    7776
    78     ReasonForUpdatingScrollLayerPositionOnMainThreadFlags m_shouldUpdateScrollLayerPositionOnMainThreadReason;
     77    bool m_shouldUpdateScrollLayerPositionOnMainThread;
    7978
    8079    ScrollElasticity m_horizontalScrollElasticity;
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeState.cpp

    r127837 r128132  
    3939    : m_changedProperties(0)
    4040    , m_wheelEventHandlerCount(0)
    41     , m_shouldUpdateScrollLayerPositionOnMainThreadReason(0)
     41    , m_shouldUpdateScrollLayerPositionOnMainThread(false)
    4242    , m_horizontalScrollElasticity(ScrollElasticityNone)
    4343    , m_verticalScrollElasticity(ScrollElasticityNone)
     
    8989}
    9090
    91 void ScrollingTreeState::setShouldUpdateScrollLayerPositionOnMainThreadReason(ReasonForUpdatingScrollLayerPositionOnMainThreadFlags reasons)
     91void ScrollingTreeState::setShouldUpdateScrollLayerPositionOnMainThread(bool shouldUpdateScrollLayerPositionOnMainThread)
    9292{
    93     if ((bool)m_shouldUpdateScrollLayerPositionOnMainThreadReason == (bool)reasons)
     93    if (m_shouldUpdateScrollLayerPositionOnMainThread == shouldUpdateScrollLayerPositionOnMainThread)
    9494        return;
    9595
    96     m_shouldUpdateScrollLayerPositionOnMainThreadReason = reasons;
    97     m_changedProperties |= ShouldUpdateScrollLayerPositionOnMainThreadReason;
     96    m_shouldUpdateScrollLayerPositionOnMainThread = shouldUpdateScrollLayerPositionOnMainThread;
     97    m_changedProperties |= ShouldUpdateScrollLayerPositionOnMainThread;
    9898}
    9999
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeState.h

    r127837 r128132  
    4141namespace WebCore {
    4242
    43 typedef unsigned ReasonForUpdatingScrollLayerPositionOnMainThreadFlags;
    44 
    4543// The ScrollingTreeState object keeps track of the current state of scrolling related properties.
    4644// Whenever any properties change, the scrolling coordinator will be informed and will update the state
     
    5755        NonFastScrollableRegion = 1 << 2,
    5856        WheelEventHandlerCount = 1 << 3,
    59         ShouldUpdateScrollLayerPositionOnMainThreadReason = 1 << 4,
     57        ShouldUpdateScrollLayerPositionOnMainThread = 1 << 4,
    6058        HorizontalScrollElasticity = 1 << 5,
    6159        VerticalScrollElasticity = 1 << 6,
     
    6765        ScrollLayer = 1 << 12,
    6866        RequestedScrollPosition = 1 << 13,
    69     };
    70 
    71     enum ReasonForUpdatingScrollLayerPositionOnMainThread {
    72         ForcedOnMainThread = 1 << 0,
    73         HasSlowRepaintObjects = 1 << 1,
    74         HasNonCompositedViewportConstrainedObjects = 1 << 2,
    75         HasNonLayerViewportConstrainedObjects = 1 << 3,
    76         IsImageDocument = 1 << 4
    7767    };
    7868
     
    9282    void setWheelEventHandlerCount(unsigned);
    9383
    94     ReasonForUpdatingScrollLayerPositionOnMainThreadFlags shouldUpdateScrollLayerPositionOnMainThreadReason() const { return m_shouldUpdateScrollLayerPositionOnMainThreadReason; }
    95     void setShouldUpdateScrollLayerPositionOnMainThreadReason(ReasonForUpdatingScrollLayerPositionOnMainThreadFlags);
     84    bool shouldUpdateScrollLayerPositionOnMainThread() const { return m_shouldUpdateScrollLayerPositionOnMainThread; }
     85    void setShouldUpdateScrollLayerPositionOnMainThread(bool);
    9686
    9787    ScrollElasticity horizontalScrollElasticity() const { return m_horizontalScrollElasticity; }
     
    137127    unsigned m_wheelEventHandlerCount;
    138128
    139     ReasonForUpdatingScrollLayerPositionOnMainThreadFlags m_shouldUpdateScrollLayerPositionOnMainThreadReason;
     129    bool m_shouldUpdateScrollLayerPositionOnMainThread;
    140130
    141131    ScrollElasticity m_horizontalScrollElasticity;
  • trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp

    r127952 r128132  
    224224}
    225225
    226 #if ENABLE(THREADED_SCROLLING)
    227 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThreadReason(ReasonForUpdatingScrollLayerPositionOnMainThreadFlags reasons)
     226void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool should)
    228227{
    229228    // We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves.
    230229    setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
    231230    if (m_private->scrollLayer())
    232         m_private->scrollLayer()->setShouldScrollOnMainThread(reasons);
    233 }
    234 #endif
     231        m_private->scrollLayer()->setShouldScrollOnMainThread(should);
     232}
    235233
    236234bool ScrollingCoordinator::supportsFixedPositionLayers() const
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeMac.mm

    r127837 r128132  
    6363    RetainPtr<CGColorRef> backgroundColor;
    6464
    65     if (m_rootNode->shouldUpdateScrollLayerPositionOnMainThreadReason())
     65    if (m_rootNode->shouldUpdateScrollLayerPositionOnMainThread())
    6666        backgroundColor = adoptCF(CGColorCreateGenericRGB(1, 0, 0, .7));
    6767
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm

    r127840 r128132  
    3838#include <wtf/CurrentTime.h>
    3939#include <wtf/Deque.h>
    40 #include <wtf/text/StringBuilder.h>
    41 #include <wtf/text/CString.h>
    4240
    4341namespace WebCore {
    44 
    45 static void logThreadedScrollingMode(unsigned reasonsForUpdatingScrollLayerPositionOnMainThread);
    4642
    4743PassOwnPtr<ScrollingTreeNode> ScrollingTreeNode::create(ScrollingTree* scrollingTree)
     
    7571        updateMainFramePinState(scrollPosition());
    7672
    77     if ((state->changedProperties() & ScrollingTreeState::ShouldUpdateScrollLayerPositionOnMainThreadReason)) {
    78         unsigned reasonsForUpdatingScrollLayerPositionOnMainThread = this->shouldUpdateScrollLayerPositionOnMainThreadReason();
    79 
    80         if (reasonsForUpdatingScrollLayerPositionOnMainThread) {
    81             // We're transitioning to the slow "update scroll layer position on the main thread" mode.
    82             // Initialize the probable main thread scroll position with the current scroll layer position.
    83             if (state->changedProperties() & ScrollingTreeState::RequestedScrollPosition)
    84                 m_probableMainThreadScrollPosition = state->requestedScrollPosition();
    85             else {
    86                 CGPoint scrollLayerPosition = m_scrollLayer.get().position;
    87                 m_probableMainThreadScrollPosition = IntPoint(-scrollLayerPosition.x, -scrollLayerPosition.y);
    88             }
     73    if ((state->changedProperties() & ScrollingTreeState::ShouldUpdateScrollLayerPositionOnMainThread) && shouldUpdateScrollLayerPositionOnMainThread()) {
     74        // We're transitioning to the slow "update scroll layer position on the main thread" mode.
     75        // Initialize the probable main thread scroll position with the current scroll layer position.
     76        if (state->changedProperties() & ScrollingTreeState::RequestedScrollPosition)
     77            m_probableMainThreadScrollPosition = state->requestedScrollPosition();
     78        else {
     79            CGPoint scrollLayerPosition = m_scrollLayer.get().position;
     80            m_probableMainThreadScrollPosition = IntPoint(-scrollLayerPosition.x, -scrollLayerPosition.y);
    8981        }
    90 
    91         if (scrollingTree()->scrollingPerformanceLoggingEnabled())
    92             logThreadedScrollingMode(reasonsForUpdatingScrollLayerPositionOnMainThread);
    9382    }
    9483}
     
    237226IntPoint ScrollingTreeNodeMac::scrollPosition() const
    238227{
    239     if (shouldUpdateScrollLayerPositionOnMainThreadReason())
     228    if (shouldUpdateScrollLayerPositionOnMainThread())
    240229        return m_probableMainThreadScrollPosition;
    241230
     
    252241    setScrollPositionWithoutContentEdgeConstraints(newScrollPosition);
    253242
    254     if (scrollingTree()->scrollingPerformanceLoggingEnabled())
     243    if (scrollingTree()->scrollingPeformanceLoggingEnabled())
    255244        logExposedUnfilledArea();
    256245}
     
    260249    updateMainFramePinState(scrollPosition);
    261250
    262     if (shouldUpdateScrollLayerPositionOnMainThreadReason()) {
     251    if (shouldUpdateScrollLayerPositionOnMainThread()) {
    263252        m_probableMainThreadScrollPosition = scrollPosition;
    264253        scrollingTree()->updateMainFrameScrollPositionAndScrollLayerPosition(scrollPosition);
     
    272261void ScrollingTreeNodeMac::setScrollLayerPosition(const IntPoint& position)
    273262{
    274     ASSERT(!shouldUpdateScrollLayerPositionOnMainThreadReason());
     263    ASSERT(!shouldUpdateScrollLayerPositionOnMainThread());
    275264    m_scrollLayer.get().position = CGPointMake(-position.x() + scrollOrigin().x(), -position.y() + scrollOrigin().y());
    276265}
     
    342331}
    343332
    344 static void logThreadedScrollingMode(unsigned reasonsForUpdatingScrollLayerPositionOnMainThread)
    345 {
    346     if (reasonsForUpdatingScrollLayerPositionOnMainThread) {
    347         StringBuilder reasonsDescription;
    348 
    349         if (reasonsForUpdatingScrollLayerPositionOnMainThread & ScrollingTreeState::ForcedOnMainThread)
    350             reasonsDescription.append("forced,");
    351         if (reasonsForUpdatingScrollLayerPositionOnMainThread & ScrollingTreeState::HasSlowRepaintObjects)
    352             reasonsDescription.append("slow-repaint objects,");
    353         if (reasonsForUpdatingScrollLayerPositionOnMainThread & ScrollingTreeState::HasNonCompositedViewportConstrainedObjects)
    354             reasonsDescription.append("viewport-constrained objects,");
    355         if (reasonsForUpdatingScrollLayerPositionOnMainThread & ScrollingTreeState::HasNonLayerViewportConstrainedObjects)
    356             reasonsDescription.append("non-layer viewport-constrained objects,");
    357         if (reasonsForUpdatingScrollLayerPositionOnMainThread & ScrollingTreeState::IsImageDocument)
    358             reasonsDescription.append("image document,");
    359 
    360         // Strip the trailing comma.
    361         String reasonsDescriptionTrimmed = reasonsDescription.toString().left(reasonsDescription.length() - 1);
    362 
    363         WTFLogAlways("SCROLLING: Switching to main-thread scrolling mode. Time: %f Reason(s): %s\n", WTF::monotonicallyIncreasingTime(), reasonsDescriptionTrimmed.ascii().data());
    364     } else
    365         WTFLogAlways("SCROLLING: Switching to threaded scrolling mode. Time: %f\n", WTF::monotonicallyIncreasingTime());
    366 }
    367 
    368333} // namespace WebCore
    369334
  • trunk/Source/WebKit2/ChangeLog

    r128129 r128132  
     12012-09-10  James Robinson  <jamesr@chromium.org>
     2
     3        Unreviewed, rolling out r127837.
     4        http://trac.webkit.org/changeset/127837
     5        https://bugs.webkit.org/show_bug.cgi?id=93898
     6
     7        Broke ScrollingCoordinator on chromium
     8
     9        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     10        (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
     11
    1122012-09-10  Jer Noble  <jer.noble@apple.com>
    213
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r127837 r128132  
    209209void TiledCoreAnimationDrawingArea::updatePreferences()
    210210{
    211     bool scrollingPerformanceLoggingEnabled = m_webPage->scrollingPerformanceLoggingEnabled();
    212     ScrollingThread::dispatch(bind(&ScrollingTree::setScrollingPerformanceLoggingEnabled, m_webPage->corePage()->scrollingCoordinator()->scrollingTree(), scrollingPerformanceLoggingEnabled));
    213 
    214211    bool showDebugBorders = m_webPage->corePage()->settings()->showDebugBorders();
    215212
     
    225222    }
    226223
     224    bool scrollingPerformanceLoggingEnabled = m_webPage->scrollingPerformanceLoggingEnabled();
     225
    227226    ScrollingThread::dispatch(bind(&ScrollingTree::setDebugRootLayer, m_webPage->corePage()->scrollingCoordinator()->scrollingTree(), m_debugInfoLayer));
     227    ScrollingThread::dispatch(bind(&ScrollingTree::setScrollingPerformanceLoggingEnabled, m_webPage->corePage()->scrollingCoordinator()->scrollingTree(), scrollingPerformanceLoggingEnabled));
    228228}
    229229
Note: See TracChangeset for help on using the changeset viewer.