Chromium Code Reviews| 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 | 25 |
| 26 virtual bool drawsContent() const override { return true; } | |
|
Stephen Chennney
2015/02/19 16:13:27
This should check the picture contents. approximat
ajuma
2015/02/19 17:36:51
Done.
| |
| 27 | |
| 26 PassRefPtr<const SkPicture> picture() const { return m_picture; } | 28 PassRefPtr<const SkPicture> picture() const { return m_picture; } |
| 27 | 29 |
| 28 protected: | 30 protected: |
| 29 DrawingDisplayItem(DisplayItemClient client, Type type, PassRefPtr<const SkP icture> picture) | 31 DrawingDisplayItem(DisplayItemClient client, Type type, PassRefPtr<const SkP icture> picture) |
| 30 : DisplayItem(client, type), m_picture(picture) | 32 : DisplayItem(client, type), m_picture(picture) |
| 31 { | 33 { |
| 32 ASSERT(m_picture); | 34 ASSERT(m_picture); |
| 33 ASSERT(isDrawingType(type)); | 35 ASSERT(isDrawingType(type)); |
| 34 } | 36 } |
| 35 | 37 |
| 36 private: | 38 private: |
| 37 #ifndef NDEBUG | 39 #ifndef NDEBUG |
| 38 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ; | 40 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override ; |
| 39 #endif | 41 #endif |
| 40 | 42 |
| 41 RefPtr<const SkPicture> m_picture; | 43 RefPtr<const SkPicture> m_picture; |
| 42 }; | 44 }; |
| 43 | 45 |
| 44 } // namespace blink | 46 } // namespace blink |
| 45 | 47 |
| 46 #endif // DrawingDisplayItem_h | 48 #endif // DrawingDisplayItem_h |
| OLD | NEW |