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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.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/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 1991cf3cef2ef0887fd10d1985cfcbc34074aa10..856a2066a4d68261ecf6875c207636e9361a0a3e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1330,7 +1330,7 @@ void LayoutObject::invalidatePaintRectangleNotInvalidatingDisplayItemClients(con
invalidatePaintRectangleInternal(r);
}
-void LayoutObject::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidationState)
+void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState)
{
ASSERT(!needsLayout());
@@ -1339,8 +1339,8 @@ void LayoutObject::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidat
if (!shouldCheckForPaintInvalidation(paintInvalidationState))
return;
- PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationState.paintInvalidationContainer());
- clearPaintInvalidationState(paintInvalidationState);
+ PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState);
+ clearPaintInvalidationFlags(paintInvalidationState);
if (reason == PaintInvalidationDelayedFull)
paintInvalidationState.pushDelayedPaintInvalidationTarget(*this);
@@ -1348,7 +1348,7 @@ void LayoutObject::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidat
invalidatePaintOfSubtreesIfNeeded(paintInvalidationState);
}
-void LayoutObject::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& childPaintInvalidationState)
+void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState)
{
for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibling()) {
if (!child->isOutOfFlowPositioned())
@@ -1423,7 +1423,7 @@ inline void LayoutObject::invalidateSelectionIfNeeded(const LayoutBoxModelObject
fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection, oldSelectionRect, newSelectionRect);
}
-PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationState& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContainer)
+PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState)
{
if (styleRef().hasOutline()) {
PaintLayer& layer = paintInvalidationState.enclosingSelfPaintingLayer(*this);
@@ -1435,6 +1435,10 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS
if (v->document().printing())
return PaintInvalidationNone; // Don't invalidate paints if we're printing.
+ const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationState.paintInvalidationContainer();
+ // TODO(wangxianzhu): Enable this assert after we fix all paintInvalidationContainer mismatch issues. crbug.com/360286
+ // ASSERT(paintInvalidationContainer == containerForPaintInvalidation());
+
const LayoutRect oldBounds = previousPaintInvalidationRect();
const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking();
LayoutRect newBounds = boundsRectForPaintInvalidation(paintInvalidationContainer, &paintInvalidationState);
@@ -3490,7 +3494,7 @@ void LayoutObject::setMayNeedPaintInvalidation()
frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded();
}
-void LayoutObject::clearPaintInvalidationState(const PaintInvalidationState& paintInvalidationState)
+void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& paintInvalidationState)
{
// paintInvalidationStateIsDirty should be kept in sync with the
// booleans that are cleared below.
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutPart.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698