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

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

Issue 24921002: Make compositingState explicit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: path for re-landing try #2 with removed unnecessary comment Created 7 years, 2 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/page/scrolling/ScrollingCoordinator.cpp ('k') | Source/core/rendering/CompositingState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/CompositedLayerMapping.cpp b/Source/core/rendering/CompositedLayerMapping.cpp
index 848ce8031cc3f76c92673dd5fbc596bfc9a6b84e..ebebd7c29b90b4ee8a26d4ea285308758cf67ba9 100644
--- a/Source/core/rendering/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/CompositedLayerMapping.cpp
@@ -696,7 +696,7 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry()
m_backgroundLayer->setOffsetFromRenderer(m_graphicsLayer->offsetFromRenderer());
}
- if (m_owningLayer->reflectionLayer() && m_owningLayer->reflectionLayer()->isComposited()) {
+ if (m_owningLayer->reflectionLayer() && m_owningLayer->reflectionLayer()->compositedLayerMapping()) {
CompositedLayerMapping* reflectionCompositedLayerMapping = m_owningLayer->reflectionLayer()->compositedLayerMapping();
reflectionCompositedLayerMapping->updateGraphicsLayerGeometry();
@@ -1197,9 +1197,16 @@ float CompositedLayerMapping::compositingOpacity(float rendererOpacity) const
if (!curr->isStackingContainer())
continue;
- // If we found a compositing layer, we want to compute opacity
- // relative to it. So we can break here.
- if (curr->isComposited())
+ // If we found a composited layer, regardless of whether it actually
+ // paints into it, we want to compute opacity relative to it. So we can
+ // break here.
+ //
+ // FIXME: with grouped backings, a composited descendant will have to
+ // continue past the grouped (squashed) layers that its parents may
+ // contribute to. This whole confusion can be avoided by specifying
+ // explicitly the composited ancestor where we would stop accumulating
+ // opacity.
+ if (curr->compositingState() == PaintsIntoOwnBacking || curr->compositingState() == HasOwnBackingButPaintsIntoAncestor)
break;
finalOpacity *= curr->renderer()->opacity();
@@ -1337,7 +1344,7 @@ static bool hasVisibleNonCompositingDescendant(RenderLayer* parent)
size_t listSize = normalFlowList->size();
for (size_t i = 0; i < listSize; ++i) {
RenderLayer* curLayer = normalFlowList->at(i);
- if (!curLayer->isComposited()
+ if (!curLayer->compositedLayerMapping()
&& (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(curLayer)))
return true;
}
@@ -1352,7 +1359,7 @@ static bool hasVisibleNonCompositingDescendant(RenderLayer* parent)
size_t listSize = negZOrderList->size();
for (size_t i = 0; i < listSize; ++i) {
RenderLayer* curLayer = negZOrderList->at(i);
- if (!curLayer->isComposited()
+ if (!curLayer->compositedLayerMapping()
&& (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(curLayer)))
return true;
}
@@ -1362,7 +1369,7 @@ static bool hasVisibleNonCompositingDescendant(RenderLayer* parent)
size_t listSize = posZOrderList->size();
for (size_t i = 0; i < listSize; ++i) {
RenderLayer* curLayer = posZOrderList->at(i);
- if (!curLayer->isComposited()
+ if (!curLayer->compositedLayerMapping()
&& (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(curLayer)))
return true;
}
@@ -1372,7 +1379,9 @@ static bool hasVisibleNonCompositingDescendant(RenderLayer* parent)
return false;
}
-// Conservative test for having no rendered children.
+// FIXME: By name the implementation is correct. But the code that uses this function means something
+// very slightly different - the implementation needs to also include composited descendants that
+// don't paint into their own backing, and instead paint into this backing.
bool CompositedLayerMapping::hasVisibleNonCompositingDescendantLayers() const
{
return hasVisibleNonCompositingDescendant(m_owningLayer);
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.cpp ('k') | Source/core/rendering/CompositingState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698