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

Unified Diff: Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp

Issue 1114543004: Avoid creating ancestor clipping layers for scroll children (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adding a layout test. Created 5 years, 8 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/layout/compositing/CompositedDeprecatedPaintLayerMapping.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp
diff --git a/Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp b/Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp
index 8e4f3920d887ec58d2a21caa1328de8c2e571b63..abe81e8fff6d6019dc214fba899bd9e8946ba7aa 100644
--- a/Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp
+++ b/Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp
@@ -357,7 +357,7 @@ void CompositedDeprecatedPaintLayerMapping::updateCompositingReasons()
m_graphicsLayer->setCompositingReasons(m_owningLayer.compositingReasons());
}
-bool CompositedDeprecatedPaintLayerMapping::owningLayerClippedByLayerNotAboveCompositedAncestor()
+bool CompositedDeprecatedPaintLayerMapping::owningLayerClippedByLayerNotAboveCompositedAncestor(DeprecatedPaintLayer* scrollParent)
{
if (!m_owningLayer.parent())
return false;
@@ -370,6 +370,9 @@ bool CompositedDeprecatedPaintLayerMapping::owningLayerClippedByLayerNotAboveCom
if (!clippingContainer)
return false;
+ if (clippingContainer->enclosingLayer() == scrollParent)
+ return false;
+
if (compositingAncestor->layoutObject()->isDescendantOf(clippingContainer))
return false;
@@ -426,14 +429,7 @@ bool CompositedDeprecatedPaintLayerMapping::updateGraphicsLayerConfiguration()
// DeprecatedPaintLayer that is an ancestor in the layoutObject hierarchy, but a sibling in the z-order
// hierarchy. Further, that sibling need not be composited at all. In such scenarios, an ancestor
// clipping layer is necessary to apply the composited clip for this layer.
- bool needsAncestorClip = owningLayerClippedByLayerNotAboveCompositedAncestor();
-
- if (scrollParent) {
- // If our containing block is our ancestor scrolling layer, then we'll already be clipped
- // to it via our scroll parent and we don't need an ancestor clipping layer.
- if (m_owningLayer.layoutObject()->containingBlock()->enclosingLayer() == m_owningLayer.ancestorScrollingLayer())
- needsAncestorClip = false;
- }
+ bool needsAncestorClip = owningLayerClippedByLayerNotAboveCompositedAncestor(scrollParent);
if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer))
layerConfigChanged = true;
@@ -459,7 +455,7 @@ bool CompositedDeprecatedPaintLayerMapping::updateGraphicsLayerConfiguration()
layerConfigChanged = true;
updateScrollParent(scrollParent);
- updateClipParent();
+ updateClipParent(scrollParent);
if (layerConfigChanged)
updateInternalHierarchy();
@@ -1628,9 +1624,9 @@ static void updateClipParentForGraphicsLayer(GraphicsLayer* layer, GraphicsLayer
scrollingCoordinator->updateClipParentForGraphicsLayer(layer, clipParent);
}
-void CompositedDeprecatedPaintLayerMapping::updateClipParent()
+void CompositedDeprecatedPaintLayerMapping::updateClipParent(DeprecatedPaintLayer* scrollParent)
{
- if (owningLayerClippedByLayerNotAboveCompositedAncestor())
+ if (owningLayerClippedByLayerNotAboveCompositedAncestor(scrollParent))
return;
DeprecatedPaintLayer* clipParent = m_owningLayer.clipParent();
« no previous file with comments | « Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698