Index: third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp |
index a6011c9c7fa76775fe12ddf65368f260085e1f96..576e0e321ee334f2b6c79539fed2f7a4261c118a 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp |
@@ -82,8 +82,16 @@ DrawingRecorder::~DrawingRecorder() { |
sk_sp<const SkPicture> picture = m_context.endRecording(); |
#if DCHECK_IS_ON() |
+ // The check for DisplayItem::kPaintPhaseMax works because kPaintPhaseMax is |
+ // PaintPhase::PaintPhaseClippingMask. But we can't use the latter because |
+ // it lives in core. The check is needed because a child that needs a clipping |
+ // mask needs it regardless of whether the child itself draws content, |
+ // and that mask's DrawingRecorder has a non-empty picture even if the child |
+ // itself draws no content. |
if (!RuntimeEnabledFeatures::slimmingPaintStrictCullRectClippingEnabled() && |
!m_context.getPaintController().isForSkPictureBuilder() && |
+ m_displayItemType != |
chrishtr
2016/12/09 23:09:34
I thought about this and tried out a few alternati
Stephen Chennney
2016/12/12 19:18:03
Done.
|
+ DisplayItem::paintPhaseToDrawingType(DisplayItem::kPaintPhaseMax) && |
m_displayItemClient.paintedOutputOfObjectHasNoEffectRegardlessOfSize()) { |
DCHECK_EQ(0, picture->approximateOpCount()) |
<< m_displayItemClient.debugName(); |