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 : public PairedBeginDisplayItem { | 17 class PLATFORM_EXPORT FloatClipDisplayItem : public PairedBeginDisplayItem { |
18 public: | 18 public: |
19 FloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type, cons
t FloatRect& clipRect) | 19 FloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type, cons
t FloatRect& clipRect) |
20 : PairedBeginDisplayItem(client, type) | 20 : PairedBeginDisplayItem(client, type) |
21 , m_clipRect(clipRect) | 21 , m_clipRect(clipRect) |
22 { | 22 { |
23 ASSERT(isFloatClipType(type)); | 23 ASSERT(isFloatClipType(type)); |
24 } | 24 } |
25 | 25 |
26 virtual void replay(GraphicsContext&) override; | 26 void replay(GraphicsContext&) override; |
27 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 27 void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
28 | 28 |
29 private: | 29 private: |
30 #ifndef NDEBUG | 30 #ifndef NDEBUG |
31 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
; | 31 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; |
32 #endif | 32 #endif |
33 | 33 |
34 const FloatRect m_clipRect; | 34 const FloatRect m_clipRect; |
35 }; | 35 }; |
36 | 36 |
37 class PLATFORM_EXPORT EndFloatClipDisplayItem : public PairedEndDisplayItem { | 37 class PLATFORM_EXPORT EndFloatClipDisplayItem : public PairedEndDisplayItem { |
38 public: | 38 public: |
39 EndFloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type) | 39 EndFloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type) |
40 : PairedEndDisplayItem(client, type) | 40 : PairedEndDisplayItem(client, type) |
41 { | 41 { |
42 ASSERT(isEndFloatClipType(type)); | 42 ASSERT(isEndFloatClipType(type)); |
43 } | 43 } |
44 | 44 |
45 virtual void replay(GraphicsContext&) override; | 45 void replay(GraphicsContext&) override; |
46 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 46 void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
47 | 47 |
48 private: | 48 private: |
49 #if ENABLE(ASSERT) | 49 #if ENABLE(ASSERT) |
50 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return DisplayItem::isFloatClipType(otherType); } | 50 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di
splayItem::isFloatClipType(otherType); } |
51 #endif | 51 #endif |
52 }; | 52 }; |
53 | 53 |
54 } // namespace blink | 54 } // namespace blink |
55 | 55 |
56 #endif // FloatClipDisplayItem_h | 56 #endif // FloatClipDisplayItem_h |
OLD | NEW |