| 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 15 matching lines...) Expand all Loading... |
| 26 ClipDisplayItem(const DisplayItemClientWrapper& client, Type type, const Int
Rect& clipRect, SkRegion::Op operation = SkRegion::kIntersect_Op) | 26 ClipDisplayItem(const DisplayItemClientWrapper& client, Type type, const Int
Rect& clipRect, SkRegion::Op operation = SkRegion::kIntersect_Op) |
| 27 : PairedBeginDisplayItem(client, type) | 27 : PairedBeginDisplayItem(client, type) |
| 28 , m_clipRect(clipRect) | 28 , m_clipRect(clipRect) |
| 29 , m_operation(operation) | 29 , m_operation(operation) |
| 30 { | 30 { |
| 31 ASSERT(isClipType(type)); | 31 ASSERT(isClipType(type)); |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual void replay(GraphicsContext&) override; | 34 virtual void replay(GraphicsContext&) override; |
| 35 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 35 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 36 virtual void appendByMoving(DisplayItems&) override; |
| 36 | 37 |
| 37 Vector<FloatRoundedRect>& roundedRectClips() { return m_roundedRectClips; } | 38 Vector<FloatRoundedRect>& roundedRectClips() { return m_roundedRectClips; } |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 #ifndef NDEBUG | 41 #ifndef NDEBUG |
| 41 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
; | 42 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
; |
| 42 #endif | 43 #endif |
| 43 IntRect m_clipRect; | 44 IntRect m_clipRect; |
| 44 Vector<FloatRoundedRect> m_roundedRectClips; | 45 Vector<FloatRoundedRect> m_roundedRectClips; |
| 45 SkRegion::Op m_operation; | 46 SkRegion::Op m_operation; |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 class PLATFORM_EXPORT EndClipDisplayItem : public PairedEndDisplayItem { | 49 class PLATFORM_EXPORT EndClipDisplayItem : public PairedEndDisplayItem { |
| 49 WTF_MAKE_FAST_ALLOCATED(EndClipDisplayItem); | 50 WTF_MAKE_FAST_ALLOCATED(EndClipDisplayItem); |
| 50 public: | 51 public: |
| 51 static PassOwnPtr<EndClipDisplayItem> create(const DisplayItemClientWrapper&
client, Type type) | 52 static PassOwnPtr<EndClipDisplayItem> create(const DisplayItemClientWrapper&
client, Type type) |
| 52 { | 53 { |
| 53 return adoptPtr(new EndClipDisplayItem(client, type)); | 54 return adoptPtr(new EndClipDisplayItem(client, type)); |
| 54 } | 55 } |
| 55 | 56 |
| 56 EndClipDisplayItem(const DisplayItemClientWrapper& client, Type type) | 57 EndClipDisplayItem(const DisplayItemClientWrapper& client, Type type) |
| 57 : PairedEndDisplayItem(client, type) | 58 : PairedEndDisplayItem(client, type) |
| 58 { | 59 { |
| 59 ASSERT(isEndClipType(type)); | 60 ASSERT(isEndClipType(type)); |
| 60 } | 61 } |
| 61 | 62 |
| 62 virtual void replay(GraphicsContext&) override; | 63 virtual void replay(GraphicsContext&) override; |
| 63 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 64 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 65 virtual void appendByMoving(DisplayItems&) override; |
| 64 | 66 |
| 65 private: | 67 private: |
| 66 #if ENABLE(ASSERT) | 68 #if ENABLE(ASSERT) |
| 67 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return DisplayItem::isClipType(otherType); } | 69 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return DisplayItem::isClipType(otherType); } |
| 68 #endif | 70 #endif |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 } // namespace blink | 73 } // namespace blink |
| 72 | 74 |
| 73 #endif // ClipDisplayItem_h | 75 #endif // ClipDisplayItem_h |
| OLD | NEW |