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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2306783002: Revert of Compile under-invalidation checking in all builds (Closed)
Patch Set: Created 4 years, 3 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/platform/graphics/GraphicsLayer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index 930f11cf33d9c126a1c5cfee556152bd7d6e2416..535e0b8df3925bc173501c89ee780ae522d04034 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -80,6 +80,7 @@
PaintInvalidationReason reason;
};
+#if DCHECK_IS_ON()
struct UnderPaintInvalidation {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
int x;
@@ -87,13 +88,16 @@
SkColor oldPixel;
SkColor newPixel;
};
+#endif
struct PaintInvalidationTracking {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
Vector<PaintInvalidationInfo> trackedPaintInvalidations;
+#if DCHECK_IS_ON()
RefPtr<SkPicture> lastPaintedPicture;
Region paintInvalidationRegionSinceLastPaint;
Vector<UnderPaintInvalidation> underPaintInvalidations;
+#endif
};
typedef HashMap<const GraphicsLayer*, PaintInvalidationTracking> PaintInvalidationTrackingMap;
@@ -332,13 +336,15 @@
{
if (paintWithoutCommit(interestRect, disabledMode)) {
getPaintController().commitNewDisplayItems(offsetFromLayoutObjectWithSubpixelAccumulation());
- if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) {
+#if DCHECK_IS_ON()
+ if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) {
RefPtr<SkPicture> newPicture = capturePicture();
checkPaintUnderInvalidations(*newPicture);
PaintInvalidationTracking& tracking = paintInvalidationTrackingMap().add(this, PaintInvalidationTracking()).storedValue->value;
tracking.lastPaintedPicture = newPicture;
tracking.paintInvalidationRegionSinceLastPaint = Region();
}
+#endif
}
}
@@ -548,7 +554,7 @@
if (it == paintInvalidationTrackingMap().end())
return;
- if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled())
+ if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled())
it->value.trackedPaintInvalidations.clear();
else
paintInvalidationTrackingMap().remove(it);
@@ -574,12 +580,14 @@
tracking.trackedPaintInvalidations.append(info);
}
- if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) {
+#if DCHECK_IS_ON()
+ if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) {
// TODO(crbug.com/496260): Some antialiasing effects overflows the paint invalidation rect.
IntRect r = rect;
r.inflate(1);
tracking.paintInvalidationRegionSinceLastPaint.unite(r);
}
+#endif
}
static bool comparePaintInvalidationInfo(const PaintInvalidationInfo& a, const PaintInvalidationInfo& b)
@@ -1245,6 +1253,8 @@
layer->setCompositorMutableProperties(properties);
}
+#if DCHECK_IS_ON()
+
PassRefPtr<SkPicture> GraphicsLayer::capturePicture()
{
if (!drawsContent())
@@ -1332,6 +1342,8 @@
getPaintController().appendDebugDrawingAfterCommit(*this, picture, offsetFromLayoutObjectWithSubpixelAccumulation());
}
+#endif // DCHECK_IS_ON()
+
} // namespace blink
#ifndef NDEBUG

Powered by Google App Engine
This is Rietveld 408576698