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 virtual bool drawsContent() const override; |
26 | 26 |
27 PassRefPtr<const SkPicture> picture() const { return m_picture; } | 27 PassRefPtr<const SkPicture> picture() const { return m_picture; } |
28 | 28 |
29 protected: | |
ajuma
2015/02/23 18:19:28
Spurious change?
pdr.
2015/02/23 22:00:55
We need to make this public so it can be created e
| |
30 DrawingDisplayItem(DisplayItemClient client, Type type, PassRefPtr<const SkP icture> picture) | 29 DrawingDisplayItem(DisplayItemClient client, Type type, PassRefPtr<const SkP icture> picture) |
31 : DisplayItem(client, type), m_picture(picture) | 30 : DisplayItem(client, type), m_picture(picture) |
32 { | 31 { |
33 ASSERT(m_picture); | 32 ASSERT(m_picture); |
34 ASSERT(isDrawingType(type)); | 33 ASSERT(isDrawingType(type)); |
35 } | 34 } |
36 | 35 |
37 private: | 36 private: |
38 #ifndef NDEBUG | 37 #ifndef NDEBUG |
39 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ; | 38 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ; |
40 #endif | 39 #endif |
41 | 40 |
42 RefPtr<const SkPicture> m_picture; | 41 RefPtr<const SkPicture> m_picture; |
43 }; | 42 }; |
44 | 43 |
45 } // namespace blink | 44 } // namespace blink |
46 | 45 |
47 #endif // DrawingDisplayItem_h | 46 #endif // DrawingDisplayItem_h |
OLD | NEW |