| 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 "base/compiler_specific.h" |
| 9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 Type type, | 22 Type type, |
| 23 sk_sp<const PaintRecord> record, | 23 sk_sp<const PaintRecord> record, |
| 24 bool known_to_be_opaque = false) | 24 bool known_to_be_opaque = false) |
| 25 : DisplayItem(client, type, sizeof(*this)), | 25 : DisplayItem(client, type, sizeof(*this)), |
| 26 record_(record && record->size() ? std::move(record) : nullptr), | 26 record_(record && record->size() ? std::move(record) : nullptr), |
| 27 known_to_be_opaque_(known_to_be_opaque) { | 27 known_to_be_opaque_(known_to_be_opaque) { |
| 28 DCHECK(IsDrawingType(type)); | 28 DCHECK(IsDrawingType(type)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void Replay(GraphicsContext&) const override; | 31 void Replay(GraphicsContext&) const override; |
| 32 void AppendToWebDisplayItemList(const LayoutSize&, | 32 void AppendToWebDisplayItemList(const IntRect&, |
| 33 WebDisplayItemList*) const override; | 33 WebDisplayItemList*) const override; |
| 34 bool DrawsContent() const override; | 34 bool DrawsContent() const override; |
| 35 | 35 |
| 36 const sk_sp<const PaintRecord>& GetPaintRecord() const { return record_; } | 36 const sk_sp<const PaintRecord>& GetPaintRecord() const { return record_; } |
| 37 | 37 |
| 38 bool KnownToBeOpaque() const { | 38 bool KnownToBeOpaque() const { |
| 39 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 39 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 40 return known_to_be_opaque_; | 40 return known_to_be_opaque_; |
| 41 } | 41 } |
| 42 | 42 |
| 43 int NumberOfSlowPaths() const override; | 43 int NumberOfSlowPaths() const override; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 #ifndef NDEBUG | 46 #ifndef NDEBUG |
| 47 void DumpPropertiesAsDebugString(WTF::StringBuilder&) const override; | 47 void DumpPropertiesAsDebugString(WTF::StringBuilder&) const override; |
| 48 #endif | 48 #endif |
| 49 bool Equals(const DisplayItem& other) const final; | 49 bool Equals(const DisplayItem& other) const final; |
| 50 | 50 |
| 51 sk_sp<const PaintRecord> record_; | 51 sk_sp<const PaintRecord> record_; |
| 52 | 52 |
| 53 // True if there are no transparent areas. Only used for SlimmingPaintV2. | 53 // True if there are no transparent areas. Only used for SlimmingPaintV2. |
| 54 const bool known_to_be_opaque_; | 54 const bool known_to_be_opaque_; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace blink | 57 } // namespace blink |
| 58 | 58 |
| 59 #endif // DrawingDisplayItem_h | 59 #endif // DrawingDisplayItem_h |
| OLD | NEW |