Changeset 245375 in webkit
- Timestamp:
- May 15, 2019 10:41:08 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r245373 r245375 1 2019-05-15 Simon Fraser <simon.fraser@apple.com> 2 3 Avoid a recursive descendants layer walk sometimes 4 https://bugs.webkit.org/show_bug.cgi?id=197939 5 6 Reviewed by Zalan Bujtas. 7 8 If a layer got composited post-descendants because it needs to clip, for example, we'd do a recursive 9 descendant tree walk to add layers to the overlap map. However, all the descendants would already 10 have contributed to the overlap map if some non-root ancestor was already composited. So we can 11 skip the addDescendantsToOverlapMapRecursive() if we know, before descendants, whether there's 12 a non-root composited ancestor. 13 14 * rendering/RenderLayerCompositor.cpp: 15 (WebCore::RenderLayerCompositor::CompositingState::hasNonRootCompositedAncestor const): 16 (WebCore::RenderLayerCompositor::computeCompositingRequirements): 17 1 18 2019-05-15 Simon Fraser <simon.fraser@apple.com> 2 19 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r245373 r245375 176 176 } 177 177 178 bool hasNonRootCompositedAncestor() const 179 { 180 return compositingAncestor && !compositingAncestor->isRenderViewLayer(); 181 } 182 178 183 RenderLayer* compositingAncestor; 179 184 RenderLayer* backingSharingAncestor { nullptr }; … … 856 861 bool willBeComposited = layer.isComposited(); 857 862 bool becameCompositedAfterDescendantTraversal = false; 863 858 864 if (layer.needsPostLayoutCompositingUpdate() || compositingState.fullPaintOrderTraversalRequired || compositingState.descendantsRequireCompositingUpdate) { 859 865 layer.setIndirectCompositingReason(RenderLayer::IndirectCompositingReason::None); … … 952 958 953 959 bool anyDescendantHas3DTransform = false; 960 bool descendantsAddedToOverlap = currentState.hasNonRootCompositedAncestor(); 954 961 955 962 for (auto* childLayer : layer.negativeZOrderLayers()) { … … 1049 1056 1050 1057 bool layerContributesToOverlap = currentState.compositingAncestor && !currentState.compositingAncestor->isRenderViewLayer(); 1051 updateOverlapMap(overlapMap, layer, layerExtent, layerContributesToOverlap, becameCompositedAfterDescendantTraversal );1058 updateOverlapMap(overlapMap, layer, layerExtent, layerContributesToOverlap, becameCompositedAfterDescendantTraversal && !descendantsAddedToOverlap); 1052 1059 1053 1060 // Pop backing/overlap sharing state.
Note: See TracChangeset
for help on using the changeset viewer.