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

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

Issue 2733773004: Add check for missing visual rect updates and fix failures (Closed)
Patch Set: - Created 3 years, 9 months 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 8f2b791ec3162c24561aaefda0063be6ef630183..75c51d9bf4c2fbbdea10b937af03feb53010c2d5 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
@@ -169,6 +169,10 @@ LayoutRect PaintInvalidator::computeVisualRectInBacking(
LayoutPoint PaintInvalidator::computeLocationInBacking(
const LayoutObject& object,
const PaintInvalidatorContext& context) {
+ // In SPv2, locationInBacking is in the space of their local transform node.
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
+ return object.paintOffset();
+
LayoutPoint point;
if (object != context.paintInvalidationContainer) {
point.moveBy(object.paintOffset());
@@ -425,8 +429,24 @@ void PaintInvalidator::invalidatePaintIfNeeded(
object
.shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
if (!context.forcedSubtreeInvalidationFlags &&
- !objectShouldCheckForPaintInvalidation)
+ !objectShouldCheckForPaintInvalidation) {
+#if CHECK_VISUAL_RECT_UPDATE
+ updateVisualRect(object, context);
+ DCHECK(
+ (context.oldVisualRect.isEmpty() && context.newVisualRect.isEmpty()) ||
+ enclosingIntRect(context.oldVisualRect) ==
+ enclosingIntRect(context.newVisualRect))
+ << "Visual rect changed without needing paint invalidation:"
+ << " object=" << object.debugName()
+ << " old=" << context.oldVisualRect.toString()
+ << " new=" << context.newVisualRect.toString();
+ DCHECK(object.isText() || context.oldLocation == context.newLocation)
+ << "Location changed without needing paint invalidation:"
+ << " old=" << context.oldLocation.toString()
+ << " new=" << context.newLocation.toString();
+#endif
return;
+ }
updateVisualRect(object, context);

Powered by Google App Engine
This is Rietveld 408576698