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

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

Issue 568903002: Only have drawsContent() be true for graphics layers if not paintsIntoCompositedAncestor. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix Created 6 years, 3 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 | « no previous file | 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 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698