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 #ifndef DrawingDisplayItem_h | 5 #ifndef DrawingDisplayItem_h |
6 #define DrawingDisplayItem_h | 6 #define DrawingDisplayItem_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/geometry/FloatPoint.h" | 9 #include "platform/geometry/FloatPoint.h" |
10 #include "platform/graphics/paint/DisplayItem.h" | 10 #include "platform/graphics/paint/DisplayItem.h" |
11 #include "third_party/skia/include/core/SkPicture.h" | 11 #include "third_party/skia/include/core/SkPicture.h" |
12 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class PLATFORM_EXPORT DrawingDisplayItem : public DisplayItem { | 16 class PLATFORM_EXPORT DrawingDisplayItem : public DisplayItem { |
17 public: | 17 public: |
18 static PassOwnPtr<DrawingDisplayItem> create(DisplayItemClient client, Type
type, PassRefPtr<const SkPicture> picture) | 18 static PassOwnPtr<DrawingDisplayItem> create(DisplayItemClient client, Type
type, PassRefPtr<const SkPicture> picture) |
19 { | 19 { |
20 return adoptPtr(new DrawingDisplayItem(client, type, picture)); | 20 return adoptPtr(new DrawingDisplayItem(client, type, picture)); |
21 } | 21 } |
22 | 22 |
23 virtual void replay(GraphicsContext*); | 23 virtual void replay(GraphicsContext*); |
24 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 24 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 25 virtual bool drawsContent() const override; |
25 | 26 |
26 PassRefPtr<const SkPicture> picture() const { return m_picture; } | 27 PassRefPtr<const SkPicture> picture() const { return m_picture; } |
27 | 28 |
28 protected: | 29 protected: |
29 DrawingDisplayItem(DisplayItemClient client, Type type, PassRefPtr<const SkP
icture> picture) | 30 DrawingDisplayItem(DisplayItemClient client, Type type, PassRefPtr<const SkP
icture> picture) |
30 : DisplayItem(client, type), m_picture(picture) | 31 : DisplayItem(client, type), m_picture(picture) |
31 { | 32 { |
32 ASSERT(m_picture); | 33 ASSERT(m_picture); |
33 ASSERT(isDrawingType(type)); | 34 ASSERT(isDrawingType(type)); |
34 } | 35 } |
35 | 36 |
36 private: | 37 private: |
37 #ifndef NDEBUG | 38 #ifndef NDEBUG |
38 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
; | 39 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
; |
39 #endif | 40 #endif |
40 | 41 |
41 RefPtr<const SkPicture> m_picture; | 42 RefPtr<const SkPicture> m_picture; |
42 }; | 43 }; |
43 | 44 |
44 } // namespace blink | 45 } // namespace blink |
45 | 46 |
46 #endif // DrawingDisplayItem_h | 47 #endif // DrawingDisplayItem_h |
OLD | NEW |