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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2297873002: Remove unnecessary checks in PaintLayer::backgroundIsKnownToBeOpaqueInRect (Closed)
Patch Set: Rebased. Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e3f390493df29546797e508ae55086d3987ec451..4dccb38f1c970d621c5e9292fa7de56adfa16d16 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -2407,9 +2407,6 @@ bool PaintLayer::paintsWithTransform(GlobalPaintFlags globalPaintFlags) const
bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const
{
- if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant())
- return false;
-
if (paintsWithTransparency(GlobalPaintNormalPhase))
return false;
@@ -2425,14 +2422,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());
// 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;
@@ -2441,13 +2436,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())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698