| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 ClipPathDisplayItem_h | 5 #ifndef ClipPathDisplayItem_h |
| 6 #define ClipPathDisplayItem_h | 6 #define ClipPathDisplayItem_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/graphics/Path.h" | 9 #include "platform/graphics/Path.h" |
| 10 #include "platform/graphics/paint/DisplayItem.h" | 10 #include "platform/graphics/paint/DisplayItem.h" |
| 11 #include "third_party/skia/include/core/SkPath.h" | 11 #include "third_party/skia/include/core/SkPath.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class PLATFORM_EXPORT BeginClipPathDisplayItem final | 15 class PLATFORM_EXPORT BeginClipPathDisplayItem final |
| 16 : public PairedBeginDisplayItem { | 16 : public PairedBeginDisplayItem { |
| 17 public: | 17 public: |
| 18 BeginClipPathDisplayItem(const DisplayItemClient& client, | 18 BeginClipPathDisplayItem(const DisplayItemClient& client, |
| 19 const Path& clipPath) | 19 const Path& clipPath) |
| 20 : PairedBeginDisplayItem(client, kBeginClipPath, sizeof(*this)), | 20 : PairedBeginDisplayItem(client, kBeginClipPath, sizeof(*this)), |
| 21 m_clipPath(clipPath.getSkPath()) {} | 21 m_clipPath(clipPath.getSkPath()) {} |
| 22 | 22 |
| 23 void replay(GraphicsContext&) const override; | 23 void replay(GraphicsContext&) const override; |
| 24 void appendToWebDisplayItemList(const IntRect&, | 24 void appendToWebDisplayItemList(const IntRect&, |
| 25 WebDisplayItemList*) const override; | 25 WebDisplayItemList*) const override; |
| 26 | 26 |
| 27 void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const override; | 27 int numberOfSlowPaths() const override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 #ifndef NDEBUG | 30 #ifndef NDEBUG |
| 31 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; | 31 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; |
| 32 #endif | 32 #endif |
| 33 bool equals(const DisplayItem& other) const final { | 33 bool equals(const DisplayItem& other) const final { |
| 34 return DisplayItem::equals(other) && | 34 return DisplayItem::equals(other) && |
| 35 m_clipPath == | 35 m_clipPath == |
| 36 static_cast<const BeginClipPathDisplayItem&>(other).m_clipPath; | 36 static_cast<const BeginClipPathDisplayItem&>(other).m_clipPath; |
| 37 } | 37 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 53 #if DCHECK_IS_ON() | 53 #if DCHECK_IS_ON() |
| 54 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { | 54 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { |
| 55 return otherType == kBeginClipPath; | 55 return otherType == kBeginClipPath; |
| 56 } | 56 } |
| 57 #endif | 57 #endif |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace blink | 60 } // namespace blink |
| 61 | 61 |
| 62 #endif // ClipPathDisplayItem_h | 62 #endif // ClipPathDisplayItem_h |
| OLD | NEW |