| 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/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
| 10 #include "platform/geometry/FloatPoint.h" | 10 #include "platform/geometry/FloatPoint.h" |
| 11 #include "platform/graphics/paint/DisplayItem.h" | 11 #include "platform/graphics/paint/DisplayItem.h" |
| 12 #include "third_party/skia/include/core/SkPicture.h" | 12 #include "third_party/skia/include/core/SkPicture.h" |
| 13 #include "third_party/skia/include/core/SkRefCnt.h" | 13 #include "third_party/skia/include/core/SkRefCnt.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class PLATFORM_EXPORT DrawingDisplayItem final : public DisplayItem { | 17 class PLATFORM_EXPORT DrawingDisplayItem final : public DisplayItem { |
| 18 public: | 18 public: |
| 19 DrawingDisplayItem(const DisplayItemClient& client, Type type, sk_sp<const S
kPicture> picture, bool knownToBeOpaque = false) | 19 DrawingDisplayItem(const DisplayItemClient& client, Type type, sk_sp<const S
kPicture> picture, bool knownToBeOpaque = false) |
| 20 : DisplayItem(client, type, sizeof(*this)) | 20 : DisplayItem(client, type, sizeof(*this)) |
| 21 , m_picture(picture && picture->approximateOpCount() ? picture : nullptr
) | 21 , m_picture(picture && picture->approximateOpCount() ? std::move(picture
) : nullptr) |
| 22 , m_knownToBeOpaque(knownToBeOpaque) | 22 , m_knownToBeOpaque(knownToBeOpaque) |
| 23 { | 23 { |
| 24 DCHECK(isDrawingType(type)); | 24 DCHECK(isDrawingType(type)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void replay(GraphicsContext&) const override; | 27 void replay(GraphicsContext&) const override; |
| 28 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 28 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
| 29 bool drawsContent() const override; | 29 bool drawsContent() const override; |
| 30 | 30 |
| 31 const SkPicture* picture() const { return m_picture.get(); } | 31 const SkPicture* picture() const { return m_picture.get(); } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 sk_sp<const SkPicture> m_picture; | 43 sk_sp<const SkPicture> m_picture; |
| 44 | 44 |
| 45 // True if there are no transparent areas. Only used for SlimmingPaintV2. | 45 // True if there are no transparent areas. Only used for SlimmingPaintV2. |
| 46 const bool m_knownToBeOpaque; | 46 const bool m_knownToBeOpaque; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace blink | 49 } // namespace blink |
| 50 | 50 |
| 51 #endif // DrawingDisplayItem_h | 51 #endif // DrawingDisplayItem_h |
| OLD | NEW |