| 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/DrawingDisplayItem.h" | 5 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| 6 | 6 |
| 7 #include "platform/graphics/GraphicsContext.h" | 7 #include "platform/graphics/GraphicsContext.h" |
| 8 #include "public/platform/WebDisplayItemList.h" | 8 #include "public/platform/WebDisplayItemList.h" |
| 9 | 9 |
| 10 #if ENABLE(ASSERT) | 10 #if ENABLE(ASSERT) |
| 11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
| 12 #include "third_party/skia/include/core/SkCanvas.h" | 12 #include "third_party/skia/include/core/SkCanvas.h" |
| 13 #include "third_party/skia/include/core/SkData.h" | 13 #include "third_party/skia/include/core/SkData.h" |
| 14 #include "third_party/skia/include/core/SkStream.h" | 14 #include "third_party/skia/include/core/SkStream.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 void DrawingDisplayItem::replay(GraphicsContext& context) const | 19 void DrawingDisplayItem::replay(GraphicsContext& context) const |
| 20 { | 20 { |
| 21 if (m_picture) | 21 if (m_picture) |
| 22 context.drawPicture(m_picture.get()); | 22 context.drawPicture(m_picture.get()); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void DrawingDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect, W
ebDisplayItemList* list) const | 25 void DrawingDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect, W
ebDisplayItemList* list) const |
| 26 { | 26 { |
| 27 if (m_picture) | 27 if (m_picture) |
| 28 list->appendDrawingItem(visualRect, m_picture.get()); | 28 list->appendDrawingItem(visualRect, toSkSp(m_picture)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool DrawingDisplayItem::drawsContent() const | 31 bool DrawingDisplayItem::drawsContent() const |
| 32 { | 32 { |
| 33 return m_picture; | 33 return m_picture; |
| 34 } | 34 } |
| 35 | 35 |
| 36 #ifndef NDEBUG | 36 #ifndef NDEBUG |
| 37 void DrawingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringB
uilder) const | 37 void DrawingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringB
uilder) const |
| 38 { | 38 { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 return bitmapIsAllZero(bitmap); | 107 return bitmapIsAllZero(bitmap); |
| 108 } | 108 } |
| 109 default: | 109 default: |
| 110 ASSERT_NOT_REACHED(); | 110 ASSERT_NOT_REACHED(); |
| 111 } | 111 } |
| 112 return false; | 112 return false; |
| 113 } | 113 } |
| 114 #endif // ENABLE(ASSERT) | 114 #endif // ENABLE(ASSERT) |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| OLD | NEW |