|
Lines 1061-1069
void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec1
|
| 1061 |
layer.setIndirectCompositingReason(IndirectCompositingReason::Overlap); |
1061 |
layer.setIndirectCompositingReason(IndirectCompositingReason::Overlap); |
| 1062 |
LOG_WITH_STREAM(Compositing, stream << "layer " << &layer << " was sharing now will composite"); |
1062 |
LOG_WITH_STREAM(Compositing, stream << "layer " << &layer << " was sharing now will composite"); |
| 1063 |
} else { |
1063 |
} else { |
| 1064 |
overlapMap.pushCompositingContainer(); |
1064 |
if (!didPushOverlapContainer) { |
| 1065 |
didPushOverlapContainer = true; |
1065 |
overlapMap.pushCompositingContainer(layer); |
| 1066 |
LOG_WITH_STREAM(CompositingOverlap, stream << "layer " << &layer << " will composite, pushed container " << overlapMap); |
1066 |
didPushOverlapContainer = true; |
|
|
1067 |
LOG_WITH_STREAM(CompositingOverlap, stream << "layer " << &layer << " will composite, pushed container " << overlapMap); |
| 1068 |
} |
| 1067 |
} |
1069 |
} |
| 1068 |
|
1070 |
|
| 1069 |
willBeComposited = true; |
1071 |
willBeComposited = true; |
|
Lines 1084-1090
void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec2
|
| 1084 |
layerExtent.animationCausesExtentUncertainty |= layerExtent.hasTransformAnimation && compositingState.ancestorHasTransformAnimation; |
1086 |
layerExtent.animationCausesExtentUncertainty |= layerExtent.hasTransformAnimation && compositingState.ancestorHasTransformAnimation; |
| 1085 |
} else if (layerPaintsIntoProvidedBacking) { |
1087 |
} else if (layerPaintsIntoProvidedBacking) { |
| 1086 |
currentState.backingSharingAncestor = &layer; |
1088 |
currentState.backingSharingAncestor = &layer; |
| 1087 |
overlapMap.pushCompositingContainer(); |
1089 |
overlapMap.pushCompositingContainer(layer); |
| 1088 |
didPushOverlapContainer = true; |
1090 |
didPushOverlapContainer = true; |
| 1089 |
LOG_WITH_STREAM(CompositingOverlap, stream << "layer " << &layer << " will share, pushed container " << overlapMap); |
1091 |
LOG_WITH_STREAM(CompositingOverlap, stream << "layer " << &layer << " will share, pushed container " << overlapMap); |
| 1090 |
} |
1092 |
} |
|
Lines 1098-1115
void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec3
|
| 1098 |
bool anyDescendantHas3DTransform = false; |
1100 |
bool anyDescendantHas3DTransform = false; |
| 1099 |
bool descendantsAddedToOverlap = currentState.hasNonRootCompositedAncestor(); |
1101 |
bool descendantsAddedToOverlap = currentState.hasNonRootCompositedAncestor(); |
| 1100 |
|
1102 |
|
| 1101 |
unsigned newlyCompositedChildLayerCount = 0; |
1103 |
if (layer.hasNegativeZOrderLayers()) { |
| 1102 |
for (auto* childLayer : layer.negativeZOrderLayers()) { |
1104 |
// Speculatively push this layer onto the overlap map. |
| 1103 |
computeCompositingRequirements(&layer, *childLayer, overlapMap, currentState, backingSharingState, anyDescendantHas3DTransform); |
1105 |
bool didSpeculativelyPushOverlapContainer = false; |
|
|
1106 |
if (!didPushOverlapContainer) { |
| 1107 |
overlapMap.pushCompositingContainer(layer); |
| 1108 |
didPushOverlapContainer = true; |
| 1109 |
didSpeculativelyPushOverlapContainer = true; |
| 1110 |
} |
| 1104 |
|
1111 |
|
| 1105 |
// If we have to make a layer for this child, make one now so we can have a contents layer |
1112 |
bool compositeForNegativeZOrderDescendant = false; |
| 1106 |
// (since we need to ensure that the -ve z-order child renders underneath our contents). |
1113 |
|
| 1107 |
if (!willBeComposited && currentState.subtreeIsCompositing) |
1114 |
for (auto* childLayer : layer.negativeZOrderLayers()) { |
| 1108 |
++newlyCompositedChildLayerCount; |
1115 |
computeCompositingRequirements(&layer, *childLayer, overlapMap, currentState, backingSharingState, anyDescendantHas3DTransform); |
| 1109 |
} |
1116 |
|
| 1110 |
while (newlyCompositedChildLayerCount--) { |
1117 |
// If we have to make a layer for this child, make one now so we can have a contents layer |
| 1111 |
layer.setIndirectCompositingReason(IndirectCompositingReason::BackgroundLayer); |
1118 |
// (since we need to ensure that the -ve z-order child renders underneath our contents). |
| 1112 |
layerWillComposite(); |
1119 |
if (!willBeComposited && currentState.subtreeIsCompositing) { |
|
|
1120 |
layer.setIndirectCompositingReason(IndirectCompositingReason::BackgroundLayer); |
| 1121 |
layerWillComposite(); |
| 1122 |
compositeForNegativeZOrderDescendant = true; |
| 1123 |
} |
| 1124 |
} |
| 1125 |
|
| 1126 |
if (!compositeForNegativeZOrderDescendant && didSpeculativelyPushOverlapContainer) { |
| 1127 |
overlapMap.popCompositingContainer(layer); |
| 1128 |
didPushOverlapContainer = false; |
| 1129 |
} |
| 1113 |
} |
1130 |
} |
| 1114 |
|
1131 |
|
| 1115 |
for (auto* childLayer : layer.normalFlowLayers()) |
1132 |
for (auto* childLayer : layer.normalFlowLayers()) |
|
Lines 1246-1252
void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer,
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec4
|
| 1246 |
// This layer now acts as the ancestor for kids. |
1263 |
// This layer now acts as the ancestor for kids. |
| 1247 |
currentState.compositingAncestor = &layer; |
1264 |
currentState.compositingAncestor = &layer; |
| 1248 |
currentState.backingSharingAncestor = nullptr; |
1265 |
currentState.backingSharingAncestor = nullptr; |
| 1249 |
overlapMap.pushCompositingContainer(); |
1266 |
overlapMap.pushCompositingContainer(layer); |
| 1250 |
didPushOverlapContainer = true; |
1267 |
didPushOverlapContainer = true; |
| 1251 |
LOG_WITH_STREAM(CompositingOverlap, stream << "unchangedSubtree: layer " << &layer << " will composite, pushed container " << overlapMap); |
1268 |
LOG_WITH_STREAM(CompositingOverlap, stream << "unchangedSubtree: layer " << &layer << " will composite, pushed container " << overlapMap); |
| 1252 |
|
1269 |
|
|
Lines 1255-1261
void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer,
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec5
|
| 1255 |
// Too hard to compute animated bounds if both us and some ancestor is animating transform. |
1272 |
// Too hard to compute animated bounds if both us and some ancestor is animating transform. |
| 1256 |
layerExtent.animationCausesExtentUncertainty |= layerExtent.hasTransformAnimation && compositingState.ancestorHasTransformAnimation; |
1273 |
layerExtent.animationCausesExtentUncertainty |= layerExtent.hasTransformAnimation && compositingState.ancestorHasTransformAnimation; |
| 1257 |
} else if (layerPaintsIntoProvidedBacking) { |
1274 |
} else if (layerPaintsIntoProvidedBacking) { |
| 1258 |
overlapMap.pushCompositingContainer(); |
1275 |
overlapMap.pushCompositingContainer(layer); |
| 1259 |
currentState.backingSharingAncestor = &layer; |
1276 |
currentState.backingSharingAncestor = &layer; |
| 1260 |
didPushOverlapContainer = true; |
1277 |
didPushOverlapContainer = true; |
| 1261 |
LOG_WITH_STREAM(CompositingOverlap, stream << "unchangedSubtree: layer " << &layer << " will share, pushed container " << overlapMap); |
1278 |
LOG_WITH_STREAM(CompositingOverlap, stream << "unchangedSubtree: layer " << &layer << " will share, pushed container " << overlapMap); |
|
Lines 2141-2150
void RenderLayerCompositor::addDescendantsToOverlapMapRecursive(LayerOverlapMap&
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec6
|
| 2141 |
|
2158 |
|
| 2142 |
void RenderLayerCompositor::updateOverlapMap(LayerOverlapMap& overlapMap, const RenderLayer& layer, OverlapExtent& layerExtent, bool didPushContainer, bool addLayerToOverlap, bool addDescendantsToOverlap) const |
2159 |
void RenderLayerCompositor::updateOverlapMap(LayerOverlapMap& overlapMap, const RenderLayer& layer, OverlapExtent& layerExtent, bool didPushContainer, bool addLayerToOverlap, bool addDescendantsToOverlap) const |
| 2143 |
{ |
2160 |
{ |
| 2144 |
if (addLayerToOverlap) { |
2161 |
if (addLayerToOverlap) |
| 2145 |
addToOverlapMap(overlapMap, layer, layerExtent); |
2162 |
addToOverlapMap(overlapMap, layer, layerExtent); |
| 2146 |
LOG_WITH_STREAM(CompositingOverlap, stream << "layer " << &layer << " contributes to overlap, added to map " << overlapMap); |
|
|
| 2147 |
} |
| 2148 |
|
2163 |
|
| 2149 |
if (addDescendantsToOverlap) { |
2164 |
if (addDescendantsToOverlap) { |
| 2150 |
// If this is the first non-root layer to composite, we need to add all the descendants we already traversed to the overlap map. |
2165 |
// If this is the first non-root layer to composite, we need to add all the descendants we already traversed to the overlap map. |
|
Lines 2153-2159
void RenderLayerCompositor::updateOverlapMap(LayerOverlapMap& overlapMap, const
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec7
|
| 2153 |
} |
2168 |
} |
| 2154 |
|
2169 |
|
| 2155 |
if (didPushContainer) { |
2170 |
if (didPushContainer) { |
| 2156 |
overlapMap.popCompositingContainer(); |
2171 |
overlapMap.popCompositingContainer(layer); |
| 2157 |
LOG_WITH_STREAM(CompositingOverlap, stream << "layer " << &layer << " is composited or shared, popped container " << overlapMap); |
2172 |
LOG_WITH_STREAM(CompositingOverlap, stream << "layer " << &layer << " is composited or shared, popped container " << overlapMap); |
| 2158 |
} |
2173 |
} |
| 2159 |
} |
2174 |
} |