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

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

Issue 219223008: Revert of Revert of Put the squashing layer underneath the ancestor clipping layer if present. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index f03f62614a7c6c6d19eca779878a3618ab8fa14f..7a67e4caed9214ffd420db7074fde67742d0eb04 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -878,7 +878,11 @@
}
}
- updateSquashingLayerGeometry(delta);
+ {
+ IntPoint squashingDelta(delta);
+ squashingDelta.moveBy(-graphicsLayerParentLocation);
+ updateSquashingLayerGeometry(squashingDelta);
+ }
if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scrollsOverflow())
m_owningLayer.scrollableArea()->positionOverflowControls();
@@ -970,16 +974,16 @@
// The squashing containment layer, if it exists, becomes a no-op parent.
if (m_squashingLayer) {
ASSERT(compositor()->layerSquashingEnabled());
- ASSERT(m_squashingContainmentLayer);
-
- m_squashingContainmentLayer->removeAllChildren();
-
- if (m_ancestorClippingLayer)
- m_squashingContainmentLayer->addChild(m_ancestorClippingLayer.get());
- else
+ ASSERT((m_ancestorClippingLayer && !m_squashingContainmentLayer) || (!m_ancestorClippingLayer && m_squashingContainmentLayer));
+
+ if (m_squashingContainmentLayer) {
+ m_squashingContainmentLayer->removeAllChildren();
m_squashingContainmentLayer->addChild(m_graphicsLayer.get());
-
- m_squashingContainmentLayer->addChild(m_squashingLayer.get());
+ m_squashingContainmentLayer->addChild(m_squashingLayer.get());
+ } else {
+ // The ancestor clipping layer is already set up and has m_graphicsLayer under it.
+ m_ancestorClippingLayer->addChild(m_squashingLayer.get());
+ }
}
}
@@ -1459,23 +1463,23 @@
m_squashingLayer->setDrawsContent(true);
// FIXME: containment layer needs a new CompositingReason, CompositingReasonOverlap is not appropriate.
- m_squashingContainmentLayer = createGraphicsLayer(CompositingReasonLayerForSquashingContainer);
+ if (!m_ancestorClippingLayer)
+ m_squashingContainmentLayer = createGraphicsLayer(CompositingReasonLayerForSquashingContainer);
layersChanged = true;
}
- ASSERT(m_squashingLayer && m_squashingContainmentLayer);
+ ASSERT(m_squashingLayer);
} else {
if (m_squashingLayer) {
m_squashingLayer->removeFromParent();
m_squashingLayer = nullptr;
- // FIXME: do we need to invalidate something here?
-
- ASSERT(m_squashingContainmentLayer);
+ layersChanged = true;
+ }
+ if (m_squashingContainmentLayer) {
m_squashingContainmentLayer->removeFromParent();
m_squashingContainmentLayer = nullptr;
layersChanged = true;
}
-
ASSERT(!m_squashingLayer && !m_squashingContainmentLayer);
}
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698