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 ae82764dc2734a175579fa0bf7c61d7246ea600f..69f189183c06ee0e63150caf0a0848faa9c19837 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| @@ -332,6 +332,8 @@ void PaintInvalidator::updateContext(const LayoutObject& object, |
| context.oldLocation = objectPaintInvalidator.previousLocationInBacking(); |
| context.newVisualRect = computeVisualRectInBacking(object, context); |
| context.newLocation = computeLocationInBacking(object, context); |
| + context.oldPaintOffset = object.previousPaintOffset(); |
| + context.newPaintOffset = context.treeBuilderContext.current.paintOffset; |
| IntSize adjustment = object.scrollAdjustmentForPaintInvalidation( |
| *context.paintInvalidationContainer); |
| @@ -340,6 +342,7 @@ void PaintInvalidator::updateContext(const LayoutObject& object, |
| object.getMutableForPainting().setPreviousVisualRect(context.newVisualRect); |
| objectPaintInvalidator.setPreviousLocationInBacking(context.newLocation); |
| + object.getMutableForPainting().setPreviousPaintOffset(context.newPaintOffset); |
| } |
| void PaintInvalidator::invalidatePaintIfNeeded( |
| @@ -430,16 +433,21 @@ void PaintInvalidator::invalidatePaintIfNeeded( |
| break; |
| } |
| - if (context.oldLocation != context.newLocation) |
| + if (context.oldLocation != context.newLocation || |
| + (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
| + context.oldPaintOffset != context.newPaintOffset)) { |
| context.forcedSubtreeInvalidationFlags |= |
| PaintInvalidatorContext::ForcedSubtreeInvalidationChecking; |
| + } |
| // TODO(crbug.com/533277): This is a workaround for the bug. Remove when we |
|
pdr.
2016/11/10 07:35:32
WDYT about adding a little more info to this comme
Xianzhu
2016/11/10 17:41:10
Done.
|
| // detect paint offset change. |
| - if (reason != PaintInvalidationNone && |
| - hasPercentageTransform(object.styleRef())) |
| + if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
|
chrishtr
2016/11/10 18:42:00
How was this fixed for SPv2?
Xianzhu
2016/11/10 22:51:50
Good question. To answer your question, at first I
|
| + reason != PaintInvalidationNone && |
| + hasPercentageTransform(object.styleRef())) { |
| context.forcedSubtreeInvalidationFlags |= |
| PaintInvalidatorContext::ForcedSubtreeInvalidationChecking; |
| + } |
| // TODO(crbug.com/490725): This is a workaround for the bug, to force |
| // descendant to update visual rects on clipping change. |