Changeset 240047 in webkit
- Timestamp:
- Jan 16, 2019 12:40:59 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240046 r240047 1 2019-01-15 Simon Fraser <simon.fraser@apple.com> 2 3 Make didCommitChangesForLayer() explicitly about the platform layer changing because of tile/non-tile swapping 4 https://bugs.webkit.org/show_bug.cgi?id=193290 5 6 Reviewed by Tim Horton. 7 8 RenderLayerCompositor::didFlushChangesForLayer() triggers updates scrolling tree nodes for 9 the flushed layer, but it's not clear what has changed at this point. 10 11 didCommitChangesForLayer()/didFlushChangesForLayer() were added to explicitly handle the 12 case where the underlying platform layer for a GraphicsLayer changes because the layer swaps 13 between tiled and non-tiled, and structural layer changes; we need to push the new layer to 14 the scrolling tree because it operates on platform layers. So the only work that 15 didFlushChangesForLayer() should do is to update layers on scrolling tree nodes; it doesn't 16 need to do any geometry updating. Move towards that goal by renaming this callback to 17 didChangePlatformLayerForLayer() to make its function more explicit. 18 19 * platform/graphics/GraphicsLayerClient.h: 20 (WebCore::GraphicsLayerClient::didChangePlatformLayerForLayer): 21 (WebCore::GraphicsLayerClient::didCommitChangesForLayer const): Deleted. 22 * platform/graphics/ca/GraphicsLayerCA.cpp: 23 (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly): 24 (WebCore::GraphicsLayerCA::recursiveCommitChanges): 25 (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): 26 * platform/graphics/ca/GraphicsLayerCA.h: 27 * rendering/RenderLayerBacking.cpp: 28 (WebCore::RenderLayerBacking::didChangePlatformLayerForLayer): 29 (WebCore::RenderLayerBacking::didCommitChangesForLayer const): Deleted. 30 * rendering/RenderLayerBacking.h: 31 * rendering/RenderLayerCompositor.cpp: 32 (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): 33 (WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer): 34 (WebCore::RenderLayerCompositor::didFlushChangesForLayer): Deleted. 35 (WebCore::RenderLayerCompositor::didCommitChangesForLayer const): Deleted. 36 (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer): Deleted. 37 * rendering/RenderLayerCompositor.h: 38 1 39 2019-01-16 Chris Dumez <cdumez@apple.com> 2 40 -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r239548 r240047 102 102 103 103 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& /* inClip */, GraphicsLayerPaintBehavior) { } 104 virtual void didC ommitChangesForLayer(const GraphicsLayer*) const{ }104 virtual void didChangePlatformLayerForLayer(const GraphicsLayer*) { } 105 105 106 106 // Provides current transform (taking transform-origin and animations into account). Input matrix has been -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r239833 r240047 1272 1272 { 1273 1273 float pageScaleFactor; 1274 bool hadChanges = m_uncommittedChanges;1274 bool layerTypeChanged = false; 1275 1275 1276 1276 CommitState commitState; 1277 1277 1278 1278 FloatPoint offset = computePositionRelativeToBase(pageScaleFactor); 1279 commitLayerChangesBeforeSublayers(commitState, pageScaleFactor, offset );1279 commitLayerChangesBeforeSublayers(commitState, pageScaleFactor, offset, layerTypeChanged); 1280 1280 commitLayerChangesAfterSublayers(commitState); 1281 1281 1282 if ( hadChanges)1283 client().didC ommitChangesForLayer(this);1282 if (layerTypeChanged) 1283 client().didChangePlatformLayerForLayer(this); 1284 1284 } 1285 1285 … … 1566 1566 1567 1567 bool wasRunningTransformAnimation = isRunningTransformAnimation(); 1568 1569 commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition); 1568 bool layerTypeChanged = false; 1569 1570 commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition, layerTypeChanged); 1570 1571 1571 1572 bool nowRunningTransformAnimation = wasRunningTransformAnimation; … … 1587 1588 if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer.get())) { 1588 1589 maskLayer->setVisibleAndCoverageRects(rects, m_isViewportConstrained || commitState.ancestorIsViewportConstrained); 1589 maskLayer->commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition );1590 maskLayer->commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition, layerTypeChanged); 1590 1591 } 1591 1592 … … 1617 1618 client().notifyFlushBeforeDisplayRefresh(this); 1618 1619 1619 if ( hadChanges)1620 client().didC ommitChangesForLayer(this);1620 if (layerTypeChanged) 1621 client().didChangePlatformLayerForLayer(this); 1621 1622 1622 1623 if (usesDisplayListDrawing() && m_drawsContent && (!m_hasEverPainted || hadDirtyRects)) { … … 1713 1714 } 1714 1715 1715 void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState, float pageScaleFactor, const FloatPoint& positionRelativeToBase )1716 void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool& layerChanged) 1716 1717 { 1717 1718 SetForScope<bool> committingChangesChange(m_isCommittingChanges, true); … … 1740 1741 neededLayerType = PlatformCALayer::LayerTypeWebLayer; 1741 1742 1742 if (neededLayerType != m_layer->layerType()) 1743 if (neededLayerType != m_layer->layerType()) { 1743 1744 changeLayerTypeTo(neededLayerType); 1745 layerChanged = true; 1746 } 1744 1747 1745 1748 // Need to handle Preserves3DChanged first, because it affects which layers subsequent properties are applied to 1746 if (m_uncommittedChanges & (Preserves3DChanged | ReplicatedLayerChanged | BackdropFiltersChanged)) 1747 updateStructuralLayer(); 1749 if (m_uncommittedChanges & (Preserves3DChanged | ReplicatedLayerChanged | BackdropFiltersChanged)) { 1750 if (updateStructuralLayer()) 1751 layerChanged = true; 1752 } 1748 1753 1749 1754 if (m_uncommittedChanges & GeometryChanged) … … 2266 2271 } 2267 2272 2268 voidGraphicsLayerCA::updateStructuralLayer()2269 { 2270 ensureStructuralLayer(structuralLayerPurpose());2271 } 2272 2273 voidGraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)2273 bool GraphicsLayerCA::updateStructuralLayer() 2274 { 2275 return ensureStructuralLayer(structuralLayerPurpose()); 2276 } 2277 2278 bool GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose) 2274 2279 { 2275 2280 const LayerChangeFlags structuralLayerChangeFlags = NameChanged … … 2284 2289 | OpacityChanged; 2285 2290 2291 bool structuralLayerChanged = false; 2292 2286 2293 if (purpose == NoStructuralLayer) { 2287 2294 if (m_structuralLayer) { … … 2298 2305 // Release the structural layer. 2299 2306 m_structuralLayer = nullptr; 2307 structuralLayerChanged = true; 2300 2308 2301 2309 addUncommittedChanges(structuralLayerChangeFlags); 2302 2310 } 2303 return; 2304 } 2305 2306 bool structuralLayerChanged = false; 2307 2311 return structuralLayerChanged; 2312 } 2313 2308 2314 if (purpose == StructuralLayerForPreserves3D) { 2309 2315 if (m_structuralLayer && m_structuralLayer->layerType() != PlatformCALayer::LayerTypeTransformLayer) … … 2325 2331 2326 2332 if (!structuralLayerChanged) 2327 return ;2333 return false; 2328 2334 2329 2335 addUncommittedChanges(structuralLayerChangeFlags); … … 2350 2356 2351 2357 moveAnimations(m_layer.get(), m_structuralLayer.get()); 2358 return true; 2352 2359 } 2353 2360 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r238108 r240047 278 278 } 279 279 280 void commitLayerChangesBeforeSublayers(CommitState&, float pageScaleFactor, const FloatPoint& positionRelativeToBase );280 void commitLayerChangesBeforeSublayers(CommitState&, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool& layerTypeChanged); 281 281 void commitLayerChangesAfterSublayers(CommitState&); 282 282 … … 403 403 void updateContentsOpaque(float pageScaleFactor); 404 404 void updateBackfaceVisibility(); 405 voidupdateStructuralLayer();405 bool updateStructuralLayer(); 406 406 void updateDrawsContent(); 407 407 void updateCoverage(const CommitState&); … … 444 444 StructuralLayerForBackdrop 445 445 }; 446 voidensureStructuralLayer(StructuralLayerPurpose);446 bool ensureStructuralLayer(StructuralLayerPurpose); 447 447 StructuralLayerPurpose structuralLayerPurpose() const; 448 448 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r239985 r240047 2661 2661 } 2662 2662 2663 void RenderLayerBacking::didC ommitChangesForLayer(const GraphicsLayer* layer) const2664 { 2665 compositor().did FlushChangesForLayer(m_owningLayer, layer);2663 void RenderLayerBacking::didChangePlatformLayerForLayer(const GraphicsLayer* layer) 2664 { 2665 compositor().didChangePlatformLayerForLayer(m_owningLayer, layer); 2666 2666 } 2667 2667 -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r239576 r240047 209 209 float pageScaleFactor() const override; 210 210 float zoomedOutPageScaleFactor() const override; 211 void didCommitChangesForLayer(const GraphicsLayer*) const override; 211 212 void didChangePlatformLayerForLayer(const GraphicsLayer*) override; 212 213 bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&) const override; 213 214 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r239985 r240047 537 537 } 538 538 539 void RenderLayerCompositor::did FlushChangesForLayer(RenderLayer& layer, const GraphicsLayer* graphicsLayer)539 void RenderLayerCompositor::didChangePlatformLayerForLayer(RenderLayer& layer, const GraphicsLayer* graphicsLayer) 540 540 { 541 541 if (m_scrollCoordinatedLayers.contains(&layer)) … … 544 544 #if PLATFORM(IOS_FAMILY) 545 545 if (m_legacyScrollingLayerCoordinator) 546 m_legacyScrollingLayerCoordinator->did FlushChangesForLayer(layer);546 m_legacyScrollingLayerCoordinator->didChangePlatformLayerForLayer(layer); 547 547 #endif 548 548 … … 2986 2986 } 2987 2987 2988 void RenderLayerCompositor::didCommitChangesForLayer(const GraphicsLayer*) const2989 {2990 // Nothing to do here yet.2991 }2992 2993 2988 bool RenderLayerCompositor::documentUsesTiledBacking() const 2994 2989 { … … 4231 4226 } 4232 4227 4233 void LegacyWebKitScrollingLayerCoordinator::did FlushChangesForLayer(RenderLayer& layer)4228 void LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer(RenderLayer& layer) 4234 4229 { 4235 4230 if (m_scrollingLayers.contains(&layer)) -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r239658 r240047 108 108 void removeScrollingLayer(RenderLayer&, RenderLayerBacking&); 109 109 110 void did FlushChangesForLayer(RenderLayer&);110 void didChangePlatformLayerForLayer(RenderLayer&); 111 111 112 112 private: … … 160 160 void scheduleLayerFlush(bool canThrottle); 161 161 void flushPendingLayerChanges(bool isFlushRoot = true); 162 162 163 163 // Called when the GraphicsLayer for the given RenderLayer has flushed changes inside of flushPendingLayerChanges(). 164 void did FlushChangesForLayer(RenderLayer&, const GraphicsLayer*);164 void didChangePlatformLayerForLayer(RenderLayer&, const GraphicsLayer*); 165 165 166 166 // Called when something outside WebKit affects the visible rect (e.g. delegated scrolling). Might schedule a layer flush. … … 290 290 float pageScaleFactor() const override; 291 291 float zoomedOutPageScaleFactor() const override; 292 293 void didCommitChangesForLayer(const GraphicsLayer*) const override; 292 void didChangePlatformLayerForLayer(const GraphicsLayer*) override { } 294 293 void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override; 295 294
Note: See TracChangeset
for help on using the changeset viewer.