| 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" | |
| 12 | 11 |
| 13 namespace blink { | 12 namespace blink { |
| 14 | 13 |
| 15 class RoundedRect; | 14 class RoundedRect; |
| 16 | 15 |
| 17 class PLATFORM_EXPORT FloatClipDisplayItem : public PairedBeginDisplayItem { | 16 class PLATFORM_EXPORT FloatClipDisplayItem : public PairedBeginDisplayItem { |
| 18 WTF_MAKE_FAST_ALLOCATED(FloatClipDisplayItem); | |
| 19 public: | 17 public: |
| 20 static PassOwnPtr<FloatClipDisplayItem> create(const DisplayItemClientWrappe
r& client, Type type, const FloatRect& clipRect) | |
| 21 { | |
| 22 return adoptPtr(new FloatClipDisplayItem(client, type, clipRect)); | |
| 23 } | |
| 24 | |
| 25 FloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type, cons
t FloatRect& clipRect) | 18 FloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type, cons
t FloatRect& clipRect) |
| 26 : PairedBeginDisplayItem(client, type) | 19 : PairedBeginDisplayItem(client, type) |
| 27 , m_clipRect(clipRect) | 20 , m_clipRect(clipRect) |
| 28 { | 21 { |
| 29 ASSERT(isFloatClipType(type)); | 22 ASSERT(isFloatClipType(type)); |
| 30 } | 23 } |
| 31 | 24 |
| 32 virtual void replay(GraphicsContext&) override; | 25 virtual void replay(GraphicsContext&) override; |
| 33 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 26 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 27 void appendByMoving(DisplayItems&) override; |
| 34 | 28 |
| 35 private: | 29 private: |
| 36 #ifndef NDEBUG | 30 #ifndef NDEBUG |
| 37 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
; | 31 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
; |
| 38 #endif | 32 #endif |
| 39 | 33 |
| 40 FloatRect m_clipRect; | 34 FloatRect m_clipRect; |
| 41 }; | 35 }; |
| 42 | 36 |
| 43 class PLATFORM_EXPORT EndFloatClipDisplayItem : public PairedEndDisplayItem { | 37 class PLATFORM_EXPORT EndFloatClipDisplayItem : public PairedEndDisplayItem { |
| 44 WTF_MAKE_FAST_ALLOCATED(EndFloatClipDisplayItem); | |
| 45 public: | 38 public: |
| 46 static PassOwnPtr<EndFloatClipDisplayItem> create(const DisplayItemClientWra
pper& client, Type type) | |
| 47 { | |
| 48 return adoptPtr(new EndFloatClipDisplayItem(client, type)); | |
| 49 } | |
| 50 | |
| 51 EndFloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type) | 39 EndFloatClipDisplayItem(const DisplayItemClientWrapper& client, Type type) |
| 52 : PairedEndDisplayItem(client, type) | 40 : PairedEndDisplayItem(client, type) |
| 53 { | 41 { |
| 54 ASSERT(isEndFloatClipType(type)); | 42 ASSERT(isEndFloatClipType(type)); |
| 55 } | 43 } |
| 56 | 44 |
| 57 virtual void replay(GraphicsContext&) override; | 45 virtual void replay(GraphicsContext&) override; |
| 58 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 46 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 47 void appendByMoving(DisplayItems&) override; |
| 59 | 48 |
| 60 private: | 49 private: |
| 61 #if ENABLE(ASSERT) | 50 #if ENABLE(ASSERT) |
| 62 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return DisplayItem::isFloatClipType(otherType); } | 51 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return DisplayItem::isFloatClipType(otherType); } |
| 63 #endif | 52 #endif |
| 64 }; | 53 }; |
| 65 | 54 |
| 66 } // namespace blink | 55 } // namespace blink |
| 67 | 56 |
| 68 #endif // FloatClipDisplayItem_h | 57 #endif // FloatClipDisplayItem_h |
| OLD | NEW |