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

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

Issue 466193002: Disentangle blend mode from updateDescendantDependentFlags (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/RenderLayer.h ('k') | Source/core/rendering/RenderLayerBlendInfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index c3b5c5d783a2dcb7b8cc243695923534183771a4..6bc1286b94051337f70424d04b3ffb936560af9c 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -139,7 +139,6 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer, LayerType type)
, m_groupedMapping(0)
, m_repainter(*renderer)
, m_clipper(*renderer)
- , m_blendInfo(*renderer)
{
updateStackingNode();
@@ -670,23 +669,6 @@ void RenderLayer::updateDescendantDependentFlags()
m_visibleDescendantStatusDirty = false;
}
- if (m_blendInfo.childLayerHasBlendModeStatusDirty()) {
- m_blendInfo.setChildLayerHasBlendMode(false);
- for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
- if (!child->stackingNode()->isStackingContext())
- child->updateDescendantDependentFlags();
-
- bool childLayerHadBlendMode = child->blendInfo().childLayerHasBlendModeWhileDirty();
- bool childLayerHasBlendMode = childLayerHadBlendMode || child->blendInfo().hasBlendMode();
-
- m_blendInfo.setChildLayerHasBlendMode(childLayerHasBlendMode);
-
- if (childLayerHasBlendMode)
- break;
- }
- m_blendInfo.setChildLayerHasBlendModeStatusDirty(false);
- }
-
if (m_visibleContentStatusDirty) {
bool previouslyHasVisibleContent = m_hasVisibleContent;
if (renderer()->style()->visibility() == VISIBLE)
@@ -1192,7 +1174,7 @@ LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou
void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior paintBehavior)
{
- bool createTransparencyLayerForBlendMode = m_stackingNode->isStackingContext() && m_blendInfo.childLayerHasBlendMode();
+ bool createTransparencyLayerForBlendMode = m_stackingNode->isStackingContext() && hasDescendantWithBlendMode();
if ((paintsWithTransparency(paintBehavior) || paintsWithBlendMode() || createTransparencyLayerForBlendMode) && m_usedTransparency)
return;
@@ -1207,7 +1189,7 @@ void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render
context->clip(clipRect);
if (paintsWithBlendMode())
- context->setCompositeOperation(context->compositeOperation(), m_blendInfo.blendMode());
+ context->setCompositeOperation(context->compositeOperation(), m_renderer->style()->blendMode());
context->beginTransparencyLayer(renderer()->opacity());
@@ -1265,9 +1247,6 @@ void RenderLayer::addChild(RenderLayer* child, RenderLayer* beforeChild)
dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
child->updateDescendantDependentFlags();
-
- if (child->blendInfo().hasBlendMode() || child->blendInfo().childLayerHasBlendMode())
- m_blendInfo.setAncestorChainBlendedDescendant();
}
RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild)
@@ -1306,9 +1285,6 @@ RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild)
if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant)
dirtyAncestorChainVisibleDescendantStatus();
- if (oldChild->m_blendInfo.hasBlendMode() || oldChild->blendInfo().childLayerHasBlendMode())
- m_blendInfo.dirtyAncestorChainBlendedDescendantStatus();
-
return oldChild;
}
@@ -1802,7 +1778,7 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
// Blending operations must be performed only with the nearest ancestor stacking context.
// Note that there is no need to create a transparency layer if we're painting the root.
- bool createTransparencyLayerForBlendMode = !renderer()->isDocumentElement() && m_stackingNode->isStackingContext() && m_blendInfo.childLayerHasBlendMode();
+ bool createTransparencyLayerForBlendMode = !renderer()->isDocumentElement() && m_stackingNode->isStackingContext() && hasDescendantWithBlendMode();
if (createTransparencyLayerForBlendMode)
beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, paintingInfo.subPixelAccumulation, paintingInfo.paintBehavior);
@@ -3261,9 +3237,6 @@ CompositedLayerMapping* RenderLayer::ensureCompositedLayerMapping()
m_compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLayerUpdateSubtree);
updateOrRemoveFilterEffectRenderer();
-
- if (RuntimeEnabledFeatures::cssCompositingEnabled())
- compositedLayerMapping()->setBlendMode(m_blendInfo.blendMode());
}
return m_compositedLayerMapping.get();
}
@@ -3325,7 +3298,7 @@ bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const
bool RenderLayer::paintsWithBlendMode() const
{
- return m_blendInfo.hasBlendMode() && compositingState() != PaintsIntoOwnBacking;
+ return m_renderer->hasBlendMode() && compositingState() != PaintsIntoOwnBacking;
}
bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const
@@ -3546,9 +3519,6 @@ void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle
updateReflectionInfo(oldStyle);
}
- if (RuntimeEnabledFeatures::cssCompositingEnabled())
- m_blendInfo.updateBlendMode();
-
updateDescendantDependentFlags();
updateTransform(oldStyle, renderer()->style());
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerBlendInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698