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