| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 #if DCHECK_IS_ON() | 73 #if DCHECK_IS_ON() |
| 74 if (RuntimeEnabledFeatures::slimmingPaintStrictCullRectClippingEnabled()) | 74 if (RuntimeEnabledFeatures::slimmingPaintStrictCullRectClippingEnabled()) |
| 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(); | |
| 83 | |
| 84 #if DCHECK_IS_ON() | |
| 85 if (!RuntimeEnabledFeatures::slimmingPaintStrictCullRectClippingEnabled() && | |
| 86 !m_context.getPaintController().isForSkPictureBuilder() && | |
| 87 m_displayItemClient.paintedOutputOfObjectHasNoEffectRegardlessOfSize()) { | |
| 88 DCHECK_EQ(0, picture->approximateOpCount()) | |
| 89 << m_displayItemClient.debugName(); | |
| 90 } | |
| 91 #endif | |
| 92 | |
| 93 m_context.getPaintController().createAndAppend<DrawingDisplayItem>( | 82 m_context.getPaintController().createAndAppend<DrawingDisplayItem>( |
| 94 m_displayItemClient, m_displayItemType, picture, m_knownToBeOpaque); | 83 m_displayItemClient, m_displayItemType, m_context.endRecording(), |
| 84 m_knownToBeOpaque); |
| 95 } | 85 } |
| 96 | 86 |
| 97 } // namespace blink | 87 } // namespace blink |
| OLD | NEW |