Changeset 183970 in webkit
- Timestamp:
- May 7, 2015, 6:46:59 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r183967 r183970 1 2015-05-07 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r183300): Fixed elements flash when scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=144778 5 rdar://problem/20769741 6 7 Reviewed by Dean Jackson. 8 9 After r183300 we can detached layer backing store when outside the coverage region. 10 However, position:fixed layers are moved around by the ScrollingCoordinator behind 11 GraphicsLayer's back, so we can do layer flushes with stale information about layer 12 geometry. 13 14 To avoid dropping backing store for layers in this situation, prevent backing 15 store detachment on layers registered with the ScrollingCoordinator as viewport-constrained 16 layers. Preventing detachment on a layer also prevents detachment on all descendant 17 layers. 18 19 * platform/graphics/GraphicsLayer.h: 20 (WebCore::GraphicsLayer::setAllowsBackingStoreDetachment): 21 (WebCore::GraphicsLayer::allowsBackingStoreDetachment): 22 * platform/graphics/ca/GraphicsLayerCA.cpp: 23 (WebCore::GraphicsLayerCA::GraphicsLayerCA): 24 (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): Set m_intersectsCoverageRect to true 25 if backing store detachment is prevented. 26 (WebCore::GraphicsLayerCA::recursiveCommitChanges): Set a bit in the CommitState to 27 communicate to descendants that detachment is prevented. 28 * platform/graphics/ca/GraphicsLayerCA.h: 29 (WebCore::GraphicsLayerCA::CommitState::CommitState): Deleted. 30 * rendering/RenderLayerBacking.cpp: 31 (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole): 32 * rendering/RenderLayerBacking.h: 33 (WebCore::RenderLayerBacking::setScrollingNodeIDForRole): If registering with a non-zero 34 nodeID for the ViewportConstrained role, turn off backing store detachment. 35 1 36 2015-05-07 Sam Weinig <sam@webkit.org> 2 37 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r182159 r183970 491 491 float pageScaleFactor() const { return m_client.pageScaleFactor(); } 492 492 float deviceScaleFactor() const { return m_client.deviceScaleFactor(); } 493 494 // Whether this layer (and descendants) can detach backing store when outside the coverage area. 495 virtual void setAllowsBackingStoreDetachment(bool) { } 496 virtual bool allowsBackingStoreDetachment() const { return true; } 493 497 494 498 virtual void deviceOrPageScaleFactorChanged() { } -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r183942 r183970 354 354 , m_needsFullRepaint(false) 355 355 , m_usingBackdropLayerType(false) 356 , m_allowsBackingStoreDetachment(true) 356 357 , m_intersectsCoverageRect(true) 357 358 { … … 1253 1254 } 1254 1255 1255 void GraphicsLayerCA::setVisibleAndCoverageRects(const VisibleAndCoverageRects& rects )1256 void GraphicsLayerCA::setVisibleAndCoverageRects(const VisibleAndCoverageRects& rects, bool allowBackingStoreDetachment) 1256 1257 { 1257 1258 bool visibleRectChanged = rects.visibleRect != m_visibleRect; … … 1276 1277 1277 1278 // FIXME: we need to take reflections into account when determining whether this layer intersects the coverage rect. 1278 m_intersectsCoverageRect = m_coverageRect.intersects(FloatRect(m_boundsOrigin, size()));1279 m_intersectsCoverageRect = !allowBackingStoreDetachment || m_coverageRect.intersects(FloatRect(m_boundsOrigin, size())); 1279 1280 1280 1281 if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer)) { … … 1301 1302 } 1302 1303 } 1303 setVisibleAndCoverageRects(rects );1304 setVisibleAndCoverageRects(rects, m_allowsBackingStoreDetachment && commitState.ancestorsAllowBackingStoreDetachment); 1304 1305 1305 1306 #ifdef VISIBLE_TILE_WASH … … 1344 1345 affectedByTransformAnimation = true; 1345 1346 } 1347 1348 childCommitState.ancestorsAllowBackingStoreDetachment &= m_allowsBackingStoreDetachment; 1346 1349 1347 1350 if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer)) … … 3626 3629 } 3627 3630 3631 void GraphicsLayerCA::setAllowsBackingStoreDetachment(bool allowDetachment) 3632 { 3633 if (allowDetachment == m_allowsBackingStoreDetachment) 3634 return; 3635 3636 m_allowsBackingStoreDetachment = allowDetachment; 3637 noteLayerPropertyChanged(CoverageRectChanged); 3638 } 3639 3628 3640 void GraphicsLayerCA::deviceOrPageScaleFactorChanged() 3629 3641 { -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r183354 r183970 149 149 150 150 struct CommitState { 151 bool ancestorHasTransformAnimation; 152 int treeDepth; 153 CommitState() 154 : ancestorHasTransformAnimation(false) 155 , treeDepth(0) 156 { } 151 int treeDepth { 0 }; 152 bool ancestorHasTransformAnimation { false }; 153 bool ancestorsAllowBackingStoreDetachment { true }; 157 154 }; 158 155 void recursiveCommitChanges(const CommitState&, const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false); … … 197 194 198 195 virtual bool isCommittingChanges() const override { return m_isCommittingChanges; } 196 197 WEBCORE_EXPORT virtual void setAllowsBackingStoreDetachment(bool) override; 198 WEBCORE_EXPORT virtual bool allowsBackingStoreDetachment() const override { return m_allowsBackingStoreDetachment; } 199 199 200 200 WEBCORE_EXPORT virtual double backingStoreMemoryEstimate() const override; … … 294 294 const FloatRect& coverageRect() const { return m_coverageRect; } 295 295 296 void setVisibleAndCoverageRects(const VisibleAndCoverageRects& );296 void setVisibleAndCoverageRects(const VisibleAndCoverageRects&, bool allowBackingStoreDetachment); 297 297 298 298 static FloatRect adjustTiledLayerVisibleRect(TiledBacking*, const FloatRect& oldVisibleRect, const FloatRect& newVisibleRect, const FloatSize& oldSize, const FloatSize& newSize); … … 511 511 bool m_needsFullRepaint : 1; 512 512 bool m_usingBackdropLayerType : 1; 513 bool m_allowsBackingStoreDetachment : 1; 513 514 bool m_intersectsCoverageRect : 1; 514 515 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r183950 r183970 1570 1570 } 1571 1571 1572 void RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole(bool viewportCoordinated) 1573 { 1574 m_graphicsLayer->setAllowsBackingStoreDetachment(!viewportCoordinated); 1575 } 1576 1572 1577 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() const 1573 1578 { -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r183849 r183970 127 127 case ViewportConstrained: 128 128 m_viewportConstrainedNodeID = nodeID; 129 setIsScrollCoordinatedWithViewportConstrainedRole(nodeID); 129 130 break; 130 131 } … … 132 133 133 134 ScrollingNodeID scrollingNodeIDForChildren() const { return m_scrollingNodeID ? m_scrollingNodeID : m_viewportConstrainedNodeID; } 135 136 void setIsScrollCoordinatedWithViewportConstrainedRole(bool); 134 137 135 138 bool hasMaskLayer() const { return m_maskLayer != 0; }
Note:
See TracChangeset
for help on using the changeset viewer.