Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
index 37a94ac80e0939e43eb374798ff3684fdb5e86ef..f7ef46b86a3e3324d58294026c22a95b4e3c55d0 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
@@ -2397,9 +2397,6 @@ bool PaintLayer::paintsWithTransform(GlobalPaintFlags globalPaintFlags) const |
bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const |
{ |
- if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
- return false; |
- |
if (paintsWithTransparency(GlobalPaintNormalPhase)) |
return false; |
@@ -2415,14 +2412,12 @@ bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) |
if (paintsWithTransform(GlobalPaintNormalPhase)) |
return false; |
- // FIXME: Remove this check. |
// This function should not be called when layer-lists are dirty. |
- // It is somehow getting triggered during style update. |
- if (m_stackingNode->zOrderListsDirty()) |
- return false; |
+ DCHECK(!m_stackingNode->zOrderListsDirty()); |
chrishtr
2016/09/01 23:24:59
If the PaintLayer is not stacking, m_stackingNode
|
// FIXME: We currently only check the immediate layoutObject, |
- // which will miss many cases. |
+ // which will miss many cases where additional layout objects paint |
+ // into this layer. |
if (layoutObject()->backgroundIsKnownToBeOpaqueInRect(localRect)) |
return true; |
@@ -2431,13 +2426,17 @@ bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) |
if (layoutObject()->hasClipRelatedProperty()) |
return false; |
+ // TODO(schenney): This could be improved by unioning the opaque regions of all the children. |
+ // That would require a refactoring because currently children just check they at least |
+ // cover the given rect, but a unioning method would require children to compute and report |
+ // their rects. |
return childBackgroundIsKnownToBeOpaqueInRect(localRect); |
} |
bool PaintLayer::childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const |
{ |
- PaintLayerStackingNodeReverseIterator revertseIterator(*m_stackingNode, PositiveZOrderChildren | NormalFlowChildren | NegativeZOrderChildren); |
- while (PaintLayerStackingNode* child = revertseIterator.next()) { |
+ PaintLayerStackingNodeReverseIterator reverseIterator(*m_stackingNode, PositiveZOrderChildren | NormalFlowChildren | NegativeZOrderChildren); |
+ while (PaintLayerStackingNode* child = reverseIterator.next()) { |
const PaintLayer* childLayer = child->layer(); |
// Stop at composited paint boundaries. |
if (childLayer->isPaintInvalidationContainer()) |