Changeset 148197 in webkit
- Timestamp:
- Apr 11, 2013 6:16:20 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r147921 r148197 1823 1823 page/scrolling/ScrollingConstraints.cpp 1824 1824 page/scrolling/ScrollingCoordinator.cpp 1825 page/scrolling/ScrollingStateFixedNode.cpp 1826 page/scrolling/ScrollingStateNode.cpp 1827 page/scrolling/ScrollingStateScrollingNode.cpp 1828 page/scrolling/ScrollingStateStickyNode.cpp 1829 page/scrolling/ScrollingStateTree.cpp 1825 1830 page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp 1831 page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp 1832 page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp 1826 1833 1827 1834 platform/Arena.cpp -
trunk/Source/WebCore/ChangeLog
r148195 r148197 1 2013-04-11 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 3 [CoordinatedGraphics] Use ScrollingStateTree to handle fixed elements positioning while scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=114353 5 6 Reviewed by Noam Rosenthal. 7 8 ScrollingCoordinatorCoordinatedGraphics should implement threaded scrolling interface and 9 re-use threaded scrolling approach (ScrollingStateTree and ViewportConstraints) to handle 10 fixed/sticky elements positioning while scrolling. The rationals are below. 11 12 Before the change ScrollingCoordinatorCoordinatedGraphics was implementing Chromium-specific 13 interface which is going to be removed eventually as there is no ScrollingCoordinatorChromium 14 existing. 15 16 Tested by existing manual tests (fixed-position.html for example. 17 18 * CMakeLists.txt: 19 * Target.pri: 20 Included ScrollingStateTree files. 21 22 * page/scrolling/ScrollingStateFixedNode.cpp: 23 * page/scrolling/ScrollingStateFixedNode.h: 24 * page/scrolling/ScrollingStateNode.cpp: 25 * page/scrolling/ScrollingStateNode.h: 26 * page/scrolling/ScrollingStateScrollingNode.cpp: 27 * page/scrolling/ScrollingStateScrollingNode.h: 28 * page/scrolling/ScrollingStateStickyNode.cpp: 29 * page/scrolling/ScrollingStateStickyNode.h: 30 * page/scrolling/ScrollingStateTree.cpp: 31 * page/scrolling/ScrollingStateTree.h: 32 Removed ENABLE(THREADED_SCROLLING) code guards. 33 34 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: 35 (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics): 36 (WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics): 37 (WebCore): 38 (WebCore::ScrollingCoordinatorCoordinatedGraphics::attachToStateTree): 39 (WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree): 40 (WebCore::ScrollingCoordinatorCoordinatedGraphics::clearStateTree): 41 (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode): 42 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: 43 ScrollingCoordinatorCoordinatedGraphics is using threaded scrolling approach to handle fixed 44 elements positioning while scrolling. 45 46 (WebCore): 47 (ScrollingCoordinatorCoordinatedGraphics): 48 * page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp: Added. 49 (WebCore): 50 (WebCore::ScrollingStateNode::platformScrollLayer): 51 (WebCore::ScrollingStateNode::setScrollPlatformLayer): 52 (WebCore::ScrollingStateNode::setScrollLayer): 53 * page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp: Added. 54 (WebCore): 55 (WebCore::ScrollingStateScrollingNode::counterScrollingPlatformLayer): 56 (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer): 57 1 58 2013-04-11 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 59 -
trunk/Source/WebCore/Target.pri
r147921 r148197 4143 4143 use?(3D_GRAPHICS) { 4144 4144 HEADERS += \ 4145 page/scrolling/ScrollingConstraints.h \ 4146 page/scrolling/ScrollingCoordinator.h \ 4147 page/scrolling/ScrollingStateFixedNode.h \ 4148 page/scrolling/ScrollingStateNode.h \ 4149 page/scrolling/ScrollingStateScrollingNode.h \ 4150 page/scrolling/ScrollingStateStickyNode.h \ 4151 page/scrolling/ScrollingStateTree.h \ 4145 4152 page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h \ 4146 4153 platform/graphics/cpu/arm/GraphicsContext3DNEON.h \ … … 4168 4175 4169 4176 SOURCES += \ 4177 page/scrolling/ScrollingConstraints.cpp \ 4178 page/scrolling/ScrollingCoordinator.cpp \ 4179 page/scrolling/ScrollingStateFixedNode.cpp \ 4180 page/scrolling/ScrollingStateNode.cpp \ 4181 page/scrolling/ScrollingStateScrollingNode.cpp \ 4182 page/scrolling/ScrollingStateStickyNode.cpp \ 4183 page/scrolling/ScrollingStateTree.cpp \ 4170 4184 page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp \ 4185 page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp \ 4186 page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp \ 4171 4187 platform/graphics/ANGLEWebKitBridge.cpp \ 4172 4188 platform/graphics/GraphicsContext3D.cpp \ -
trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp
r141704 r148197 31 31 #include "TextStream.h" 32 32 #include <wtf/OwnPtr.h> 33 34 #if ENABLE(THREADED_SCROLLING)35 33 36 34 namespace WebCore { … … 113 111 114 112 } // namespace WebCore 115 116 #endif // ENABLE(THREADED_SCROLLING) -
trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h
r141704 r148197 26 26 #ifndef ScrollingStateFixedNode_h 27 27 #define ScrollingStateFixedNode_h 28 29 #if ENABLE(THREADED_SCROLLING)30 28 31 29 #include "ScrollingConstraints.h" … … 77 75 } // namespace WebCore 78 76 79 #endif // ENABLE(THREADED_SCROLLING)80 81 77 #endif // ScrollingStateFixedNode_h -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp
r141704 r148197 32 32 33 33 #include <wtf/text/WTFString.h> 34 35 #if ENABLE(THREADED_SCROLLING)36 34 37 35 namespace WebCore { … … 148 146 149 147 } // namespace WebCore 150 151 #endif // ENABLE(THREADED_SCROLLING) -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h
r142505 r148197 26 26 #ifndef ScrollingStateNode_h 27 27 #define ScrollingStateNode_h 28 29 #if ENABLE(THREADED_SCROLLING)30 28 31 29 #include "PlatformLayer.h" … … 118 116 } // namespace WebCore 119 117 120 #endif // ENABLE(THREADED_SCROLLING)121 122 118 #endif // ScrollingStateNode_h -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
r147471 r148197 31 31 #include <wtf/OwnPtr.h> 32 32 33 #if ENABLE(THREADED_SCROLLING)34 35 33 namespace WebCore { 36 34 … … 285 283 286 284 } // namespace WebCore 287 288 #endif // ENABLE(THREADED_SCROLLING) -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
r147471 r148197 26 26 #ifndef ScrollingStateScrollingNode_h 27 27 #define ScrollingStateScrollingNode_h 28 29 #if ENABLE(THREADED_SCROLLING)30 28 31 29 #include "IntRect.h" … … 173 171 } // namespace WebCore 174 172 175 #endif // ENABLE(THREADED_SCROLLING)176 177 173 #endif // ScrollingStateScrollingNode_h -
trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp
r141704 r148197 31 31 #include "TextStream.h" 32 32 #include <wtf/OwnPtr.h> 33 34 #if ENABLE(THREADED_SCROLLING)35 33 36 34 namespace WebCore { … … 132 130 133 131 } // namespace WebCore 134 135 #endif // ENABLE(THREADED_SCROLLING) -
trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h
r141704 r148197 26 26 #ifndef ScrollingStateStickyNode_h 27 27 #define ScrollingStateStickyNode_h 28 29 #if ENABLE(THREADED_SCROLLING)30 28 31 29 #include "ScrollingConstraints.h" … … 77 75 } // namespace WebCore 78 76 79 #endif // ENABLE(THREADED_SCROLLING)80 81 77 #endif // ScrollingStateStickyNode_h -
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
r143074 r148197 25 25 26 26 #include "config.h" 27 28 #if ENABLE(THREADED_SCROLLING)29 27 30 28 #include "ScrollingStateTree.h" … … 182 180 183 181 } // namespace WebCore 184 185 #endif // ENABLE(THREADED_SCROLLING) -
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h
r142504 r148197 26 26 #ifndef ScrollingStateTree_h 27 27 #define ScrollingStateTree_h 28 29 #if ENABLE(THREADED_SCROLLING)30 28 31 29 #include "ScrollingStateScrollingNode.h" … … 80 78 } // namespace WebCore 81 79 82 #endif // ENABLE(THREADED_SCROLLING)83 84 80 #endif // ScrollingStateTree_h -
trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
r144907 r148197 31 31 32 32 #include "CoordinatedGraphicsLayer.h" 33 #include "FrameView.h" 33 34 #include "Page.h" 35 #include "RenderLayer.h" 36 #include "RenderLayerBacking.h" 37 #include "ScrollingConstraints.h" 38 #include "ScrollingStateFixedNode.h" 39 #include "ScrollingStateScrollingNode.h" 40 #include "ScrollingStateStickyNode.h" 41 #include "ScrollingStateTree.h" 34 42 #include "Settings.h" 35 43 … … 38 46 ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics(Page* page) 39 47 : ScrollingCoordinator(page) 48 , m_scrollingStateTree(ScrollingStateTree::create()) 40 49 { 41 50 } 42 51 43 void ScrollingCoordinatorCoordinatedGraphics::setLayerIsFixedToContainerLayer(GraphicsLayer* layer, bool enable)52 ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics() 44 53 { 45 if (!m_page->settings()->acceleratedCompositingForFixedPositionEnabled()) 54 } 55 56 ScrollingNodeID ScrollingCoordinatorCoordinatedGraphics::attachToStateTree(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID) 57 { 58 return m_scrollingStateTree->attachNode(nodeType, newNodeID, parentID); 59 } 60 61 void ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree(ScrollingNodeID nodeID) 62 { 63 ScrollingStateNode* node = m_scrollingStateTree->stateNodeForID(nodeID); 64 if (node && node->isFixedNode()) 65 toCoordinatedGraphicsLayer(node->graphicsLayer())->setFixedToViewport(false); 66 67 m_scrollingStateTree->detachNode(nodeID); 68 } 69 70 void ScrollingCoordinatorCoordinatedGraphics::clearStateTree() 71 { 72 m_scrollingStateTree->clear(); 73 } 74 75 void ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode(ScrollingNodeID nodeID, const ViewportConstraints& constraints, GraphicsLayer* graphicsLayer) 76 { 77 ASSERT(supportsFixedPositionLayers()); 78 79 ScrollingStateNode* node = m_scrollingStateTree->stateNodeForID(nodeID); 80 if (!node) 46 81 return; 47 toCoordinatedGraphicsLayer(layer)->setFixedToViewport(enable); 82 83 switch (constraints.constraintType()) { 84 case ViewportConstraints::FixedPositionConstaint: { 85 toCoordinatedGraphicsLayer(graphicsLayer)->setFixedToViewport(true); // FIXME : Use constraints! 86 ScrollingStateFixedNode* fixedNode = toScrollingStateFixedNode(node); 87 fixedNode->setScrollLayer(graphicsLayer); 88 break; 89 } 90 case ViewportConstraints::StickyPositionConstraint: 91 break; // FIXME : Support sticky elements. 92 default: 93 ASSERT_NOT_REACHED(); 94 } 48 95 } 49 96 -
trunk/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h
r144907 r148197 33 33 namespace WebCore { 34 34 35 class ScrollingStateTree; 36 35 37 class ScrollingCoordinatorCoordinatedGraphics : public ScrollingCoordinator { 36 38 public: 37 39 explicit ScrollingCoordinatorCoordinatedGraphics(Page*); 40 virtual ~ScrollingCoordinatorCoordinatedGraphics(); 38 41 39 virtual bool supportsFixedPositionLayers() const { return true; }42 virtual bool supportsFixedPositionLayers() const OVERRIDE { return true; } 40 43 41 virtual void setLayerIsFixedToContainerLayer(GraphicsLayer*, bool); 42 virtual void scrollableAreaScrollLayerDidChange(ScrollableArea*); 43 virtual void willDestroyScrollableArea(ScrollableArea*); 44 virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID) OVERRIDE; 45 virtual void detachFromStateTree(ScrollingNodeID) OVERRIDE; 46 virtual void clearStateTree() OVERRIDE; 47 48 virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) OVERRIDE; 49 50 virtual void scrollableAreaScrollLayerDidChange(ScrollableArea*) OVERRIDE; 51 virtual void willDestroyScrollableArea(ScrollableArea*) OVERRIDE; 52 53 private: 54 OwnPtr<ScrollingStateTree> m_scrollingStateTree; 44 55 }; 45 56 … … 48 59 #endif // USE(COORDINATED_GRAPHICS) 49 60 50 #endif 61 #endif // ScrollingCoordinatorCoordinatedGraphics_h
Note: See TracChangeset
for help on using the changeset viewer.