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

Unified Diff: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp

Issue 2489893002: [SPv2] Track paint offset change (Closed)
Patch Set: Fix test failures 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/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.

Powered by Google App Engine
This is Rietveld 408576698