| 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 "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 9 #include "platform/geometry/IntRect.h" | 10 #include "platform/geometry/IntRect.h" |
| 10 #include "platform/graphics/paint/DisplayItem.h" | 11 #include "platform/graphics/paint/DisplayItem.h" |
| 11 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 class RoundedRect; | 16 class RoundedRect; |
| 16 | 17 |
| 17 class PLATFORM_EXPORT ClipDisplayItem : public DisplayItem { | 18 class PLATFORM_EXPORT ClipDisplayItem : public DisplayItem { |
| 18 public: | 19 public: |
| 19 ClipDisplayItem(DisplayItemClient client, Type type, IntRect clipRect) | 20 ClipDisplayItem(DisplayItemClient client, Type type, IntRect clipRect, SkReg
ion::Op operation = SkRegion::kIntersect_Op) |
| 20 : DisplayItem(client, type), m_clipRect(clipRect) { } | 21 : DisplayItem(client, type), m_clipRect(clipRect), m_operation(operation
) { } |
| 21 | 22 |
| 22 virtual void replay(GraphicsContext*) override; | 23 virtual void replay(GraphicsContext*) override; |
| 23 | 24 |
| 24 Vector<RoundedRect>& roundedRectClips() { return m_roundedRectClips; } | 25 Vector<RoundedRect>& roundedRectClips() { return m_roundedRectClips; } |
| 25 | 26 |
| 26 private: | 27 private: |
| 27 IntRect m_clipRect; | 28 IntRect m_clipRect; |
| 28 Vector<RoundedRect> m_roundedRectClips; | 29 Vector<RoundedRect> m_roundedRectClips; |
| 30 SkRegion::Op m_operation; |
| 29 #ifndef NDEBUG | 31 #ifndef NDEBUG |
| 30 virtual WTF::String asDebugString() const override; | 32 virtual WTF::String asDebugString() const override; |
| 31 #endif | 33 #endif |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 class PLATFORM_EXPORT EndClipDisplayItem : public DisplayItem { | 36 class PLATFORM_EXPORT EndClipDisplayItem : public DisplayItem { |
| 35 public: | 37 public: |
| 36 EndClipDisplayItem(DisplayItemClient client) : DisplayItem(client, EndClip)
{ } | 38 EndClipDisplayItem(DisplayItemClient client) : DisplayItem(client, EndClip)
{ } |
| 37 | 39 |
| 38 virtual void replay(GraphicsContext*) override; | 40 virtual void replay(GraphicsContext*) override; |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 } // namespace blink | 43 } // namespace blink |
| 42 | 44 |
| 43 #endif // ClipDisplayItem_h | 45 #endif // ClipDisplayItem_h |
| OLD | NEW |