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

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

Issue 195893026: Fix restrictions on squashing with incompatible scroll. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo Created 6 years, 9 months 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/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/compositing/RenderLayerCompositor.cpp b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
index 1ec3750969ebc2b8613ca5c6ebce60d59bc70495..60f14a8d97add7bdb701bdb869aa38682a22d067 100644
--- a/Source/core/rendering/compositing/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
@@ -727,7 +727,14 @@ bool RenderLayerCompositor::updateLayerIfViewportConstrained(RenderLayer* layer)
bool RenderLayerCompositor::canSquashIntoCurrentSquashingOwner(const RenderLayer* layer, const RenderLayerCompositor::SquashingState& squashingState, const RenderLayer* clippingAncestor)
{
ASSERT(clippingAncestor);
- return clippingAncestor == squashingState.clippingAncestorForMostRecentMapping;
+ if (clippingAncestor != squashingState.clippingAncestorForMostRecentMapping)
+ return false;
+
+ ASSERT(squashingState.hasMostRecentMapping);
+ if (layer->scrollsWithRespectTo(&squashingState.mostRecentMapping->owningLayer()))
+ return false;
+
+ return true;
}
RenderLayerCompositor::CompositingStateTransitionType RenderLayerCompositor::computeCompositedLayerUpdate(RenderLayer* layer)
@@ -947,15 +954,6 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
reasonsToComposite |= overlapCompositingReason;
- // If the layer is squashable, but would scroll differently than the
- // most recent backing that it would squash onto, then don't squash it.
- // Note that this happens before we know all possible compositing reasons
- // for this layer, but it's OK because we're just forcing the layer conservatively
- // to be separately composited rather than squashed, anyway.
- if (currentRecursionData.m_mostRecentCompositedLayer && requiresSquashing(reasonsToComposite)
- && layer->scrollsWithRespectTo(currentRecursionData.m_mostRecentCompositedLayer))
- reasonsToComposite |= CompositingReasonOverlapsWithoutSquashingTarget;
-
// The children of this layer don't need to composite, unless there is
// a compositing layer among them, so start by inheriting the compositing
// ancestor with m_subtreeIsCompositing set to false.
@@ -1179,7 +1177,7 @@ void RenderLayerCompositor::assignLayersToBackingsInternal(RenderLayer* layer, S
clippingAncestor = layer;
if (layerSquashingEnabled() && requiresSquashing(layer->compositingReasons()) && !canSquashIntoCurrentSquashingOwner(layer, squashingState, clippingAncestor))
- layer->setCompositingReasons(layer->compositingReasons() | CompositingReasonOverlapsWithoutSquashingTarget);
+ layer->setCompositingReasons(layer->compositingReasons() | CompositingReasonNoSquashingTargetFound);
CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer);
« no previous file with comments | « LayoutTests/compositing/squashing/squash-above-fixed-2-expected.txt ('k') | Source/platform/graphics/CompositingReasons.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698