| 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 "base/compiler_specific.h" |
| 8 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 9 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
| 10 #include "platform/geometry/FloatPoint.h" | 11 #include "platform/geometry/FloatPoint.h" |
| 11 #include "platform/graphics/paint/DisplayItem.h" | 12 #include "platform/graphics/paint/DisplayItem.h" |
| 12 #include "third_party/skia/include/core/SkPicture.h" | 13 #include "third_party/skia/include/core/SkPicture.h" |
| 13 #include "third_party/skia/include/core/SkRefCnt.h" | 14 #include "third_party/skia/include/core/SkRefCnt.h" |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 | 17 |
| 17 class PLATFORM_EXPORT DrawingDisplayItem final : public DisplayItem { | 18 class PLATFORM_EXPORT DrawingDisplayItem final : public DisplayItem { |
| 18 public: | 19 public: |
| 20 DISABLE_CFI_PERF |
| 19 DrawingDisplayItem(const DisplayItemClient& client, | 21 DrawingDisplayItem(const DisplayItemClient& client, |
| 20 Type type, | 22 Type type, |
| 21 sk_sp<const SkPicture> picture, | 23 sk_sp<const SkPicture> picture, |
| 22 bool knownToBeOpaque = false) | 24 bool knownToBeOpaque = false) |
| 23 : DisplayItem(client, type, sizeof(*this)), | 25 : DisplayItem(client, type, sizeof(*this)), |
| 24 m_picture(picture && picture->approximateOpCount() ? std::move(picture) | 26 m_picture(picture && picture->approximateOpCount() ? std::move(picture) |
| 25 : nullptr), | 27 : nullptr), |
| 26 m_knownToBeOpaque(knownToBeOpaque) { | 28 m_knownToBeOpaque(knownToBeOpaque) { |
| 27 DCHECK(isDrawingType(type)); | 29 DCHECK(isDrawingType(type)); |
| 28 } | 30 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 49 | 51 |
| 50 sk_sp<const SkPicture> m_picture; | 52 sk_sp<const SkPicture> m_picture; |
| 51 | 53 |
| 52 // True if there are no transparent areas. Only used for SlimmingPaintV2. | 54 // True if there are no transparent areas. Only used for SlimmingPaintV2. |
| 53 const bool m_knownToBeOpaque; | 55 const bool m_knownToBeOpaque; |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 } // namespace blink | 58 } // namespace blink |
| 57 | 59 |
| 58 #endif // DrawingDisplayItem_h | 60 #endif // DrawingDisplayItem_h |
| OLD | NEW |