Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1228)

Unified Diff: Source/core/rendering/compositing/CompositingLayerAssigner.cpp

Issue 785333002: Delete the Layer Squashing runtime feature. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/compositing/CompositingLayerAssigner.cpp
diff --git a/Source/core/rendering/compositing/CompositingLayerAssigner.cpp b/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
index 16037d1c0204fe43713799769d84b5ff22d387e1..d9c3a280e483bb6bc23d44da7acb8fbf2ff22276 100644
--- a/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
+++ b/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
@@ -39,7 +39,6 @@ static uint64_t gSquashingSparsityTolerance = 6;
CompositingLayerAssigner::CompositingLayerAssigner(RenderLayerCompositor* compositor)
: m_compositor(compositor)
- , m_layerSquashingEnabled(compositor->layerSquashingEnabled())
, m_layersChanged(false)
{
}
@@ -86,10 +85,7 @@ bool CompositingLayerAssigner::needsOwnBacking(const RenderLayer* layer) const
if (!m_compositor->canBeComposited(layer))
return false;
- // If squashing is disabled, then layers that would have been squashed should just be separately composited.
- bool needsOwnBackingForDisabledSquashing = !m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons());
-
- return requiresCompositing(layer->compositingReasons()) || needsOwnBackingForDisabledSquashing || (m_compositor->staleInCompositingMode() && layer->isRootLayer());
+ return requiresCompositing(layer->compositingReasons()) || (m_compositor->staleInCompositingMode() && layer->isRootLayer());
}
CompositingStateTransitionType CompositingLayerAssigner::computeCompositedLayerUpdate(RenderLayer* layer)
@@ -103,14 +99,12 @@ CompositingStateTransitionType CompositingLayerAssigner::computeCompositedLayerU
if (layer->hasCompositedLayerMapping())
update = RemoveOwnCompositedLayerMapping;
- if (m_layerSquashingEnabled) {
- if (!layer->subtreeIsInvisible() && requiresSquashing(layer->compositingReasons())) {
- // We can't compute at this time whether the squashing layer update is a no-op,
- // since that requires walking the render layer tree.
- update = PutInSquashingLayer;
- } else if (layer->groupedMapping() || layer->lostGroupedMapping()) {
- update = RemoveFromSquashingLayer;
- }
+ if (!layer->subtreeIsInvisible() && requiresSquashing(layer->compositingReasons())) {
+ // We can't compute at this time whether the squashing layer update is a no-op,
+ // since that requires walking the render layer tree.
+ update = PutInSquashingLayer;
+ } else if (layer->groupedMapping() || layer->lostGroupedMapping()) {
+ update = RemoveFromSquashingLayer;
}
}
return update;
@@ -237,7 +231,7 @@ void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(RenderLa
void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer, SquashingState& squashingState, Vector<RenderLayer*>& layersNeedingPaintInvalidation)
{
- if (m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons())) {
+ if (requiresSquashing(layer->compositingReasons())) {
CompositingReasons reasonsPreventingSquashing = getReasonsPreventingSquashing(layer, squashingState);
if (reasonsPreventingSquashing)
layer->setCompositingReasons(layer->compositingReasons() | reasonsPreventingSquashing);
@@ -256,16 +250,14 @@ void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer
assignLayersToBackingsForReflectionLayer(layer->reflectionInfo()->reflectionLayer(), layersNeedingPaintInvalidation);
// Add this layer to a squashing backing if needed.
- if (m_layerSquashingEnabled) {
- updateSquashingAssignment(layer, squashingState, compositedLayerUpdate, layersNeedingPaintInvalidation);
-
- const bool layerIsSquashed = compositedLayerUpdate == PutInSquashingLayer || (compositedLayerUpdate == NoCompositingStateChange && layer->groupedMapping());
- if (layerIsSquashed) {
- squashingState.nextSquashedLayerIndex++;
- IntRect layerBounds = layer->clippedAbsoluteBoundingBox();
- squashingState.totalAreaOfSquashedRects += layerBounds.size().area();
- squashingState.boundingRect.unite(layerBounds);
- }
+ updateSquashingAssignment(layer, squashingState, compositedLayerUpdate, layersNeedingPaintInvalidation);
+
+ const bool layerIsSquashed = compositedLayerUpdate == PutInSquashingLayer || (compositedLayerUpdate == NoCompositingStateChange && layer->groupedMapping());
+ if (layerIsSquashed) {
+ squashingState.nextSquashedLayerIndex++;
+ IntRect layerBounds = layer->clippedAbsoluteBoundingBox();
+ squashingState.totalAreaOfSquashedRects += layerBounds.size().area();
+ squashingState.boundingRect.unite(layerBounds);
}
if (layer->stackingNode()->isStackingContext()) {
@@ -274,12 +266,10 @@ void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer
assignLayersToBackingsInternal(curNode->layer(), squashingState, layersNeedingPaintInvalidation);
}
- if (m_layerSquashingEnabled) {
- // At this point, if the layer is to be separately composited, then its backing becomes the most recent in paint-order.
- if (layer->compositingState() == PaintsIntoOwnBacking) {
- ASSERT(!requiresSquashing(layer->compositingReasons()));
- squashingState.updateSquashingStateForNewMapping(layer->compositedLayerMapping(), layer->hasCompositedLayerMapping());
- }
+ // At this point, if the layer is to be separately composited, then its backing becomes the most recent in paint-order.
+ if (layer->compositingState() == PaintsIntoOwnBacking) {
+ ASSERT(!requiresSquashing(layer->compositingReasons()));
+ squashingState.updateSquashingStateForNewMapping(layer->compositedLayerMapping(), layer->hasCompositedLayerMapping());
}
if (layer->scrollParent())

Powered by Google App Engine
This is Rietveld 408576698