Changeset 238583 in webkit
- Timestamp:
- Nov 27, 2018, 3:46:18 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r238438 r238583 1125 1125 svg/animations/mozilla/animateMotion-mpath-pathLength-1.svg [ ImageOnlyFailure ] 1126 1126 1127 webkit.org/b/192045 css3/filters/blur-filter-page-scroll-parents.html 1128 webkit.org/b/192045 css3/filters/blur-filter-page-scroll-self.html 1129 webkit.org/b/192045 css3/filters/blur-filter-page-scroll.html 1130 1127 1131 webkit.org/b/159379 fast/history/page-cache-webdatabase-pending-transaction.html [ Pass Failure ] 1128 1132 -
trunk/Source/WebCore/ChangeLog
r238582 r238583 1 2018-11-27 Simon Fraser <simon.fraser@apple.com> 2 3 Avoid triggering compositing updates when only the root layer is composited 4 https://bugs.webkit.org/show_bug.cgi?id=191813 5 6 Reviewed by Zalan Bujtas. 7 8 If we know that the only composited layer is the root, we can avoid triggering deep 9 compositing updates sometimes, for example when layout changes size or position, 10 or when z-order lists change. 11 12 * rendering/RenderLayer.cpp: 13 (WebCore::RenderLayer::addChild): 14 (WebCore::RenderLayer::removeChild): 15 (WebCore::RenderLayer::updateLayerPosition): 16 (WebCore::RenderLayer::scrollTo): 17 (WebCore::RenderLayer::updateCompositingLayersAfterScroll): 18 (WebCore::outputPaintOrderTreeRecursive): 19 * rendering/RenderLayerCompositor.cpp: 20 (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant() 21 flag to cut off descendants traversal when possible. 22 (WebCore::RenderLayerCompositor::layerStyleChanged): 23 1 24 2018-11-27 Eric Carlson <eric.carlson@apple.com> 2 25 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r238576 r238583 406 406 setAncestorChainHasSelfPaintingLayerDescendant(); 407 407 408 if (compositor(). usesCompositing())408 if (compositor().hasContentCompositingLayers()) 409 409 setDescendantsNeedCompositingRequirementsTraversal(); 410 410 … … 452 452 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 453 453 454 if (compositor(). usesCompositing())454 if (compositor().hasContentCompositingLayers()) 455 455 setDescendantsNeedCompositingRequirementsTraversal(); 456 456 … … 1578 1578 setLocation(localPoint); 1579 1579 1580 if (positionOrOffsetChanged && compositor(). usesCompositing()) {1580 if (positionOrOffsetChanged && compositor().hasContentCompositingLayers()) { 1581 1581 if (isComposited()) 1582 1582 setNeedsCompositingGeometryUpdate(); … … 2431 2431 2432 2432 bool requiresRepaint = true; 2433 if ( compositor().usesCompositing() &&usesCompositedScrolling()) {2433 if (usesCompositedScrolling()) { 2434 2434 setNeedsCompositingGeometryUpdate(); 2435 2435 setDescendantsNeedUpdateBackingAndHierarchyTraversal(); … … 2581 2581 void RenderLayer::updateCompositingLayersAfterScroll() 2582 2582 { 2583 if (compositor(). usesCompositing()) {2583 if (compositor().hasContentCompositingLayers()) { 2584 2584 // Our stacking container is guaranteed to contain all of our descendants that may need 2585 2585 // repositioning, so update compositing layers from there. … … 6644 6644 { 6645 6645 stream.nextLine(); 6646 stream << "(S)tacking Context, (N)ormal flow only, (O)verflow clip, (A)lpha (opacity or mask), has (B)lend mode, (I)solates blending, (T)ransform-ish, (F)ilter, Fi(X)ed position, (C)omposited \n"6646 stream << "(S)tacking Context, (N)ormal flow only, (O)verflow clip, (A)lpha (opacity or mask), has (B)lend mode, (I)solates blending, (T)ransform-ish, (F)ilter, Fi(X)ed position, (C)omposited, (c)omposited descendant\n" 6647 6647 "Dirty (z)-lists, Dirty (n)ormal flow lists\n" 6648 6648 "Descendant needs overlap (t)raversal, Descendant needs (b)acking or hierarchy update, All descendants need (r)equirements traversal, All (s)ubsequent layers need requirements traversal, All descendants need (h)ierarchy traversal\n" … … 6671 6671 stream << (layer.renderer().isFixedPositioned() ? "X" : "-"); 6672 6672 stream << (layer.isComposited() ? "C" : "-"); 6673 stream << (layer.hasCompositingDescendant() ? "c" : "-"); 6673 6674 6674 6675 stream << " "; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r238523 r238583 1171 1171 Vector<Ref<GraphicsLayer>> layerChildren; 1172 1172 auto& childList = layerBacking ? layerChildren : childLayersOfEnclosingLayer; 1173 // FIXME: why the !layerBacking check? 1174 bool requireDescendantTraversal = !layerBacking || layer.needsCompositingLayerConnection() || layer.hasDescendantNeedingUpdateBackingOrHierarchyTraversal() || !updateLevel.isEmpty(); 1173 1174 bool requireDescendantTraversal = layer.hasDescendantNeedingUpdateBackingOrHierarchyTraversal() 1175 || (layer.hasCompositingDescendant() && (!layerBacking || layer.needsCompositingLayerConnection() || !updateLevel.isEmpty())); 1175 1176 1176 1177 #if !ASSERT_DISABLED … … 1178 1179 #endif 1179 1180 1181 auto appendForegroundLayerIfNecessary = [&] () { 1182 // If a negative z-order child is compositing, we get a foreground layer which needs to get parented. 1183 if (layer.negativeZOrderLayers().size()) { 1184 if (layerBacking && layerBacking->foregroundLayer()) 1185 childList.append(*layerBacking->foregroundLayer()); 1186 } 1187 }; 1188 1180 1189 if (requireDescendantTraversal) { 1181 1190 for (auto* renderLayer : layer.negativeZOrderLayers()) 1182 1191 updateBackingAndHierarchy(*renderLayer, childList, updateLevel, depth + 1); 1183 1192 1184 // If a negative z-order child is compositing, we get a foreground layer which needs to get parented. 1185 if (layer.negativeZOrderLayers().size()) { 1186 if (layerBacking && layerBacking->foregroundLayer()) 1187 childList.append(*layerBacking->foregroundLayer()); 1188 } 1193 appendForegroundLayerIfNecessary(); 1189 1194 1190 1195 for (auto* renderLayer : layer.normalFlowLayers()) … … 1193 1198 for (auto* renderLayer : layer.positiveZOrderLayers()) 1194 1199 updateBackingAndHierarchy(*renderLayer, childList, updateLevel, depth + 1); 1195 } 1200 } else 1201 appendForegroundLayerIfNecessary(); 1196 1202 1197 1203 if (layerBacking) { … … 1371 1377 layer.setNeedsPostLayoutCompositingUpdate(); 1372 1378 1373 if (diff >= StyleDifference::LayoutPositionedMovementOnly && usesCompositing()) {1379 if (diff >= StyleDifference::LayoutPositionedMovementOnly && hasContentCompositingLayers()) { 1374 1380 layer.setNeedsPostLayoutCompositingUpdate(); 1375 1381 layer.setNeedsCompositingGeometryUpdate();
Note:
See TracChangeset
for help on using the changeset viewer.