Chromium Code Reviews| 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 |