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

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

Issue 2476813002: Move LayoutObject::m_previousPosition... into a global map in ObjectPaintInvalidator (Closed)
Patch Set: - Created 4 years, 1 month 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 4bc424f28d5ab16209b5cc6bb02ce91bff555f63..0cbc8e0503344324cdad1f27fa09fd077405be2a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -127,7 +127,6 @@ struct SameSizeAsLayoutObject : DisplayItemClient {
unsigned m_bitfields;
unsigned m_bitfields2;
LayoutRect m_previousVisualRect;
- LayoutPoint m_previousPosition;
};
static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject),
@@ -1204,11 +1203,15 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(
paintInvalidationState.paintInvalidationContainer();
DCHECK(paintInvalidationContainer == containerForPaintInvalidation());
+ ObjectPaintInvalidator paintInvalidator(*this);
context.oldVisualRect = previousVisualRect();
- context.oldLocation = previousPositionFromPaintInvalidationBacking();
+ context.oldLocation = paintInvalidator.previousLocationInBacking();
context.newVisualRect = paintInvalidationState.computeVisualRectInBacking();
- context.newLocation =
- paintInvalidationState.computePositionFromPaintInvalidationBacking();
+ // Use visual rect location for LayoutTexts and non-container SVG objects
+ // because visual rect change suffices to detect layout caused invalidation.
+ context.newLocation = !isBoxModelObject() && !isSVGContainer()
chrishtr 2016/11/04 18:20:06 You don't need a conditional here I think. paintIn
Xianzhu 2016/11/04 19:11:03 They are in different paths (PaintInvalidator path
+ ? context.newVisualRect.location()
+ : paintInvalidationState.computeLocationInBacking();
IntSize adjustment =
scrollAdjustmentForPaintInvalidation(paintInvalidationContainer);
@@ -1218,7 +1221,7 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(
adjustVisualRectForRasterEffects(context.newVisualRect);
setPreviousVisualRect(context.newVisualRect);
- setPreviousPositionFromPaintInvalidationBacking(context.newLocation);
+ paintInvalidator.setPreviousLocationInBacking(context.newLocation);
if (!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() &&
paintInvalidationState

Powered by Google App Engine
This is Rietveld 408576698