OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "platform/graphics/paint/DrawingRecorder.h" | 5 #include "platform/graphics/paint/DrawingRecorder.h" |
6 | 6 |
7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
9 #include "platform/graphics/GraphicsLayer.h" | 9 #include "platform/graphics/GraphicsLayer.h" |
10 #include "platform/graphics/paint/PaintController.h" | 10 #include "platform/graphics/paint/PaintController.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 m_context.restore(); | 75 m_context.restore(); |
76 | 76 |
77 m_context.setInDrawingRecorder(false); | 77 m_context.setInDrawingRecorder(false); |
78 DCHECK(m_displayItemPosition == | 78 DCHECK(m_displayItemPosition == |
79 m_context.getPaintController().newDisplayItemList().size()); | 79 m_context.getPaintController().newDisplayItemList().size()); |
80 #endif | 80 #endif |
81 | 81 |
82 sk_sp<const SkPicture> picture = m_context.endRecording(); | 82 sk_sp<const SkPicture> picture = m_context.endRecording(); |
83 | 83 |
84 #if DCHECK_IS_ON() | 84 #if DCHECK_IS_ON() |
85 // The check for DisplayItem::kPaintPhaseMax works because kPaintPhaseMax is | |
86 // PaintPhase::PaintPhaseClippingMask. But we can't use the latter because | |
87 // it lives in core. The check is needed because a child that needs a clipping | |
88 // mask needs it regardless of whether the child itself draws content, | |
89 // and that mask's DrawingRecorder has a non-empty picture even if the child | |
90 // itself draws no content. | |
85 if (!RuntimeEnabledFeatures::slimmingPaintStrictCullRectClippingEnabled() && | 91 if (!RuntimeEnabledFeatures::slimmingPaintStrictCullRectClippingEnabled() && |
86 !m_context.getPaintController().isForSkPictureBuilder() && | 92 !m_context.getPaintController().isForSkPictureBuilder() && |
93 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.
| |
94 DisplayItem::paintPhaseToDrawingType(DisplayItem::kPaintPhaseMax) && | |
87 m_displayItemClient.paintedOutputOfObjectHasNoEffectRegardlessOfSize()) { | 95 m_displayItemClient.paintedOutputOfObjectHasNoEffectRegardlessOfSize()) { |
88 DCHECK_EQ(0, picture->approximateOpCount()) | 96 DCHECK_EQ(0, picture->approximateOpCount()) |
89 << m_displayItemClient.debugName(); | 97 << m_displayItemClient.debugName(); |
90 } | 98 } |
91 #endif | 99 #endif |
92 | 100 |
93 m_context.getPaintController().createAndAppend<DrawingDisplayItem>( | 101 m_context.getPaintController().createAndAppend<DrawingDisplayItem>( |
94 m_displayItemClient, m_displayItemType, picture, m_knownToBeOpaque); | 102 m_displayItemClient, m_displayItemType, picture, m_knownToBeOpaque); |
95 } | 103 } |
96 | 104 |
97 } // namespace blink | 105 } // namespace blink |
OLD | NEW |