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 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class RoundedRect; | 15 class RoundedRect; |
16 | 16 |
17 class PLATFORM_EXPORT FloatClipDisplayItem final : public PairedBeginDisplayItem
{ | 17 class PLATFORM_EXPORT FloatClipDisplayItem final : public PairedBeginDisplayItem
{ |
18 public: | 18 public: |
19 FloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type, cons
t FloatRect& clipRect) | 19 FloatClipDisplayItem(const DisplayItemClient& client, Type type, const Float
Rect& clipRect) |
20 : PairedBeginDisplayItem(client, type, sizeof(*this)) | 20 : PairedBeginDisplayItem(client, type, sizeof(*this)) |
21 , m_clipRect(clipRect) | 21 , m_clipRect(clipRect) |
22 { | 22 { |
23 ASSERT(isFloatClipType(type)); | 23 ASSERT(isFloatClipType(type)); |
24 } | 24 } |
25 | 25 |
26 void replay(GraphicsContext&) const override; | 26 void replay(GraphicsContext&) const override; |
27 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 27 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
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 #if ENABLE(ASSERT) | 33 #if ENABLE(ASSERT) |
34 bool equals(const DisplayItem& other) const final | 34 bool equals(const DisplayItem& other) const final |
35 { | 35 { |
36 return DisplayItem::equals(other) | 36 return DisplayItem::equals(other) |
37 && m_clipRect == static_cast<const FloatClipDisplayItem&>(other).m_c
lipRect; | 37 && m_clipRect == static_cast<const FloatClipDisplayItem&>(other).m_c
lipRect; |
38 } | 38 } |
39 #endif | 39 #endif |
40 | 40 |
41 const FloatRect m_clipRect; | 41 const FloatRect m_clipRect; |
42 }; | 42 }; |
43 | 43 |
44 class PLATFORM_EXPORT EndFloatClipDisplayItem final : public PairedEndDisplayIte
m { | 44 class PLATFORM_EXPORT EndFloatClipDisplayItem final : public PairedEndDisplayIte
m { |
45 public: | 45 public: |
46 EndFloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type) | 46 EndFloatClipDisplayItem(const DisplayItemClient& client, Type type) |
47 : PairedEndDisplayItem(client, type, sizeof(*this)) | 47 : PairedEndDisplayItem(client, type, sizeof(*this)) |
48 { | 48 { |
49 ASSERT(isEndFloatClipType(type)); | 49 ASSERT(isEndFloatClipType(type)); |
50 } | 50 } |
51 | 51 |
52 void replay(GraphicsContext&) const override; | 52 void replay(GraphicsContext&) const override; |
53 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 53 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
54 | 54 |
55 private: | 55 private: |
56 #if ENABLE(ASSERT) | 56 #if ENABLE(ASSERT) |
57 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di
splayItem::isFloatClipType(otherType); } | 57 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di
splayItem::isFloatClipType(otherType); } |
58 #endif | 58 #endif |
59 }; | 59 }; |
60 | 60 |
61 } // namespace blink | 61 } // namespace blink |
62 | 62 |
63 #endif // FloatClipDisplayItem_h | 63 #endif // FloatClipDisplayItem_h |
OLD | NEW |