Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| index 18181096b12946f1b6250fee2c54a311780b5c3b..034de1800c61893e669e61be92efd5702badb36d 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| @@ -151,9 +151,14 @@ LayoutRect PaintInvalidator::computeVisualRectInBacking( |
| return mapLocalRectToPaintInvalidationBacking(object, localRect, context); |
| } |
| -LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking( |
| +LayoutPoint PaintInvalidator::computeLocationInBacking( |
| const LayoutObject& object, |
| const PaintInvalidatorContext& context) { |
| + // Use visual rect location for LayoutTexts and non-container SVG objects |
| + // because visual rect change suffices to detect layout caused invalidation. |
| + if (!object.isBoxModelObject() && !object.isSVGContainer()) |
|
chrishtr
2016/11/04 18:20:07
You say it suffices to use newVisualRect.location(
Xianzhu
2016/11/04 19:11:03
In the stat result from cluster telemetry:
Total
|
| + return context.newVisualRect.location(); |
| + |
| FloatPoint point; |
| if (object != context.paintInvalidationContainer) { |
| point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| @@ -322,11 +327,11 @@ void PaintInvalidator::updateContext(const LayoutObject& object, |
| context.forcedSubtreeInvalidationFlags |= |
| PaintInvalidatorContext::ForcedSubtreeSlowPathRect; |
| + ObjectPaintInvalidator objectPaintInvalidator(object); |
| context.oldVisualRect = object.previousVisualRect(); |
| - context.oldLocation = object.previousPositionFromPaintInvalidationBacking(); |
| + context.oldLocation = objectPaintInvalidator.previousLocationInBacking(); |
| context.newVisualRect = computeVisualRectInBacking(object, context); |
| - context.newLocation = |
| - computeLocationFromPaintInvalidationBacking(object, context); |
| + context.newLocation = computeLocationInBacking(object, context); |
| IntSize adjustment = object.scrollAdjustmentForPaintInvalidation( |
| *context.paintInvalidationContainer); |
| @@ -334,8 +339,7 @@ void PaintInvalidator::updateContext(const LayoutObject& object, |
| context.newVisualRect.move(adjustment); |
| object.getMutableForPainting().setPreviousVisualRect(context.newVisualRect); |
| - object.getMutableForPainting() |
| - .setPreviousPositionFromPaintInvalidationBacking(context.newLocation); |
| + objectPaintInvalidator.setPreviousLocationInBacking(context.newLocation); |
| } |
| void PaintInvalidator::invalidatePaintIfNeeded( |