Changeset 164110 in webkit
- Timestamp:
- Feb 14, 2014, 11:13:54 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r164107 r164110 1 2014-02-13 Simon Fraser <simon.fraser@apple.com> 2 3 Give ScrollingTree(State)Nodes a reference to another layer, which is used for moving overflow:scroll contents around 4 https://bugs.webkit.org/show_bug.cgi?id=128790 5 6 Reviewed by Beth Dakin. 7 8 Have scrolling tree nodes and state nodes track another layer, the 9 "scrolled contents layer", for accelerated overflow:scroll. 10 11 When making ScrollingTreeScrollingNodes for overflow:scroll, the node's 12 layer will point to the composited element's primary layer, and its 13 scrolledContentsLayer to the layer that gets moved around by scrolling. 14 15 Do some other cleanup on AsyncScrollingCoordinator, removing 16 functions that just called through to nodes. 17 18 * WebCore.exp.in: 19 * page/scrolling/AsyncScrollingCoordinator.cpp: 20 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): 21 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): 22 (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange): 23 (WebCore::AsyncScrollingCoordinator::updateScrollingNode): 24 (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode): 25 (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): 26 * page/scrolling/AsyncScrollingCoordinator.h: 27 * page/scrolling/ScrollingCoordinator.h: 28 (WebCore::ScrollingCoordinator::updateScrollingNode): 29 * page/scrolling/ScrollingStateScrollingNode.cpp: 30 (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): 31 (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer): 32 (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer): 33 (WebCore::ScrollingStateScrollingNode::setHeaderLayer): 34 (WebCore::ScrollingStateScrollingNode::setFooterLayer): 35 * page/scrolling/ScrollingStateScrollingNode.h: 36 * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h: 37 * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm: 38 (WebCore::ScrollingTreeScrollingNodeIOS::updateBeforeChildren): 39 * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h: 40 * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm: 41 (WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren): 42 * rendering/RenderLayerCompositor.cpp: 43 (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): 44 1 45 2014-02-14 Chris Fleizach <cfleizach@apple.com> 2 46 -
trunk/Source/WebCore/WebCore.exp.in
r163983 r164110 3033 3033 __ZN7WebCore25AsyncScrollingCoordinator18syncChildPositionsERKNS_10LayoutRectE 3034 3034 __ZN7WebCore25AsyncScrollingCoordinator19detachFromStateTreeEy 3035 __ZN7WebCore25AsyncScrollingCoordinator19updateScrollingNodeEyPNS_13GraphicsLayerES2_ 3035 __ZN7WebCore25AsyncScrollingCoordinator19updateScrollingNodeEyPNS_13GraphicsLayerES2_S2_ 3036 3036 __ZN7WebCore25AsyncScrollingCoordinator22frameViewLayoutUpdatedEPNS_9FrameViewE 3037 3037 __ZNK7WebCore25AsyncScrollingCoordinator24scrollingStateTreeAsTextEv … … 3056 3056 __ZN7WebCore27ScrollingStateScrollingNode20setTotalContentsSizeERKNS_7IntSizeE 3057 3057 __ZN7WebCore27ScrollingStateScrollingNode24setCounterScrollingLayerERKNS_19LayerRepresentationE 3058 __ZN7WebCore27ScrollingStateScrollingNode24setScrolledContentsLayerERKNS_19LayerRepresentationE 3058 3059 __ZN7WebCore27ScrollingStateScrollingNode25setWheelEventHandlerCountEj 3059 3060 __ZN7WebCore27ScrollingStateScrollingNode26setNonFastScrollableRegionERKNS_6RegionE -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r163516 r164110 70 70 // all scrollable areas, such as subframes, overflow divs and list boxes. We need to do this even if the 71 71 // frame view whose layout was updated is not the main frame. 72 Region nonFastScrollableRegion = computeNonFastScrollableRegion(&m_page->mainFrame(), IntPoint());73 74 72 // In the future, we may want to have the ability to set non-fast scrolling regions for more than 75 73 // just the root node. But right now, this concept only applies to the root. 76 setNonFastScrollableRegionForNode(nonFastScrollableRegion, m_scrollingStateTree->rootStateNode());74 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion(&m_page->mainFrame(), IntPoint())); 77 75 78 76 if (!coordinatesScrollingForFrameView(frameView)) … … 111 109 return; 112 110 113 Region nonFastScrollableRegion = computeNonFastScrollableRegion(&m_page->mainFrame(), IntPoint()); 114 setNonFastScrollableRegionForNode(nonFastScrollableRegion, m_scrollingStateTree->rootStateNode()); 111 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion(&m_page->mainFrame(), IntPoint())); 115 112 } 116 113 … … 130 127 131 128 ScrollingStateScrollingNode* node = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID())); 132 setScrollLayerForNode(scrollLayerForFrameView(frameView), node);133 setCounterScrollingLayerForNode(counterScrollingLayerForFrameView(frameView), node);134 setHeaderLayerForNode(headerLayerForFrameView(frameView), node);135 setFooterLayerForNode(footerLayerForFrameView(frameView), node);136 setScrollBehaviorForFixedElementsForNode(frameView->scrollBehaviorForFixedElements(), node);129 node->setLayer(scrollLayerForFrameView(frameView)); 130 node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView)); 131 node->setHeaderLayer(headerLayerForFrameView(frameView)); 132 node->setFooterLayer(footerLayerForFrameView(frameView)); 133 node->setScrollBehaviorForFixedElements(frameView->scrollBehaviorForFixedElements()); 137 134 } 138 135 … … 291 288 } 292 289 293 void AsyncScrollingCoordinator::updateScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* scrollLayer, GraphicsLayer* counterScrollingLayer)290 void AsyncScrollingCoordinator::updateScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer) 294 291 { 295 292 ScrollingStateScrollingNode* node = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID)); … … 298 295 return; 299 296 300 node->setLayer(scrollLayer); 297 node->setLayer(layer); 298 node->setScrolledContentsLayer(scrolledContentsLayer); 301 299 node->setCounterScrollingLayer(counterScrollingLayer); 302 300 } … … 313 311 case ViewportConstraints::FixedPositionConstraint: { 314 312 ScrollingStateFixedNode* fixedNode = toScrollingStateFixedNode(node); 315 setScrollLayerForNode(graphicsLayer, fixedNode);313 fixedNode->setLayer(graphicsLayer); 316 314 fixedNode->updateConstraints((const FixedPositionViewportConstraints&)constraints); 317 315 break; … … 319 317 case ViewportConstraints::StickyPositionConstraint: { 320 318 ScrollingStateStickyNode* stickyNode = toScrollingStateStickyNode(node); 321 s etScrollLayerForNode(graphicsLayer, stickyNode);319 stickyNode->setLayer(graphicsLayer); 322 320 stickyNode->updateConstraints((const StickyPositionViewportConstraints&)constraints); 323 321 break; 324 322 } 325 323 } 326 }327 328 void AsyncScrollingCoordinator::setScrollLayerForNode(GraphicsLayer* scrollLayer, ScrollingStateNode* node)329 {330 node->setLayer(scrollLayer);331 }332 333 void AsyncScrollingCoordinator::setCounterScrollingLayerForNode(GraphicsLayer* layer, ScrollingStateScrollingNode* node)334 {335 node->setCounterScrollingLayer(layer);336 }337 338 void AsyncScrollingCoordinator::setHeaderLayerForNode(GraphicsLayer* headerLayer, ScrollingStateScrollingNode* node)339 {340 // Headers and footers are only supported on the root node.341 ASSERT(node == m_scrollingStateTree->rootStateNode());342 node->setHeaderLayer(headerLayer);343 }344 345 void AsyncScrollingCoordinator::setFooterLayerForNode(GraphicsLayer* footerLayer, ScrollingStateScrollingNode* node)346 {347 // Headers and footers are only supported on the root node.348 ASSERT(node == m_scrollingStateTree->rootStateNode());349 node->setFooterLayer(footerLayer);350 }351 352 void AsyncScrollingCoordinator::setNonFastScrollableRegionForNode(const Region& region, ScrollingStateScrollingNode* node)353 {354 node->setNonFastScrollableRegion(region);355 }356 357 void AsyncScrollingCoordinator::setWheelEventHandlerCountForNode(unsigned wheelEventHandlerCount, ScrollingStateScrollingNode* node)358 {359 node->setWheelEventHandlerCount(wheelEventHandlerCount);360 }361 362 void AsyncScrollingCoordinator::setScrollBehaviorForFixedElementsForNode(ScrollBehaviorForFixedElements behaviorForFixed, ScrollingStateScrollingNode* node)363 {364 node->setScrollBehaviorForFixedElements(behaviorForFixed);365 324 } 366 325 … … 404 363 if (!node) 405 364 return; 406 setWheelEventHandlerCountForNode(computeCurrentWheelEventHandlerCount(), node);365 node->setWheelEventHandlerCount(computeCurrentWheelEventHandlerCount()); 407 366 } 408 367 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r163516 r164110 88 88 89 89 virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) override; 90 virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* counterScrollingLayer) override;90 virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer*, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer) override; 91 91 virtual String scrollingStateTreeAsText() const override; 92 92 virtual bool isRubberBandInProgress() const override; … … 104 104 void updateMainFrameScrollLayerPosition(); 105 105 106 void setScrollLayerForNode(GraphicsLayer*, ScrollingStateNode*);107 void setCounterScrollingLayerForNode(GraphicsLayer*, ScrollingStateScrollingNode*);108 void setHeaderLayerForNode(GraphicsLayer*, ScrollingStateScrollingNode*);109 void setFooterLayerForNode(GraphicsLayer*, ScrollingStateScrollingNode*);110 void setNonFastScrollableRegionForNode(const Region&, ScrollingStateScrollingNode*);111 void setWheelEventHandlerCountForNode(unsigned, ScrollingStateScrollingNode*);112 void setScrollBehaviorForFixedElementsForNode(ScrollBehaviorForFixedElements, ScrollingStateScrollingNode*);113 106 // FIXME: move somewhere else? 114 107 void setScrollbarPaintersFromScrollbarsForNode(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar, ScrollingStateScrollingNode*); -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r163725 r164110 153 153 virtual void clearStateTree() { } 154 154 virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) { } 155 virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /* counterScrollingLayer*/) { }155 virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/) { } 156 156 virtual void syncChildPositions(const LayoutRect&) { } 157 157 virtual String scrollingStateTreeAsText() const; -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
r163677 r164110 77 77 , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll()) 78 78 { 79 if (hasChangedProperty(ScrolledContentsLayer)) 80 setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); 81 79 82 if (hasChangedProperty(CounterScrollingLayer)) 80 83 setCounterScrollingLayer(stateNode.counterScrollingLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); … … 212 215 } 213 216 217 void ScrollingStateScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation) 218 { 219 if (layerRepresentation == m_scrolledContentsLayer) 220 return; 221 222 m_scrolledContentsLayer = layerRepresentation; 223 setPropertyChanged(ScrolledContentsLayer); 224 } 225 214 226 void ScrollingStateScrollingNode::setCounterScrollingLayer(const LayerRepresentation& layerRepresentation) 215 227 { … … 218 230 219 231 m_counterScrollingLayer = layerRepresentation; 220 221 232 setPropertyChanged(CounterScrollingLayer); 222 233 } … … 228 239 229 240 m_headerLayer = layerRepresentation; 230 231 241 setPropertyChanged(HeaderLayer); 232 242 } … … 239 249 240 250 m_footerLayer = layerRepresentation; 241 242 251 setPropertyChanged(FooterLayer); 243 252 } -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
r163677 r164110 61 61 ReasonsForSynchronousScrolling, 62 62 RequestedScrollPosition, 63 ScrolledContentsLayer, 63 64 CounterScrollingLayer, 64 65 HeaderHeight, … … 110 111 void setFooterHeight(int); 111 112 113 // This is a layer with the contents that move (only used for overflow:scroll). 114 const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; } 115 void setScrolledContentsLayer(const LayerRepresentation&); 116 112 117 // This is a layer moved in the opposite direction to scrolling, for example for background-attachment:fixed 113 118 const LayerRepresentation& counterScrollingLayer() const { return m_counterScrollingLayer; } … … 134 139 ScrollingStateScrollingNode(const ScrollingStateScrollingNode&, ScrollingStateTree&); 135 140 141 LayerRepresentation m_scrolledContentsLayer; 136 142 LayerRepresentation m_counterScrollingLayer; 137 143 LayerRepresentation m_headerLayer; -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h
r163231 r164110 62 62 63 63 RetainPtr<CALayer> m_scrollLayer; 64 RetainPtr<CALayer> m_scrolledContentsLayer; 64 65 RetainPtr<CALayer> m_counterScrollingLayer; 65 66 RetainPtr<CALayer> m_headerLayer; -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm
r163231 r164110 63 63 m_scrollLayer = scrollingStateNode.layer(); 64 64 65 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 66 m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer(); 67 65 68 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer)) 66 69 m_counterScrollingLayer = scrollingStateNode.counterScrollingLayer(); -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h
r163231 r164110 86 86 87 87 RetainPtr<CALayer> m_scrollLayer; 88 RetainPtr<CALayer> m_scrolledContentsLayer; 88 89 RetainPtr<CALayer> m_counterScrollingLayer; 89 90 RetainPtr<CALayer> m_headerLayer; -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm
r163472 r164110 79 79 m_scrollLayer = scrollingStateNode.layer(); 80 80 81 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 82 m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer(); 83 81 84 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer)) 82 85 m_counterScrollingLayer = scrollingStateNode.counterScrollingLayer(); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r163955 r164110 1567 1567 return; 1568 1568 1569 scrollingCoordinator->updateScrollingNode(renderViewBacking->scrollLayerID(), scrollLayer(), fixedRootBackgroundLayer());1569 scrollingCoordinator->updateScrollingNode(renderViewBacking->scrollLayerID(), scrollLayer(), nullptr, fixedRootBackgroundLayer()); 1570 1570 } 1571 1571 } -
trunk/Source/WebKit2/ChangeLog
r164109 r164110 1 2014-02-13 Simon Fraser <simon.fraser@apple.com> 2 3 Give ScrollingTree(State)Nodes a reference to another layer, which is used for moving overflow:scroll contents around 4 https://bugs.webkit.org/show_bug.cgi?id=128790 5 6 Reviewed by Beth Dakin. 7 8 Have scrolling tree nodes and state nodes track another layer, the 9 "scrolled contents layer", for accelerated overflow:scroll. 10 11 When making ScrollingTreeScrollingNodes for overflow:scroll, the node's 12 layer will point to the composited element's primary layer, and its 13 scrolledContentsLayer to the layer that gets moved around by scrolling. 14 15 Do some other cleanup on AsyncScrollingCoordinator, removing 16 functions that just called through to nodes. 17 18 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: 19 (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 20 1 21 2014-02-14 Anders Carlsson <andersca@apple.com> 2 22 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
r163959 r164110 101 101 scrollingStateNode->setLayer(layerTreeHost.getLayer(scrollingStateNode->layer())); 102 102 103 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 104 scrollingStateNode->setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode->scrolledContentsLayer())); 105 103 106 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer)) 104 107 scrollingStateNode->setCounterScrollingLayer(layerTreeHost.getLayer(scrollingStateNode->counterScrollingLayer()));
Note:
See TracChangeset
for help on using the changeset viewer.