Chromium Code Reviews| Index: Source/core/rendering/RenderLayerCompositor.cpp |
| diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp |
| index d8e9ddc4be06c9625b0d8fde53686a22829d9a09..22937c72b4216774d79c33989bec77034e3d49c5 100644 |
| --- a/Source/core/rendering/RenderLayerCompositor.cpp |
| +++ b/Source/core/rendering/RenderLayerCompositor.cpp |
| @@ -177,6 +177,7 @@ struct CompositingRecursionData { |
| CompositingRecursionData(RenderLayer* compAncestor, bool testOverlap) |
| : m_compositingAncestor(compAncestor) |
| , m_subtreeIsCompositing(false) |
| + , m_hasCompositedBlendingDescendants(false) |
|
enne (OOO)
2013/11/11 21:52:46
Can you rename this to make it more clear? At firs
rosca
2013/11/12 20:27:07
I think hasUnisolatedCompositedBlendingDescendant
|
| , m_testingOverlap(testOverlap) |
| #ifndef NDEBUG |
| , m_depth(0) |
| @@ -187,6 +188,7 @@ struct CompositingRecursionData { |
| CompositingRecursionData(const CompositingRecursionData& other) |
| : m_compositingAncestor(other.m_compositingAncestor) |
| , m_subtreeIsCompositing(other.m_subtreeIsCompositing) |
| + , m_hasCompositedBlendingDescendants(other.m_hasCompositedBlendingDescendants) |
| , m_testingOverlap(other.m_testingOverlap) |
| #ifndef NDEBUG |
| , m_depth(other.m_depth + 1) |
| @@ -196,6 +198,7 @@ struct CompositingRecursionData { |
| RenderLayer* m_compositingAncestor; |
| bool m_subtreeIsCompositing; |
| + bool m_hasCompositedBlendingDescendants; |
| bool m_testingOverlap; |
| #ifndef NDEBUG |
| int m_depth; |
| @@ -909,6 +912,11 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor |
| if (overlapMap && childRecursionData.m_compositingAncestor && !childRecursionData.m_compositingAncestor->isRootLayer()) |
| addToOverlapMap(*overlapMap, layer, absBounds, haveComputedBounds); |
| + layer->setRequiresIsolationForCompositedStackingContext(childRecursionData.m_hasCompositedBlendingDescendants); |
| + |
| + if (layer->requiresIsolationForCompositedStackingContext() && !layer->stackingNode()->isStackingContext()) |
| + currentRecursionData.m_hasCompositedBlendingDescendants = true; |
| + |
| // Now check for reasons to become composited that depend on the state of descendant layers. |
| CompositingReasons subtreeCompositingReasons = subtreeReasonsForCompositing(layer->renderer(), childRecursionData.m_subtreeIsCompositing, anyDescendantHas3DTransform); |
| reasonsToComposite |= subtreeCompositingReasons; |
| @@ -935,6 +943,9 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor |
| if (childRecursionData.m_subtreeIsCompositing) |
| currentRecursionData.m_subtreeIsCompositing = true; |
| + if (willBeComposited && layer->hasBlendMode()) |
| + currentRecursionData.m_hasCompositedBlendingDescendants = true; |
| + |
| // Set the flag to say that this SC has compositing children. |
| layer->setHasCompositingDescendant(childRecursionData.m_subtreeIsCompositing); |
| @@ -1712,6 +1723,8 @@ CompositingReasons RenderLayerCompositor::subtreeReasonsForCompositing(RenderObj |
| if (hasCompositedDescendants) { |
| if (layer->transform()) |
| subtreeReasons |= CompositingReasonTransformWithCompositedDescendants; |
| + if (layer->requiresIsolationForCompositedStackingContext() && layer->stackingNode()->isStackingContext()) |
|
enne (OOO)
2013/11/11 21:52:46
It's a little awkward to set a "requires ... for s
rosca
2013/11/12 20:27:07
Yes, done. In this case I think it's more appropri
|
| + subtreeReasons |= CompositingReasonIsolateCompositedDescendants; |
| // If the implementation of createsGroup changes, we need to be aware of that in this part of code. |
| ASSERT((renderer->isTransparent() || renderer->hasMask() || renderer->hasFilter() || renderer->hasBlendMode()) == renderer->createsGroup()); |