| 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 FloatClipDisplayItem_h | 5 #ifndef FloatClipDisplayItem_h |
| 6 #define FloatClipDisplayItem_h | 6 #define FloatClipDisplayItem_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/geometry/FloatRect.h" | 9 #include "platform/geometry/FloatRect.h" |
| 10 #include "platform/graphics/paint/DisplayItem.h" | 10 #include "platform/graphics/paint/DisplayItem.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class PLATFORM_EXPORT FloatClipDisplayItem final | 14 class PLATFORM_EXPORT FloatClipDisplayItem final |
| 15 : public PairedBeginDisplayItem { | 15 : public PairedBeginDisplayItem { |
| 16 public: | 16 public: |
| 17 FloatClipDisplayItem(const DisplayItemClient& client, | 17 FloatClipDisplayItem(const DisplayItemClient& client, |
| 18 Type type, | 18 Type type, |
| 19 const FloatRect& clipRect) | 19 const FloatRect& clipRect) |
| 20 : PairedBeginDisplayItem(client, type, sizeof(*this)), | 20 : PairedBeginDisplayItem(client, type, sizeof(*this)), |
| 21 m_clipRect(clipRect) { | 21 m_clipRect(clipRect) { |
| 22 ASSERT(isFloatClipType(type)); | 22 DCHECK(isFloatClipType(type)); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void replay(GraphicsContext&) const override; | 25 void replay(GraphicsContext&) const override; |
| 26 void appendToWebDisplayItemList(const IntRect&, | 26 void appendToWebDisplayItemList(const IntRect&, |
| 27 WebDisplayItemList*) const override; | 27 WebDisplayItemList*) 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_clipRect == | 35 m_clipRect == |
| 36 static_cast<const FloatClipDisplayItem&>(other).m_clipRect; | 36 static_cast<const FloatClipDisplayItem&>(other).m_clipRect; |
| 37 } | 37 } |
| 38 | 38 |
| 39 const FloatRect m_clipRect; | 39 const FloatRect m_clipRect; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 class PLATFORM_EXPORT EndFloatClipDisplayItem final | 42 class PLATFORM_EXPORT EndFloatClipDisplayItem final |
| 43 : public PairedEndDisplayItem { | 43 : public PairedEndDisplayItem { |
| 44 public: | 44 public: |
| 45 EndFloatClipDisplayItem(const DisplayItemClient& client, Type type) | 45 EndFloatClipDisplayItem(const DisplayItemClient& client, Type type) |
| 46 : PairedEndDisplayItem(client, type, sizeof(*this)) { | 46 : PairedEndDisplayItem(client, type, sizeof(*this)) { |
| 47 ASSERT(isEndFloatClipType(type)); | 47 DCHECK(isEndFloatClipType(type)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void replay(GraphicsContext&) const override; | 50 void replay(GraphicsContext&) const override; |
| 51 void appendToWebDisplayItemList(const IntRect&, | 51 void appendToWebDisplayItemList(const IntRect&, |
| 52 WebDisplayItemList*) const override; | 52 WebDisplayItemList*) const override; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 #if DCHECK_IS_ON() | 55 #if DCHECK_IS_ON() |
| 56 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { | 56 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { |
| 57 return DisplayItem::isFloatClipType(otherType); | 57 return DisplayItem::isFloatClipType(otherType); |
| 58 } | 58 } |
| 59 #endif | 59 #endif |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace blink | 62 } // namespace blink |
| 63 | 63 |
| 64 #endif // FloatClipDisplayItem_h | 64 #endif // FloatClipDisplayItem_h |
| OLD | NEW |