| 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 16 matching lines...) Expand all Loading... |
| 27 : nullptr), | 27 : nullptr), |
| 28 m_knownToBeOpaque(knownToBeOpaque) { | 28 m_knownToBeOpaque(knownToBeOpaque) { |
| 29 DCHECK(isDrawingType(type)); | 29 DCHECK(isDrawingType(type)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void replay(GraphicsContext&) const override; | 32 void replay(GraphicsContext&) const override; |
| 33 void appendToWebDisplayItemList(const IntRect&, | 33 void appendToWebDisplayItemList(const IntRect&, |
| 34 WebDisplayItemList*) const override; | 34 WebDisplayItemList*) const override; |
| 35 bool drawsContent() const override; | 35 bool drawsContent() const override; |
| 36 | 36 |
| 37 const PaintRecord* GetPaintRecord() const { return m_record.get(); } | 37 const sk_sp<const PaintRecord>& GetPaintRecord() const { return m_record; } |
| 38 | 38 |
| 39 bool knownToBeOpaque() const { | 39 bool knownToBeOpaque() const { |
| 40 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 40 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 41 return m_knownToBeOpaque; | 41 return m_knownToBeOpaque; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const override; | 44 void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 #ifndef NDEBUG | 47 #ifndef NDEBUG |
| 48 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; | 48 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; |
| 49 #endif | 49 #endif |
| 50 bool equals(const DisplayItem& other) const final; | 50 bool equals(const DisplayItem& other) const final; |
| 51 | 51 |
| 52 sk_sp<const PaintRecord> m_record; | 52 sk_sp<const PaintRecord> m_record; |
| 53 | 53 |
| 54 // True if there are no transparent areas. Only used for SlimmingPaintV2. | 54 // True if there are no transparent areas. Only used for SlimmingPaintV2. |
| 55 const bool m_knownToBeOpaque; | 55 const bool m_knownToBeOpaque; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace blink | 58 } // namespace blink |
| 59 | 59 |
| 60 #endif // DrawingDisplayItem_h | 60 #endif // DrawingDisplayItem_h |
| OLD | NEW |