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 "config.h" | 5 #include "config.h" |
6 #include "platform/graphics/paint/DrawingRecorder.h" | 6 #include "platform/graphics/paint/DrawingRecorder.h" |
7 | 7 |
8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
10 #include "platform/graphics/GraphicsLayer.h" | 10 #include "platform/graphics/GraphicsLayer.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 #endif | 84 #endif |
85 | 85 |
86 if (m_canUseCachedDrawing) { | 86 if (m_canUseCachedDrawing) { |
87 #ifndef NDEBUG | 87 #ifndef NDEBUG |
88 RefPtr<const SkPicture> picture = m_context.endRecording(); | 88 RefPtr<const SkPicture> picture = m_context.endRecording(); |
89 if (picture && picture->approximateOpCount()) { | 89 if (picture && picture->approximateOpCount()) { |
90 WTF_LOG_ERROR("Unnecessary painting for %s\n. Should check recorder.
canUseCachedDrawing() before painting", | 90 WTF_LOG_ERROR("Unnecessary painting for %s\n. Should check recorder.
canUseCachedDrawing() before painting", |
91 m_displayItemClient.debugName().utf8().data()); | 91 m_displayItemClient.debugName().utf8().data()); |
92 } | 92 } |
93 #endif | 93 #endif |
94 m_context.displayItemList()->add(CachedDisplayItem::create(m_displayItem
Client, DisplayItem::drawingTypeToCachedType(m_displayItemType))); | 94 m_context.displayItemList()->createAndAppend<CachedDisplayItem>(m_displa
yItemClient, DisplayItem::drawingTypeToCachedType(m_displayItemType)); |
95 } else { | 95 } else { |
96 OwnPtr<DrawingDisplayItem> drawingDisplayItem = DrawingDisplayItem::crea
te(m_displayItemClient | 96 m_context.displayItemList()->createAndAppend<DrawingDisplayItem>(m_displ
ayItemClient |
97 , m_displayItemType | 97 , m_displayItemType |
98 , m_context.endRecording() | 98 , m_context.endRecording() |
99 #if ENABLE(ASSERT) | 99 #if ENABLE(ASSERT) |
100 , m_underInvalidationCheckingMode | 100 , m_underInvalidationCheckingMode |
101 #endif | 101 #endif |
102 ); | 102 ); |
103 m_context.displayItemList()->add(drawingDisplayItem.release()); | |
104 } | 103 } |
105 } | 104 } |
106 | 105 |
107 } // namespace blink | 106 } // namespace blink |
OLD | NEW |