Changeset 168655 in webkit
- Timestamp:
- May 12, 2014 4:21:51 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r168651 r168655 1 2014-05-12 Beth Dakin <bdakin@apple.com> 2 3 Content shadow layer needs to move in sync with the content layer 4 https://bugs.webkit.org/show_bug.cgi?id=132841 5 -and corresponding- 6 <rdar://problem/16641115> 7 8 Reviewed by Simon Fraser. 9 10 Now that the root content layer moves a little bit (for y scroll positions between 11 0 and topContentInset), the shadow layer needs to move along with it since the 12 shadow layer should always have the same position as the root content layer. 13 14 Set the root state node’s shadow layer, and update the position whenever the root 15 content layer’s position is updated. 16 * page/scrolling/AsyncScrollingCoordinator.cpp: 17 (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange): 18 (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): 19 20 Fetch the compositor’s layerForContentShadow(). 21 * page/scrolling/ScrollingCoordinator.cpp: 22 (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView): 23 * page/scrolling/ScrollingCoordinator.h: 24 25 Hook up the contentShadowLayer in the state node. 26 * page/scrolling/ScrollingStateScrollingNode.cpp: 27 (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): 28 (WebCore::ScrollingStateScrollingNode::setContentShadowLayer): 29 30 Hook it up in the ScrollingTreeNode as well. Move the layer whenever the m 31 _scrolledContentsLayer is moved. 32 * page/scrolling/ScrollingStateScrollingNode.h: 33 * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h: 34 * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm: 35 (WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren): 36 (WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition): 37 38 The shadow layer needs an anchor point now that we are moving it around. 39 * rendering/RenderLayerCompositor.cpp: 40 (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): 41 1 42 2014-05-12 Dirk Schulze <krit@webkit.org> 2 43 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r168602 r168655 136 136 node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView)); 137 137 node->setInsetClipLayer(insetClipLayerForFrameView(frameView)); 138 node->setContentShadowLayer(contentShadowLayerForFrameView(frameView)); 138 139 node->setHeaderLayer(headerLayerForFrameView(frameView)); 139 140 node->setFooterLayer(footerLayerForFrameView(frameView)); … … 216 217 GraphicsLayer* counterScrollingLayer = counterScrollingLayerForFrameView(frameView); 217 218 GraphicsLayer* insetClipLayer = insetClipLayerForFrameView(frameView); 219 GraphicsLayer* contentShadowLayer = contentShadowLayerForFrameView(frameView); 218 220 GraphicsLayer* scrolledContentsLayer = rootContentLayerForFrameView(frameView); 219 221 GraphicsLayer* headerLayer = headerLayerForFrameView(frameView); … … 235 237 if (insetClipLayer) 236 238 insetClipLayer->setPosition(positionForInsetClipLayer); 239 if (contentShadowLayer) 240 contentShadowLayer->setPosition(positionForContentsLayer); 237 241 if (scrolledContentsLayer) 238 242 scrolledContentsLayer->setPosition(positionForContentsLayer); … … 247 251 if (insetClipLayer) 248 252 insetClipLayer->syncPosition(positionForInsetClipLayer); 253 if (contentShadowLayer) 254 contentShadowLayer->syncPosition(positionForContentsLayer); 249 255 if (scrolledContentsLayer) 250 256 scrolledContentsLayer->syncPosition(positionForContentsLayer); -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r168602 r168655 256 256 } 257 257 258 GraphicsLayer* ScrollingCoordinator::contentShadowLayerForFrameView(FrameView* frameView) 259 { 260 if (RenderView* renderView = frameView->frame().contentRenderer()) 261 return renderView->compositor().layerForContentShadow(); 262 return nullptr; 263 } 264 258 265 GraphicsLayer* ScrollingCoordinator::rootContentLayerForFrameView(FrameView* frameView) 259 266 { -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r168244 r168655 206 206 GraphicsLayer* insetClipLayerForFrameView(FrameView*); 207 207 GraphicsLayer* rootContentLayerForFrameView(FrameView*); 208 GraphicsLayer* contentShadowLayerForFrameView(FrameView*); 208 209 GraphicsLayer* headerLayerForFrameView(FrameView*); 209 210 GraphicsLayer* footerLayerForFrameView(FrameView*); -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
r168244 r168655 88 88 setInsetClipLayer(stateNode.insetClipLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); 89 89 90 if (hasChangedProperty(ContentShadowLayer)) 91 setContentShadowLayer(stateNode.contentShadowLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); 92 90 93 if (hasChangedProperty(HeaderLayer)) 91 94 setHeaderLayer(stateNode.headerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); … … 256 259 } 257 260 261 void ScrollingStateScrollingNode::setContentShadowLayer(const LayerRepresentation& layerRepresentation) 262 { 263 if (layerRepresentation == m_contentShadowLayer) 264 return; 265 266 m_contentShadowLayer = layerRepresentation; 267 setPropertyChanged(ContentShadowLayer); 268 } 269 258 270 void ScrollingStateScrollingNode::setHeaderLayer(const LayerRepresentation& layerRepresentation) 259 271 { -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
r168244 r168655 64 64 CounterScrollingLayer, 65 65 InsetClipLayer, 66 ContentShadowLayer, 66 67 HeaderHeight, 67 68 FooterHeight, … … 131 132 void setInsetClipLayer(const LayerRepresentation&); 132 133 134 const LayerRepresentation& contentShadowLayer() const { return m_contentShadowLayer; } 135 void setContentShadowLayer(const LayerRepresentation&); 136 133 137 // The header and footer layers scroll vertically with the page, they should remain fixed when scrolling horizontally. 134 138 const LayerRepresentation& headerLayer() const { return m_headerLayer; } … … 154 158 LayerRepresentation m_counterScrollingLayer; 155 159 LayerRepresentation m_insetClipLayer; 160 LayerRepresentation m_contentShadowLayer; 156 161 LayerRepresentation m_headerLayer; 157 162 LayerRepresentation m_footerLayer; -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h
r168244 r168655 91 91 RetainPtr<CALayer> m_counterScrollingLayer; 92 92 RetainPtr<CALayer> m_insetClipLayer; 93 RetainPtr<CALayer> m_contentShadowLayer; 93 94 RetainPtr<CALayer> m_headerLayer; 94 95 RetainPtr<CALayer> m_footerLayer; -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm
r168602 r168655 88 88 m_insetClipLayer = scrollingStateNode.insetClipLayer(); 89 89 90 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ContentShadowLayer)) 91 m_contentShadowLayer = scrollingStateNode.contentShadowLayer(); 92 90 93 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer)) 91 94 m_headerLayer = scrollingStateNode.headerLayer(); … … 361 364 m_scrolledContentsLayer.get().position = FloatPoint(m_scrolledContentsLayer.get().position.x, 362 365 FrameView::yPositionForRootContentLayer(position, topContentInset, headerHeight())); 366 if (m_contentShadowLayer) 367 m_contentShadowLayer.get().position = m_scrolledContentsLayer.get().position; 363 368 } 364 369 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r168643 r168655 3103 3103 m_contentShadowLayer->setSize(m_rootContentLayer->size()); 3104 3104 m_contentShadowLayer->setPosition(m_rootContentLayer->position()); 3105 m_contentShadowLayer->setAnchorPoint(FloatPoint3D()); 3105 3106 m_contentShadowLayer->setCustomAppearance(GraphicsLayer::ScrollingShadow); 3106 3107
Note: See TracChangeset
for help on using the changeset viewer.