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

Unified Diff: third_party/WebKit/Source/core/paint/ObjectPainter.h

Issue 2489893002: [SPv2] Track paint offset change (Closed)
Patch Set: - 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/ObjectPainter.h
diff --git a/third_party/WebKit/Source/core/paint/ObjectPainter.h b/third_party/WebKit/Source/core/paint/ObjectPainter.h
index e73923dfdcf41c19f73defa97d725764cd928469..e61af62b5705a30128cffedc1b1173563a3d7b17 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPainter.h
+++ b/third_party/WebKit/Source/core/paint/ObjectPainter.h
@@ -6,6 +6,7 @@
#define ObjectPainter_h
#include "core/style/ComputedStyleConstants.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "wtf/Allocator.h"
#include "wtf/Vector.h"
@@ -60,6 +61,21 @@ class ObjectPainter {
void paintAllPhasesAtomically(const PaintInfo&,
const LayoutPoint& paintOffset);
+ // When SlimmingPaintInvalidation is enabled, we compute paint offsets during
+ // the pre-paint tree walk (PrePaintTreeWalk). This check verifies that the
+ // paint offset computed during pre-paint matches the actual paint offset
+ // during paint.
+ void checkPaintOffset(const PaintInfo& paintInfo,
+ const LayoutPoint& paintOffset) {
+#if DCHECK_IS_ON()
+ // For now this works for SPv2 (implying SlimmingPaintInvalidation) only,
+ // but not SlimmingPaintInvalidation on SPv1 because of complexities of
+ // paint invalidation containers in SPv1.
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
+ doCheckPaintOffset(paintInfo, paintOffset);
+#endif
+ }
+
private:
static void drawDashedOrDottedBoxSide(GraphicsContext&,
int x1,
@@ -105,6 +121,10 @@ class ObjectPainter {
int adjacentWidth2,
bool antialias);
+#if DCHECK_IS_ON()
+ void doCheckPaintOffset(const PaintInfo&, const LayoutPoint& paintOffset);
+#endif
+
const LayoutObject& m_layoutObject;
};

Powered by Google App Engine
This is Rietveld 408576698