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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 1804963005: Avoid paintInvalidationContainer parameter of invalidatePaintIfNeeded() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index c4c3c731219ce47c468dfbc87b2f6647a999c561..155ea060c75ed9f47447619276047b8d1cf6fa97 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -356,33 +356,31 @@ static bool hasPercentageTransform(const ComputedStyle& style)
|| (style.transformOriginY() != Length(50, Percent) && style.transformOriginY().hasPercent());
}
-void LayoutBoxModelObject::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidationState)
+void LayoutBoxModelObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState)
{
ASSERT(!needsLayout());
if (!shouldCheckForPaintInvalidation(paintInvalidationState))
return;
- bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer();
- const LayoutBoxModelObject& newPaintInvalidationContainer = establishesNewPaintInvalidationContainer ? *this : paintInvalidationState.paintInvalidationContainer();
- // FIXME: This assert should be re-enabled when we move paint invalidation to after compositing update. crbug.com/360286
- // ASSERT(&newPaintInvalidationContainer == &containerForPaintInvalidation());
-
LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRect();
- PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
- clearPaintInvalidationState(paintInvalidationState);
+ PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *this);
+ // TODO(wangxianzhu): Enable this assert after we fix all paintInvalidationContainer mismatch issues. crbug.com/360286
+ // ASSERT(&newPaintInvalidationState.paintInvalidationContainer() == &containerForPaintInvalidation());
+
+ PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidationState);
+ clearPaintInvalidationFlags(newPaintInvalidationState);
if (reason == PaintInvalidationDelayedFull)
paintInvalidationState.pushDelayedPaintInvalidationTarget(*this);
- PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer);
if (reason == PaintInvalidationLocationChange)
- childTreeWalkState.setForceSubtreeInvalidationWithinContainer();
+ newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer();
// TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove when we enable paint offset caching.
if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef()))
- childTreeWalkState.setForceSubtreeInvalidationWithinContainer();
+ newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer();
// TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't have enough saved information to do accurate check
// of clipping change. Will remove when we remove rect-based paint invalidation.
@@ -390,9 +388,10 @@ void LayoutBoxModelObject::invalidateTreeIfNeeded(PaintInvalidationState& paintI
&& previousPaintInvalidationRect != this->previousPaintInvalidationRect()
&& !usesCompositedScrolling()
&& hasOverflowClip())
- childTreeWalkState.setForceSubtreeInvalidationRectUpdateWithinContainer();
+ newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinContainer();
- invalidatePaintOfSubtreesIfNeeded(childTreeWalkState);
+ newPaintInvalidationState.updatePaintOffsetAndClipForChildren();
+ invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState);
}
void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRect& r, PaintInvalidationReason invalidationReason) const

Powered by Google App Engine
This is Rietveld 408576698