Changeset 141704 in webkit


Ignore:
Timestamp:
Feb 2, 2013 1:04:52 PM (11 years ago)
Author:
Simon Fraser
Message:

Clean up the storage of dirty bits on nodes in the scrolling state tree
https://bugs.webkit.org/show_bug.cgi?id=108744

Reviewed by Sam Weinig.

ScrollingStateNode and its subclasses used different techniques for
tracking which properties changed. ScrollingStateNode tracked its layers
via a bool member and some layer-specific methods, but also had virtual
methods to allow subclasses to track properties via a bit mask.

Clean this up by having the base class store the bit mask, and use
enums to specify bits for the various properties. All properties are thus
tracked in the same way. Bits are read and written through non-virtual member
functions on ScrollingStateNode. All bit checking is done via hasChangedProperty().

  • page/scrolling/ScrollingStateFixedNode.cpp:

(WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode): m_changedProperties is now on the base class.
(WebCore::ScrollingStateFixedNode::updateConstraints): Use setPropertyChanged()

  • page/scrolling/ScrollingStateFixedNode.h: Remove overrides that are no longer needed.
  • page/scrolling/ScrollingStateNode.cpp:

(WebCore::ScrollingStateNode::ScrollingStateNode): Initialize m_changedProperties,
m_scrollLayerDidChange no longer tracked separately.
(WebCore::ScrollingStateNode::cloneAndReset):

  • page/scrolling/ScrollingStateNode.h:

(WebCore::ScrollingStateNode::hasChangedProperties):
(WebCore::ScrollingStateNode::hasChangedProperty): Tests the bit.
(WebCore::ScrollingStateNode::resetChangedProperties): Set all bits to 0.
(WebCore::ScrollingStateNode::setPropertyChanged): Set the bit.
(WebCore::ScrollingStateNode::changedProperties): Private to discourage incorrect usage
(changeProperties() & foo).

  • page/scrolling/ScrollingStateScrollingNode.cpp:

(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): Base class does the copying now.
(WebCore::ScrollingStateScrollingNode::setViewportRect): Use setPropertyChanged().
(WebCore::ScrollingStateScrollingNode::setContentsSize): Ditto.
(WebCore::ScrollingStateScrollingNode::setFrameScaleFactor): Etc.
(WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion):
(WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount):
(WebCore::ScrollingStateScrollingNode::setShouldUpdateScrollLayerPositionOnMainThread):
(WebCore::ScrollingStateScrollingNode::setHorizontalScrollElasticity):
(WebCore::ScrollingStateScrollingNode::setVerticalScrollElasticity):
(WebCore::ScrollingStateScrollingNode::setHasEnabledHorizontalScrollbar):
(WebCore::ScrollingStateScrollingNode::setHasEnabledVerticalScrollbar):
(WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarMode):
(WebCore::ScrollingStateScrollingNode::setVerticalScrollbarMode):
(WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition):
(WebCore::ScrollingStateScrollingNode::setScrollOrigin):

  • page/scrolling/ScrollingStateScrollingNode.h:

(ScrollingStateScrollingNode):

  • page/scrolling/ScrollingStateStickyNode.cpp:

(WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
(WebCore::ScrollingStateStickyNode::updateConstraints):

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

(WebCore::ScrollingTree::commitNewTreeState):

  • page/scrolling/ScrollingTreeScrollingNode.cpp:

(WebCore::ScrollingTreeScrollingNode::update):

  • page/scrolling/mac/ScrollingStateNodeMac.mm:

(WebCore::ScrollingStateNode::setScrollLayer):

  • page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:

(WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer):

  • page/scrolling/mac/ScrollingTreeFixedNode.mm:

(WebCore::ScrollingTreeFixedNode::update):

  • page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:

(WebCore::ScrollingTreeScrollingNodeMac::update):

  • page/scrolling/mac/ScrollingTreeStickyNode.mm:

(WebCore::ScrollingTreeStickyNode::update):

Location:
trunk/Source/WebCore
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141703 r141704  
     12013-02-02  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Clean up the storage of dirty bits on nodes in the scrolling state tree
     4        https://bugs.webkit.org/show_bug.cgi?id=108744
     5
     6        Reviewed by Sam Weinig.
     7
     8        ScrollingStateNode and its subclasses used different techniques for
     9        tracking which properties changed. ScrollingStateNode tracked its layers
     10        via a bool member and some layer-specific methods, but also had virtual
     11        methods to allow subclasses to track properties via a bit mask.
     12       
     13        Clean this up by having the base class store the bit mask, and use
     14        enums to specify bits for the various properties. All properties are thus
     15        tracked in the same way. Bits are read and written through non-virtual member
     16        functions on ScrollingStateNode. All bit checking is done via hasChangedProperty().
     17
     18        * page/scrolling/ScrollingStateFixedNode.cpp:
     19        (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode): m_changedProperties is now on the base class.
     20        (WebCore::ScrollingStateFixedNode::updateConstraints): Use setPropertyChanged()
     21        * page/scrolling/ScrollingStateFixedNode.h: Remove overrides that are no longer needed.
     22        * page/scrolling/ScrollingStateNode.cpp:
     23        (WebCore::ScrollingStateNode::ScrollingStateNode): Initialize m_changedProperties,
     24        m_scrollLayerDidChange no longer tracked separately.
     25        (WebCore::ScrollingStateNode::cloneAndReset):
     26        * page/scrolling/ScrollingStateNode.h:
     27        (WebCore::ScrollingStateNode::hasChangedProperties):
     28        (WebCore::ScrollingStateNode::hasChangedProperty): Tests the bit.
     29        (WebCore::ScrollingStateNode::resetChangedProperties): Set all bits to 0.
     30        (WebCore::ScrollingStateNode::setPropertyChanged): Set the bit.
     31        (WebCore::ScrollingStateNode::changedProperties): Private to discourage incorrect usage
     32        (changeProperties() & foo).
     33        * page/scrolling/ScrollingStateScrollingNode.cpp:
     34        (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): Base class does the copying now.
     35        (WebCore::ScrollingStateScrollingNode::setViewportRect): Use setPropertyChanged().
     36        (WebCore::ScrollingStateScrollingNode::setContentsSize): Ditto.
     37        (WebCore::ScrollingStateScrollingNode::setFrameScaleFactor): Etc.
     38        (WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion):
     39        (WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount):
     40        (WebCore::ScrollingStateScrollingNode::setShouldUpdateScrollLayerPositionOnMainThread):
     41        (WebCore::ScrollingStateScrollingNode::setHorizontalScrollElasticity):
     42        (WebCore::ScrollingStateScrollingNode::setVerticalScrollElasticity):
     43        (WebCore::ScrollingStateScrollingNode::setHasEnabledHorizontalScrollbar):
     44        (WebCore::ScrollingStateScrollingNode::setHasEnabledVerticalScrollbar):
     45        (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarMode):
     46        (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarMode):
     47        (WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition):
     48        (WebCore::ScrollingStateScrollingNode::setScrollOrigin):
     49        * page/scrolling/ScrollingStateScrollingNode.h:
     50        (ScrollingStateScrollingNode):
     51        * page/scrolling/ScrollingStateStickyNode.cpp:
     52        (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
     53        (WebCore::ScrollingStateStickyNode::updateConstraints):
     54        * page/scrolling/ScrollingStateStickyNode.h:
     55        * page/scrolling/ScrollingTree.cpp:
     56        (WebCore::ScrollingTree::commitNewTreeState):
     57        * page/scrolling/ScrollingTreeScrollingNode.cpp:
     58        (WebCore::ScrollingTreeScrollingNode::update):
     59        * page/scrolling/mac/ScrollingStateNodeMac.mm:
     60        (WebCore::ScrollingStateNode::setScrollLayer):
     61        * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
     62        (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer):
     63        * page/scrolling/mac/ScrollingTreeFixedNode.mm:
     64        (WebCore::ScrollingTreeFixedNode::update):
     65        * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
     66        (WebCore::ScrollingTreeScrollingNodeMac::update):
     67        * page/scrolling/mac/ScrollingTreeStickyNode.mm:
     68        (WebCore::ScrollingTreeStickyNode::update):
     69
    1702013-02-02  Simon Fraser  <simon.fraser@apple.com>
    271
  • trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp

    r138076 r141704  
    4343ScrollingStateFixedNode::ScrollingStateFixedNode(ScrollingStateTree* tree, ScrollingNodeID nodeID)
    4444    : ScrollingStateNode(tree, nodeID)
    45     , m_changedProperties(0)
    4645{
    4746}
     
    5049    : ScrollingStateNode(node)
    5150    , m_constraints(FixedPositionViewportConstraints(node.viewportConstraints()))
    52     , m_changedProperties(node.changedProperties())
    5351{
    5452}
     
    6967
    7068    m_constraints = constraints;
    71     m_changedProperties = ViewportConstraints;
     69    setPropertyChanged(ViewportConstraints);
    7270    m_scrollingStateTree->setHasChangedProperties(true);
    7371}
  • trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h

    r141516 r141704  
    4646    virtual ~ScrollingStateFixedNode();
    4747
    48     enum ChangedPropertyForFixed {
    49         ViewportConstraints = 1 << 0
     48    enum {
     49        ViewportConstraints = NumStateNodeBits
    5050    };
    51 
    52     virtual unsigned changedProperties() const OVERRIDE { return m_changedProperties; }
    5351
    5452    void updateConstraints(const FixedPositionViewportConstraints&);
     
    6159    virtual bool isFixedNode() OVERRIDE { return true; }
    6260
    63     virtual bool hasChangedProperties() const OVERRIDE { return m_changedProperties; }
    64     virtual void resetChangedProperties() OVERRIDE { m_changedProperties = 0; }
    6561    virtual void syncLayerPositionForViewportRect(const LayoutRect& viewportRect) OVERRIDE;
    6662
     
    6864
    6965    FixedPositionViewportConstraints m_constraints;
    70     unsigned m_changedProperties;
    7166};
    7267
  • trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp

    r140223 r141704  
    4040    : m_scrollingStateTree(scrollingStateTree)
    4141    , m_nodeID(nodeID)
     42    , m_changedProperties(0)
    4243    , m_parent(0)
    43     , m_scrollLayerDidChange(false)
    4444{
    4545}
     
    5151    : m_scrollingStateTree(0)
    5252    , m_nodeID(stateNode.scrollingNodeID())
     53    , m_changedProperties(stateNode.changedProperties())
    5354    , m_parent(0)
    54     , m_scrollLayerDidChange(stateNode.scrollLayerDidChange())
    5555{
    5656    // FIXME: why doesn't this set the GraphicsLayer?
     
    6767
    6868    // Now that this node is cloned, reset our change properties.
    69     setScrollLayerDidChange(false);
    7069    resetChangedProperties();
    7170
  • trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h

    r140223 r141704  
    5858    void cloneAndResetChildren(ScrollingStateNode*);
    5959
    60     virtual bool hasChangedProperties() const = 0;
    61     virtual unsigned changedProperties() const = 0;
    62     virtual void resetChangedProperties() = 0;
    63     virtual void setHasChangedProperties() { setScrollLayerDidChange(true); }
     60    enum {
     61        ScrollLayer = 0,
     62        NumStateNodeBits = 1
     63    };
     64    typedef unsigned ChangedProperties;
     65
     66    bool hasChangedProperties() const { return m_changedProperties; }
     67    bool hasChangedProperty(unsigned propertyBit) { return m_changedProperties & (1 << propertyBit); }
     68    void resetChangedProperties() { m_changedProperties = 0; }
     69    void setPropertyChanged(unsigned propertyBit) { m_changedProperties |= (1 << propertyBit); }
    6470
    6571    virtual void syncLayerPositionForViewportRect(const LayoutRect& /*viewportRect*/) { }
     
    6975    void setScrollLayer(GraphicsLayer*);
    7076    void setScrollPlatformLayer(PlatformLayer*);
    71 
    72     bool scrollLayerDidChange() const { return m_scrollLayerDidChange; }
    73     void setScrollLayerDidChange(bool scrollLayerDidChange) { m_scrollLayerDidChange = scrollLayerDidChange; }
    7477
    7578    ScrollingStateTree* scrollingStateTree() const { return m_scrollingStateTree; }
     
    99102
    100103    virtual void dumpProperties(TextStream&, int indent) const = 0;
     104    ChangedProperties changedProperties() const { return m_changedProperties; }
    101105
    102106    ScrollingNodeID m_nodeID;
     107    ChangedProperties m_changedProperties;
    103108
    104109    ScrollingStateNode* m_parent;
    105110    OwnPtr<Vector<OwnPtr<ScrollingStateNode> > > m_children;
    106 
    107     bool m_scrollLayerDidChange;
    108111
    109112#if PLATFORM(MAC)
  • trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp

    r140223 r141704  
    4242ScrollingStateScrollingNode::ScrollingStateScrollingNode(ScrollingStateTree* stateTree, ScrollingNodeID nodeID)
    4343    : ScrollingStateNode(stateTree, nodeID)
    44     , m_changedProperties(0)
    4544    , m_counterScrollingLayer(0)
    4645    , m_frameScaleFactor(1)
     
    5251    , m_hasEnabledVerticalScrollbar(false)
    5352    , m_requestedScrollPositionRepresentsProgrammaticScroll(false)
    54     , m_counterScrollingLayerDidChange(false)
    5553    , m_horizontalScrollbarMode(ScrollbarAuto)
    5654    , m_verticalScrollbarMode(ScrollbarAuto)
     
    6058ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScrollingNode& stateNode)
    6159    : ScrollingStateNode(stateNode)
    62     , m_changedProperties(stateNode.changedProperties())
    6360    , m_viewportRect(stateNode.viewportRect())
    6461    , m_contentsSize(stateNode.contentsSize())
     
    7269    , m_hasEnabledVerticalScrollbar(stateNode.hasEnabledVerticalScrollbar())
    7370    , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
    74     , m_counterScrollingLayerDidChange(stateNode.counterScrollingLayerDidChange())
    7571    , m_horizontalScrollbarMode(stateNode.horizontalScrollbarMode())
    7672    , m_verticalScrollbarMode(stateNode.verticalScrollbarMode())
     
    9692
    9793    m_viewportRect = viewportRect;
    98     m_changedProperties |= ViewportRect;
     94    setPropertyChanged(ViewportRect);
    9995    m_scrollingStateTree->setHasChangedProperties(true);
    10096}
     
    106102
    107103    m_contentsSize = contentsSize;
    108     m_changedProperties |= ContentsSize;
     104    setPropertyChanged(ContentsSize);
    109105    m_scrollingStateTree->setHasChangedProperties(true);
    110106}
     
    117113    m_frameScaleFactor = scaleFactor;
    118114
    119     m_changedProperties |= FrameScaleFactor;
     115    setPropertyChanged(FrameScaleFactor);
    120116    m_scrollingStateTree->setHasChangedProperties(true);
    121117}
     
    127123
    128124    m_nonFastScrollableRegion = nonFastScrollableRegion;
    129     m_changedProperties |= NonFastScrollableRegion;
     125    setPropertyChanged(NonFastScrollableRegion);
    130126    m_scrollingStateTree->setHasChangedProperties(true);
    131127}
     
    137133
    138134    m_wheelEventHandlerCount = wheelEventHandlerCount;
    139     m_changedProperties |= WheelEventHandlerCount;
     135    setPropertyChanged(WheelEventHandlerCount);
    140136    m_scrollingStateTree->setHasChangedProperties(true);
    141137}
     
    147143
    148144    m_shouldUpdateScrollLayerPositionOnMainThread = reasons;
    149     m_changedProperties |= ShouldUpdateScrollLayerPositionOnMainThread;
     145    setPropertyChanged(ShouldUpdateScrollLayerPositionOnMainThread);
    150146    m_scrollingStateTree->setHasChangedProperties(true);
    151147}
     
    157153
    158154    m_horizontalScrollElasticity = horizontalScrollElasticity;
    159     m_changedProperties |= HorizontalScrollElasticity;
     155    setPropertyChanged(HorizontalScrollElasticity);
    160156    m_scrollingStateTree->setHasChangedProperties(true);
    161157}
     
    167163
    168164    m_verticalScrollElasticity = verticalScrollElasticity;
    169     m_changedProperties |= VerticalScrollElasticity;
     165    setPropertyChanged(VerticalScrollElasticity);
    170166    m_scrollingStateTree->setHasChangedProperties(true);
    171167}
     
    177173
    178174    m_hasEnabledHorizontalScrollbar = hasEnabledHorizontalScrollbar;
    179     m_changedProperties |= HasEnabledHorizontalScrollbar;
     175    setPropertyChanged(HasEnabledHorizontalScrollbar);
    180176    m_scrollingStateTree->setHasChangedProperties(true);
    181177}
     
    187183
    188184    m_hasEnabledVerticalScrollbar = hasEnabledVerticalScrollbar;
    189     m_changedProperties |= HasEnabledVerticalScrollbar;
     185    setPropertyChanged(HasEnabledVerticalScrollbar);
    190186    m_scrollingStateTree->setHasChangedProperties(true);
    191187}
     
    197193
    198194    m_horizontalScrollbarMode = horizontalScrollbarMode;
    199     m_changedProperties |= HorizontalScrollbarMode;
     195    setPropertyChanged(HorizontalScrollbarMode);
    200196    m_scrollingStateTree->setHasChangedProperties(true);
    201197}
     
    207203
    208204    m_verticalScrollbarMode = verticalScrollbarMode;
    209     m_changedProperties |= VerticalScrollbarMode;
     205    setPropertyChanged(VerticalScrollbarMode);
    210206    m_scrollingStateTree->setHasChangedProperties(true);
    211207}
     
    215211    m_requestedScrollPosition = requestedScrollPosition;
    216212    m_requestedScrollPositionRepresentsProgrammaticScroll = representsProgrammaticScroll;
    217     m_changedProperties |= RequestedScrollPosition;
     213    setPropertyChanged(RequestedScrollPosition);
    218214    m_scrollingStateTree->setHasChangedProperties(true);
    219215}
     
    225221
    226222    m_scrollOrigin = scrollOrigin;
    227     m_changedProperties |= ScrollOrigin;
     223    setPropertyChanged(ScrollOrigin);
    228224    m_scrollingStateTree->setHasChangedProperties(true);
    229225}
  • trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h

    r141516 r141704  
    4747
    4848    enum ChangedProperty {
    49         ViewportRect = 1 << 0,
    50         ContentsSize = 1 << 1,
    51         FrameScaleFactor = 1 << 2,
    52         NonFastScrollableRegion = 1 << 3,
    53         WheelEventHandlerCount = 1 << 4,
    54         ShouldUpdateScrollLayerPositionOnMainThread = 1 << 5,
    55         HorizontalScrollElasticity = 1 << 6,
    56         VerticalScrollElasticity = 1 << 7,
    57         HasEnabledHorizontalScrollbar = 1 << 8,
    58         HasEnabledVerticalScrollbar = 1 << 9,
    59         HorizontalScrollbarMode = 1 << 10,
    60         VerticalScrollbarMode = 1 << 11,
    61         ScrollOrigin = 1 << 12,
    62         RequestedScrollPosition = 1 << 13,
    63         CounterScrollingLayer = 1 << 14,
     49        ViewportRect = NumStateNodeBits,
     50        ContentsSize,
     51        FrameScaleFactor,
     52        NonFastScrollableRegion,
     53        WheelEventHandlerCount,
     54        ShouldUpdateScrollLayerPositionOnMainThread,
     55        HorizontalScrollElasticity,
     56        VerticalScrollElasticity,
     57        HasEnabledHorizontalScrollbar,
     58        HasEnabledVerticalScrollbar,
     59        HorizontalScrollbarMode,
     60        VerticalScrollbarMode,
     61        ScrollOrigin,
     62        RequestedScrollPosition,
     63        CounterScrollingLayer
    6464    };
    6565
    6666    virtual bool isScrollingNode() OVERRIDE { return true; }
    67 
    68     virtual bool hasChangedProperties() const OVERRIDE { return m_changedProperties; }
    69     virtual unsigned changedProperties() const OVERRIDE { return m_changedProperties; }
    70     virtual void resetChangedProperties() OVERRIDE { m_changedProperties = 0; }
    7167
    7268    const IntRect& viewportRect() const { return m_viewportRect; }
     
    117113    PlatformLayer* counterScrollingPlatformLayer() const;
    118114
    119     bool counterScrollingLayerDidChange() const { return m_counterScrollingLayerDidChange; }
    120 
    121115    bool requestedScrollPositionRepresentsProgrammaticScroll() const { return m_requestedScrollPositionRepresentsProgrammaticScroll; }
    122116
     
    126120    ScrollingStateScrollingNode(ScrollingStateTree*, ScrollingNodeID);
    127121    ScrollingStateScrollingNode(const ScrollingStateScrollingNode&);
    128 
    129     unsigned m_changedProperties;
    130122
    131123    GraphicsLayer* m_counterScrollingLayer;
     
    151143    bool m_hasEnabledVerticalScrollbar;
    152144    bool m_requestedScrollPositionRepresentsProgrammaticScroll;
    153     bool m_counterScrollingLayerDidChange;
    154145
    155146    ScrollbarMode m_horizontalScrollbarMode;
  • trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp

    r138076 r141704  
    4343ScrollingStateStickyNode::ScrollingStateStickyNode(ScrollingStateTree* tree, ScrollingNodeID nodeID)
    4444    : ScrollingStateNode(tree, nodeID)
    45     , m_changedProperties(0)
    4645{
    4746}
     
    5049    : ScrollingStateNode(node)
    5150    , m_constraints(StickyPositionViewportConstraints(node.viewportConstraints()))
    52     , m_changedProperties(node.changedProperties())
    5351{
    5452}
     
    6967
    7068    m_constraints = constraints;
    71     m_changedProperties = ViewportConstraints;
     69    setPropertyChanged(ViewportConstraints);
    7270    m_scrollingStateTree->setHasChangedProperties(true);
    7371}
  • trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h

    r141516 r141704  
    4646    virtual ~ScrollingStateStickyNode();
    4747
    48     enum ChangedPropertyForSticky {
    49         ViewportConstraints = 1 << 0
     48    enum {
     49        ViewportConstraints = NumStateNodeBits
    5050    };
    51 
    52     virtual unsigned changedProperties() const OVERRIDE { return m_changedProperties; }
    5351
    5452    void updateConstraints(const StickyPositionViewportConstraints&);
     
    6159    virtual bool isStickyNode() OVERRIDE { return true; }
    6260
    63     virtual bool hasChangedProperties() const OVERRIDE { return m_changedProperties; }
    64     virtual void resetChangedProperties() OVERRIDE { m_changedProperties = 0; }
    6561    virtual void syncLayerPositionForViewportRect(const LayoutRect& viewportRect) OVERRIDE;
    6662
     
    6864
    6965    StickyPositionViewportConstraints m_constraints;
    70     unsigned m_changedProperties;
    7166};
    7267
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r141703 r141704  
    128128    ASSERT(ScrollingThread::isCurrentThread());
    129129
    130     if (scrollingStateTree->rootStateNode()->changedProperties() & (ScrollingStateScrollingNode::WheelEventHandlerCount | ScrollingStateScrollingNode::NonFastScrollableRegion) || scrollingStateTree->rootStateNode()->scrollLayerDidChange()) {
     130    ScrollingStateScrollingNode* rootNode = scrollingStateTree->rootStateNode();
     131    if (rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount) || rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion) || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) {
    131132        MutexLocker lock(m_mutex);
    132133
    133         if (scrollingStateTree->rootStateNode()->scrollLayerDidChange())
     134        if (rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
    134135            m_mainFrameScrollPosition = IntPoint();
    135         if (scrollingStateTree->rootStateNode()->changedProperties() & ScrollingStateScrollingNode::WheelEventHandlerCount)
     136        if (rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount))
    136137            m_hasWheelEventHandlers = scrollingStateTree->rootStateNode()->wheelEventHandlerCount();
    137         if (scrollingStateTree->rootStateNode()->changedProperties() & ScrollingStateScrollingNode::NonFastScrollableRegion)
     138        if (rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion))
    138139            m_nonFastScrollableRegion = scrollingStateTree->rootStateNode()->nonFastScrollableRegion();
    139140    }
    140141   
    141     TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollingStateTree->rootStateNode()->requestedScrollPositionRepresentsProgrammaticScroll());
     142    TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, rootNode->requestedScrollPositionRepresentsProgrammaticScroll());
    142143
    143144    removeDestroyedNodes(scrollingStateTree.get());
    144     updateTreeFromStateNode(scrollingStateTree->rootStateNode());
     145    updateTreeFromStateNode(rootNode);
    145146}
    146147
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp

    r141703 r141704  
    5454    ScrollingStateScrollingNode* state = toScrollingStateScrollingNode(stateNode);
    5555
    56     if (state->changedProperties() & ScrollingStateScrollingNode::ViewportRect)
     56    if (state->hasChangedProperty(ScrollingStateScrollingNode::ViewportRect))
    5757        m_viewportRect = state->viewportRect();
    5858
    59     if (state->changedProperties() & ScrollingStateScrollingNode::ContentsSize)
     59    if (state->hasChangedProperty(ScrollingStateScrollingNode::ContentsSize))
    6060        m_contentsSize = state->contentsSize();
    6161
    62     if (state->changedProperties() & ScrollingStateScrollingNode::FrameScaleFactor)
     62    if (state->hasChangedProperty(ScrollingStateScrollingNode::FrameScaleFactor))
    6363        m_frameScaleFactor = state->frameScaleFactor();
    6464
    65     if (state->changedProperties() & ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)
     65    if (state->hasChangedProperty(ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread))
    6666        m_shouldUpdateScrollLayerPositionOnMainThread = state->shouldUpdateScrollLayerPositionOnMainThread();
    6767
    68     if (state->changedProperties() & ScrollingStateScrollingNode::HorizontalScrollElasticity)
     68    if (state->hasChangedProperty(ScrollingStateScrollingNode::HorizontalScrollElasticity))
    6969        m_horizontalScrollElasticity = state->horizontalScrollElasticity();
    7070
    71     if (state->changedProperties() & ScrollingStateScrollingNode::VerticalScrollElasticity)
     71    if (state->hasChangedProperty(ScrollingStateScrollingNode::VerticalScrollElasticity))
    7272        m_verticalScrollElasticity = state->verticalScrollElasticity();
    7373
    74     if (state->changedProperties() & ScrollingStateScrollingNode::HasEnabledHorizontalScrollbar)
     74    if (state->hasChangedProperty(ScrollingStateScrollingNode::HasEnabledHorizontalScrollbar))
    7575        m_hasEnabledHorizontalScrollbar = state->hasEnabledHorizontalScrollbar();
    7676
    77     if (state->changedProperties() & ScrollingStateScrollingNode::HasEnabledVerticalScrollbar)
     77    if (state->hasChangedProperty(ScrollingStateScrollingNode::HasEnabledVerticalScrollbar))
    7878        m_hasEnabledVerticalScrollbar = state->hasEnabledVerticalScrollbar();
    7979
    80     if (state->changedProperties() & ScrollingStateScrollingNode::HorizontalScrollbarMode)
     80    if (state->hasChangedProperty(ScrollingStateScrollingNode::HorizontalScrollbarMode))
    8181        m_horizontalScrollbarMode = state->horizontalScrollbarMode();
    8282
    83     if (state->changedProperties() & ScrollingStateScrollingNode::VerticalScrollbarMode)
     83    if (state->hasChangedProperty(ScrollingStateScrollingNode::VerticalScrollbarMode))
    8484        m_verticalScrollbarMode = state->verticalScrollbarMode();
    8585
    86     if (state->changedProperties() & ScrollingStateScrollingNode::ScrollOrigin)
     86    if (state->hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin))
    8787        m_scrollOrigin = state->scrollOrigin();
    8888}
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingStateNodeMac.mm

    r140223 r141704  
    5454    m_graphicsLayer = graphicsLayer;
    5555
    56     m_scrollLayerDidChange = true;
     56    setPropertyChanged(ScrollLayer);
    5757    m_scrollingStateTree->setHasChangedProperties(true);
    5858}
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm

    r140223 r141704  
    4848    m_counterScrollingLayer = graphicsLayer;
    4949
    50     m_counterScrollingLayerDidChange = true;
     50    setPropertyChanged(CounterScrollingLayer);
    5151    if (m_scrollingStateTree)
    5252        m_scrollingStateTree->setHasChangedProperties(true);
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm

    r141703 r141704  
    5050void ScrollingTreeFixedNode::update(ScrollingStateNode* stateNode)
    5151{
    52     ScrollingStateFixedNode* state = toScrollingStateFixedNode(stateNode);
     52    ScrollingStateFixedNode* fixedStateNode = toScrollingStateFixedNode(stateNode);
    5353
    54     if (state->scrollLayerDidChange())
    55         m_layer = state->platformScrollLayer();
     54    if (fixedStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
     55        m_layer = fixedStateNode->platformScrollLayer();
    5656
    57     if (stateNode->changedProperties() & ScrollingStateFixedNode::ViewportConstraints)
    58         m_constraints = state->viewportConstraints();
     57    if (stateNode->hasChangedProperty(ScrollingStateFixedNode::ViewportConstraints))
     58        m_constraints = fixedStateNode->viewportConstraints();
    5959}
    6060
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm

    r141703 r141704  
    6969{
    7070    ScrollingTreeScrollingNode::update(stateNode);
    71     ScrollingStateScrollingNode* state = toScrollingStateScrollingNode(stateNode);
    72 
    73     if (state->scrollLayerDidChange())
    74         m_scrollLayer = state->platformScrollLayer();
    75 
    76     if (state->counterScrollingLayerDidChange())
    77         m_counterScrollingLayer = state->counterScrollingPlatformLayer();
    78 
    79     if (state->changedProperties() & ScrollingStateScrollingNode::RequestedScrollPosition)
    80         setScrollPosition(state->requestedScrollPosition());
    81 
    82     if (state->scrollLayerDidChange() || state->changedProperties() & (ScrollingStateScrollingNode::ContentsSize | ScrollingStateScrollingNode::ViewportRect))
     71    ScrollingStateScrollingNode* scrollingStateNode = toScrollingStateScrollingNode(stateNode);
     72
     73    if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
     74        m_scrollLayer = scrollingStateNode->platformScrollLayer();
     75
     76    if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
     77        m_counterScrollingLayer = scrollingStateNode->counterScrollingPlatformLayer();
     78
     79    if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
     80        setScrollPosition(scrollingStateNode->requestedScrollPosition());
     81
     82    if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer) || scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ContentsSize) || scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ViewportRect))
    8383        updateMainFramePinState(scrollPosition());
    8484
    85     if ((state->changedProperties() & ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)) {
     85    if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)) {
    8686        unsigned mainThreadScrollingReasons = this->shouldUpdateScrollLayerPositionOnMainThread();
    8787
     
    8989            // We're transitioning to the slow "update scroll layer position on the main thread" mode.
    9090            // Initialize the probable main thread scroll position with the current scroll layer position.
    91             if (state->changedProperties() & ScrollingStateScrollingNode::RequestedScrollPosition)
    92                 m_probableMainThreadScrollPosition = state->requestedScrollPosition();
     91            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
     92                m_probableMainThreadScrollPosition = scrollingStateNode->requestedScrollPosition();
    9393            else {
    9494                CGPoint scrollLayerPosition = m_scrollLayer.get().position;
     
    101101    }
    102102
    103     if ((state->changedProperties() & ScrollingStateScrollingNode::WheelEventHandlerCount)) {
     103    if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount)) {
    104104        if (scrollingTree()->scrollingPerformanceLoggingEnabled())
    105             logWheelEventHandlerCountChanged(state->wheelEventHandlerCount());
     105            logWheelEventHandlerCountChanged(scrollingStateNode->wheelEventHandlerCount());
    106106    }
    107107}
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm

    r141703 r141704  
    5050void ScrollingTreeStickyNode::update(ScrollingStateNode* stateNode)
    5151{
    52     ScrollingStateStickyNode* state = toScrollingStateStickyNode(stateNode);
     52    ScrollingStateStickyNode* stickyStateNode = toScrollingStateStickyNode(stateNode);
    5353
    54     if (state->scrollLayerDidChange())
    55         m_layer = state->platformScrollLayer();
     54    if (stickyStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
     55        m_layer = stickyStateNode->platformScrollLayer();
    5656
    57     if (stateNode->changedProperties() & ScrollingStateStickyNode::ViewportConstraints)
    58         m_constraints = state->viewportConstraints();
     57    if (stateNode->hasChangedProperty(ScrollingStateStickyNode::ViewportConstraints))
     58        m_constraints = stickyStateNode->viewportConstraints();
    5959}
    6060
Note: See TracChangeset for help on using the changeset viewer.