| 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 ClipDisplayItem_h | 5 #ifndef ClipDisplayItem_h |
| 6 #define ClipDisplayItem_h | 6 #define ClipDisplayItem_h |
| 7 | 7 |
| 8 #include "SkRegion.h" | 8 #include "SkRegion.h" |
| 9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 10 #include "platform/geometry/FloatRoundedRect.h" | 10 #include "platform/geometry/FloatRoundedRect.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 { | 23 { |
| 24 ASSERT(isClipType(type)); | 24 ASSERT(isClipType(type)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 ClipDisplayItem(const DisplayItemClientWrapper& client, Type type, const Int
Rect& clipRect, Vector<FloatRoundedRect>& roundedRectClips) | 27 ClipDisplayItem(const DisplayItemClientWrapper& client, Type type, const Int
Rect& clipRect, Vector<FloatRoundedRect>& roundedRectClips) |
| 28 : ClipDisplayItem(client, type, clipRect) | 28 : ClipDisplayItem(client, type, clipRect) |
| 29 { | 29 { |
| 30 m_roundedRectClips.swap(roundedRectClips); | 30 m_roundedRectClips.swap(roundedRectClips); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void replay(GraphicsContext&) override; | 33 void replay(GraphicsContext&) const override; |
| 34 void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 34 void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 #ifndef NDEBUG | 37 #ifndef NDEBUG |
| 38 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; | 38 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; |
| 39 #endif | 39 #endif |
| 40 #if ENABLE(ASSERT) | 40 #if ENABLE(ASSERT) |
| 41 bool equals(const DisplayItem& other) const final | 41 bool equals(const DisplayItem& other) const final |
| 42 { | 42 { |
| 43 return DisplayItem::equals(other) | 43 return DisplayItem::equals(other) |
| 44 && m_clipRect == static_cast<const ClipDisplayItem&>(other).m_clipRe
ct | 44 && m_clipRect == static_cast<const ClipDisplayItem&>(other).m_clipRe
ct |
| 45 && m_roundedRectClips == static_cast<const ClipDisplayItem&>(other).
m_roundedRectClips; | 45 && m_roundedRectClips == static_cast<const ClipDisplayItem&>(other).
m_roundedRectClips; |
| 46 } | 46 } |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 const IntRect m_clipRect; | 49 const IntRect m_clipRect; |
| 50 Vector<FloatRoundedRect> m_roundedRectClips; | 50 Vector<FloatRoundedRect> m_roundedRectClips; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 class PLATFORM_EXPORT EndClipDisplayItem final : public PairedEndDisplayItem { | 53 class PLATFORM_EXPORT EndClipDisplayItem final : public PairedEndDisplayItem { |
| 54 public: | 54 public: |
| 55 EndClipDisplayItem(const DisplayItemClientWrapper& client, Type type) | 55 EndClipDisplayItem(const DisplayItemClientWrapper& client, Type type) |
| 56 : PairedEndDisplayItem(client, type, sizeof(*this)) | 56 : PairedEndDisplayItem(client, type, sizeof(*this)) |
| 57 { | 57 { |
| 58 ASSERT(isEndClipType(type)); | 58 ASSERT(isEndClipType(type)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void replay(GraphicsContext&) override; | 61 void replay(GraphicsContext&) const override; |
| 62 void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 62 void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 #if ENABLE(ASSERT) | 65 #if ENABLE(ASSERT) |
| 66 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di
splayItem::isClipType(otherType); } | 66 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di
splayItem::isClipType(otherType); } |
| 67 #endif | 67 #endif |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace blink | 70 } // namespace blink |
| 71 | 71 |
| 72 #endif // ClipDisplayItem_h | 72 #endif // ClipDisplayItem_h |
| OLD | NEW |