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

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

Issue 2299223002: Compile under-invalidation checking in all builds (Closed)
Patch Set: Resolve conflict 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 535e0b8df3925bc173501c89ee780ae522d04034..930f11cf33d9c126a1c5cfee556152bd7d6e2416 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -80,7 +80,6 @@ struct PaintInvalidationInfo {
PaintInvalidationReason reason;
};
-#if DCHECK_IS_ON()
struct UnderPaintInvalidation {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
int x;
@@ -88,16 +87,13 @@ struct UnderPaintInvalidation {
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;
@@ -336,15 +332,13 @@ void GraphicsLayer::paint(const IntRect* interestRect, GraphicsContext::Disabled
{
if (paintWithoutCommit(interestRect, disabledMode)) {
getPaintController().commitNewDisplayItems(offsetFromLayoutObjectWithSubpixelAccumulation());
-#if DCHECK_IS_ON()
- if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) {
+ if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) {
RefPtr<SkPicture> newPicture = capturePicture();
checkPaintUnderInvalidations(*newPicture);
PaintInvalidationTracking& tracking = paintInvalidationTrackingMap().add(this, PaintInvalidationTracking()).storedValue->value;
tracking.lastPaintedPicture = newPicture;
tracking.paintInvalidationRegionSinceLastPaint = Region();
}
-#endif
}
}
@@ -554,7 +548,7 @@ void GraphicsLayer::resetTrackedPaintInvalidations()
if (it == paintInvalidationTrackingMap().end())
return;
- if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled())
+ if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled())
it->value.trackedPaintInvalidations.clear();
else
paintInvalidationTrackingMap().remove(it);
@@ -580,14 +574,12 @@ void GraphicsLayer::trackPaintInvalidation(const DisplayItemClient& client, cons
tracking.trackedPaintInvalidations.append(info);
}
-#if DCHECK_IS_ON()
- if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) {
+ if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) {
// 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)
@@ -1253,8 +1245,6 @@ void GraphicsLayer::setCompositorMutableProperties(uint32_t properties)
layer->setCompositorMutableProperties(properties);
}
-#if DCHECK_IS_ON()
-
PassRefPtr<SkPicture> GraphicsLayer::capturePicture()
{
if (!drawsContent())
@@ -1342,8 +1332,6 @@ void GraphicsLayer::checkPaintUnderInvalidations(const SkPicture& newPicture)
getPaintController().appendDebugDrawingAfterCommit(*this, picture, offsetFromLayoutObjectWithSubpixelAccumulation());
}
-#endif // DCHECK_IS_ON()
-
} // namespace blink
#ifndef NDEBUG

Powered by Google App Engine
This is Rietveld 408576698