Changeset 131221 in webkit
- Timestamp:
- Oct 12, 2012 1:50:36 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r131220 r131221 1 2012-10-12 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=99204 4 ScrollingStateNodes should keep track of their IDs 5 6 Reviewed by Simon Fraser. 7 8 There is a HashMap in ScrollingCoordinatorMac that maps 9 ScrollingNodeIDs to ScrollingStateNodes. The nodes themselves should 10 keep track of this id. Then the id can be used to make sure 11 ScrollingStateNodes remove themselves from the HashMap when they are 12 destroyed, and it will also be useful for associating 13 ScrollingStateNodes with ScrollingTreeNodes over on the scrolling 14 thread. 15 16 This patch only has the ScrollingStateNodes cache the id. I will 17 actually make use of the id in follow-up patches. 18 19 * page/scrolling/ScrollingStateNode.cpp: 20 (WebCore::ScrollingStateNode::ScrollingStateNode): 21 * page/scrolling/ScrollingStateNode.h: 22 (ScrollingStateNode): 23 (WebCore::ScrollingStateNode::scrollingNodeID): 24 * page/scrolling/ScrollingStateScrollingNode.cpp: 25 (WebCore::ScrollingStateScrollingNode::create): 26 (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): 27 * page/scrolling/ScrollingStateScrollingNode.h: 28 (ScrollingStateScrollingNode): 29 * page/scrolling/mac/ScrollingCoordinatorMac.mm: 30 (WebCore::ScrollingCoordinatorMac::attachToStateTree): 31 1 32 2012-10-01 Jer Noble <jer.noble@apple.com> 2 33 -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp
r131112 r131221 33 33 namespace WebCore { 34 34 35 ScrollingStateNode::ScrollingStateNode(ScrollingStateTree* scrollingStateTree )35 ScrollingStateNode::ScrollingStateNode(ScrollingStateTree* scrollingStateTree, ScrollingNodeID nodeID) 36 36 : m_scrollingStateTree(scrollingStateTree) 37 , m_nodeID(nodeID) 37 38 , m_parent(0) 38 39 , m_scrollLayerDidChange(false) … … 45 46 ScrollingStateNode::ScrollingStateNode(ScrollingStateNode* stateNode) 46 47 : m_scrollingStateTree(0) 48 , m_nodeID(stateNode->scrollingNodeID()) 47 49 , m_parent(0) 48 50 , m_scrollLayerDidChange(stateNode->scrollLayerDidChange()) -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h
r131112 r131221 30 30 31 31 #include "GraphicsLayer.h" 32 #include "ScrollingCoordinator.h" 32 33 #include <wtf/OwnPtr.h> 33 34 #include <wtf/PassOwnPtr.h> … … 46 47 47 48 public: 48 ScrollingStateNode(ScrollingStateTree* );49 ScrollingStateNode(ScrollingStateTree*, ScrollingNodeID); 49 50 virtual ~ScrollingStateNode(); 50 51 … … 69 70 void setScrollingStateTree(ScrollingStateTree* tree) { m_scrollingStateTree = tree; } 70 71 72 ScrollingNodeID scrollingNodeID() const { return m_nodeID; } 73 71 74 ScrollingStateNode* parent() const { return m_parent; } 72 75 void setParent(ScrollingStateNode* parent) { m_parent = parent; } … … 82 85 83 86 private: 87 ScrollingNodeID m_nodeID; 88 84 89 ScrollingStateNode* m_parent; 85 86 90 OwnPtr<Vector<OwnPtr<ScrollingStateNode> > > m_children; 87 91 -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
r130989 r131221 34 34 namespace WebCore { 35 35 36 PassOwnPtr<ScrollingStateScrollingNode> ScrollingStateScrollingNode::create(ScrollingStateTree* stateTree )37 { 38 return adoptPtr(new ScrollingStateScrollingNode(stateTree ));39 } 40 41 ScrollingStateScrollingNode::ScrollingStateScrollingNode(ScrollingStateTree* stateTree )42 : ScrollingStateNode(stateTree )36 PassOwnPtr<ScrollingStateScrollingNode> ScrollingStateScrollingNode::create(ScrollingStateTree* stateTree, ScrollingNodeID nodeID) 37 { 38 return adoptPtr(new ScrollingStateScrollingNode(stateTree, nodeID)); 39 } 40 41 ScrollingStateScrollingNode::ScrollingStateScrollingNode(ScrollingStateTree* stateTree, ScrollingNodeID nodeID) 42 : ScrollingStateNode(stateTree, nodeID) 43 43 , m_changedProperties(0) 44 44 , m_wheelEventHandlerCount(0) -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
r130989 r131221 40 40 class ScrollingStateScrollingNode : public ScrollingStateNode { 41 41 public: 42 static PassOwnPtr<ScrollingStateScrollingNode> create(ScrollingStateTree* );42 static PassOwnPtr<ScrollingStateScrollingNode> create(ScrollingStateTree*, ScrollingNodeID); 43 43 virtual ~ScrollingStateScrollingNode(); 44 44 … … 111 111 112 112 private: 113 ScrollingStateScrollingNode(ScrollingStateTree* );113 ScrollingStateScrollingNode(ScrollingStateTree*, ScrollingNodeID); 114 114 ScrollingStateScrollingNode(ScrollingStateScrollingNode*); 115 115 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
r131137 r131221 248 248 // append the node in the appropriate spot in the state tree. For now we always assume 249 249 // this is the root node. 250 m_scrollingStateTree->setRootStateNode(ScrollingStateScrollingNode::create(m_scrollingStateTree.get() ));250 m_scrollingStateTree->setRootStateNode(ScrollingStateScrollingNode::create(m_scrollingStateTree.get(), scrollLayerID)); 251 251 m_stateNodeMap.set(scrollLayerID, m_scrollingStateTree->rootStateNode()); 252 252 return scrollLayerID;
Note: See TracChangeset
for help on using the changeset viewer.