Commit dcc344dd authored by schenney@chromium.org's avatar schenney@chromium.org

Don't access compositing state for blending in RenderLayer add/remove child

Code to update the blending status in the RenderLayer hierarchy when a child is added or removed current invokes paintsWithBlendMode which calls compositingState() when it should not. This patch removes the compositing state check in this case, which means we may do more work.

All existing tests pass.

R=senorblanco@chromium.org
BUG=343759

Review URL: https://codereview.chromium.org/211103007

git-svn-id: svn://svn.chromium.org/blink/trunk@170220 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2edd562d
...@@ -855,9 +855,8 @@ void RenderLayer::updateDescendantDependentFlags() ...@@ -855,9 +855,8 @@ void RenderLayer::updateDescendantDependentFlags()
if (!child->stackingNode()->isStackingContext()) if (!child->stackingNode()->isStackingContext())
child->updateDescendantDependentFlags(); child->updateDescendantDependentFlags();
bool childLayerHasBlendMode = child->blendInfo().childLayerHasBlendModeWhileDirty(); bool childLayerHadBlendMode = child->blendInfo().childLayerHasBlendModeWhileDirty();
childLayerHasBlendMode |= child->paintsWithBlendMode() bool childLayerHasBlendMode = childLayerHadBlendMode || child->blendInfo().hasBlendMode();
|| (childLayerHasBlendMode && !child->stackingNode()->isStackingContext());
m_blendInfo.setChildLayerHasBlendMode(childLayerHasBlendMode); m_blendInfo.setChildLayerHasBlendMode(childLayerHasBlendMode);
...@@ -1456,7 +1455,7 @@ void RenderLayer::addChild(RenderLayer* child, RenderLayer* beforeChild) ...@@ -1456,7 +1455,7 @@ void RenderLayer::addChild(RenderLayer* child, RenderLayer* beforeChild)
if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant()) if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant())
setAncestorChainHasSelfPaintingLayerDescendant(); setAncestorChainHasSelfPaintingLayerDescendant();
if (child->paintsWithBlendMode() || child->blendInfo().childLayerHasBlendMode()) if (child->blendInfo().hasBlendMode() || child->blendInfo().childLayerHasBlendMode())
m_blendInfo.setAncestorChainBlendedDescendant(); m_blendInfo.setAncestorChainBlendedDescendant();
if (subtreeContainsOutOfFlowPositionedLayer(child)) { if (subtreeContainsOutOfFlowPositionedLayer(child)) {
...@@ -1520,7 +1519,7 @@ RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild) ...@@ -1520,7 +1519,7 @@ RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild)
if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant) if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant)
dirtyAncestorChainVisibleDescendantStatus(); dirtyAncestorChainVisibleDescendantStatus();
if (oldChild->paintsWithBlendMode() || oldChild->blendInfo().childLayerHasBlendMode()) if (oldChild->m_blendInfo.hasBlendMode() || oldChild->blendInfo().childLayerHasBlendMode())
m_blendInfo.dirtyAncestorChainBlendedDescendantStatus(); m_blendInfo.dirtyAncestorChainBlendedDescendantStatus();
if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescendant()) if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescendant())
...@@ -3671,8 +3670,6 @@ bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const ...@@ -3671,8 +3670,6 @@ bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const
bool RenderLayer::paintsWithBlendMode() const bool RenderLayer::paintsWithBlendMode() const
{ {
// https://code.google.com/p/chromium/issues/detail?id=343759
DisableCompositingQueryAsserts disabler;
return m_blendInfo.hasBlendMode() && compositingState() != PaintsIntoOwnBacking; return m_blendInfo.hasBlendMode() && compositingState() != PaintsIntoOwnBacking;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment