Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp |
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp |
index 4790c71d45174ed042217a4304b7c839504350ae..245067c3d85525fe0774a81244cc7354e5df13ed 100644 |
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp |
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp |
@@ -1134,7 +1134,7 @@ void CompositedLayerMapping::updateScrollingBlockSelection() |
const IntRect blockSelectionGapsBounds = m_owningLayer.blockSelectionGapsBounds(); |
const bool shouldDrawContent = !blockSelectionGapsBounds.isEmpty(); |
- m_scrollingBlockSelectionLayer->setDrawsContent(shouldDrawContent); |
+ m_scrollingBlockSelectionLayer->setDrawsContent(!paintsIntoCompositedAncestor() && shouldDrawContent); |
if (!shouldDrawContent) |
return; |
@@ -1156,7 +1156,7 @@ void CompositedLayerMapping::updateDrawsContent() |
// m_scrollingLayer never has backing store. |
// m_scrollingContentsLayer only needs backing store if the scrolled contents need to paint. |
m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(renderer()->hasBackground() || paintsChildren()); |
- m_scrollingContentsLayer->setDrawsContent(!m_scrollingContentsAreEmpty); |
+ m_scrollingContentsLayer->setDrawsContent(!paintsIntoCompositedAncestor() && !m_scrollingContentsAreEmpty); |
updateScrollingBlockSelection(); |
} |
@@ -1179,6 +1179,12 @@ void CompositedLayerMapping::updateDrawsContent() |
if (m_backgroundLayer) |
m_backgroundLayer->setDrawsContent(hasPaintedContent); |
+ |
+ if (m_maskLayer) |
+ m_maskLayer->setDrawsContent(!paintsIntoCompositedAncestor()); |
+ |
+ if (m_childClippingMaskLayer) |
+ m_childClippingMaskLayer->setDrawsContent(!paintsIntoCompositedAncestor()); |
} |
void CompositedLayerMapping::updateChildrenTransform() |
@@ -1455,7 +1461,6 @@ bool CompositedLayerMapping::updateForegroundLayer(bool needsForegroundLayer) |
if (needsForegroundLayer) { |
if (!m_foregroundLayer) { |
m_foregroundLayer = createGraphicsLayer(CompositingReasonLayerForForeground); |
- m_foregroundLayer->setDrawsContent(true); |
m_foregroundLayer->setPaintingPhase(GraphicsLayerPaintForeground); |
layerChanged = true; |
} |
@@ -1474,7 +1479,6 @@ bool CompositedLayerMapping::updateBackgroundLayer(bool needsBackgroundLayer) |
if (needsBackgroundLayer) { |
if (!m_backgroundLayer) { |
m_backgroundLayer = createGraphicsLayer(CompositingReasonLayerForBackground); |
- m_backgroundLayer->setDrawsContent(true); |
m_backgroundLayer->setTransformOrigin(FloatPoint3D()); |
m_backgroundLayer->setPaintingPhase(GraphicsLayerPaintBackground); |
#if !OS(ANDROID) |
@@ -1506,7 +1510,6 @@ bool CompositedLayerMapping::updateMaskLayer(bool needsMaskLayer) |
if (needsMaskLayer) { |
if (!m_maskLayer) { |
m_maskLayer = createGraphicsLayer(CompositingReasonLayerForMask); |
- m_maskLayer->setDrawsContent(true); |
m_maskLayer->setPaintingPhase(GraphicsLayerPaintMask); |
layerChanged = true; |
} |
@@ -1524,7 +1527,6 @@ bool CompositedLayerMapping::updateClippingMaskLayers(bool needsChildClippingMas |
if (needsChildClippingMaskLayer) { |
if (!m_childClippingMaskLayer) { |
m_childClippingMaskLayer = createGraphicsLayer(CompositingReasonLayerForClippingMask); |
- m_childClippingMaskLayer->setDrawsContent(true); |
m_childClippingMaskLayer->setPaintingPhase(GraphicsLayerPaintChildClippingMask); |
layerChanged = true; |
} |
@@ -1549,7 +1551,6 @@ bool CompositedLayerMapping::updateScrollingLayers(bool needsScrollingLayers) |
// Inner layer which renders the content that scrolls. |
m_scrollingContentsLayer = createGraphicsLayer(CompositingReasonLayerForScrollingContents); |
- m_scrollingContentsLayer->setDrawsContent(true); |
m_scrollingLayer->addChild(m_scrollingContentsLayer.get()); |
m_scrollingBlockSelectionLayer = createGraphicsLayer(CompositingReasonLayerForScrollingBlockSelection); |