| 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 | 26 |
| 27 ClipDisplayItem(const DisplayItemClient& client, | 27 ClipDisplayItem(const DisplayItemClient& client, |
| 28 Type type, | 28 Type type, |
| 29 const IntRect& clip_rect, | 29 const IntRect& clip_rect, |
| 30 Vector<FloatRoundedRect>& rounded_rect_clips) | 30 Vector<FloatRoundedRect>& rounded_rect_clips) |
| 31 : ClipDisplayItem(client, type, clip_rect) { | 31 : ClipDisplayItem(client, type, clip_rect) { |
| 32 rounded_rect_clips_.swap(rounded_rect_clips); | 32 rounded_rect_clips_.swap(rounded_rect_clips); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void Replay(GraphicsContext&) const override; | 35 void Replay(GraphicsContext&) const override; |
| 36 void AppendToWebDisplayItemList(const IntRect&, | 36 void AppendToWebDisplayItemList(const LayoutSize&, |
| 37 WebDisplayItemList*) const override; | 37 WebDisplayItemList*) const override; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 #ifndef NDEBUG | 40 #ifndef NDEBUG |
| 41 void DumpPropertiesAsDebugString(WTF::StringBuilder&) const override; | 41 void DumpPropertiesAsDebugString(WTF::StringBuilder&) const override; |
| 42 #endif | 42 #endif |
| 43 bool Equals(const DisplayItem& other) const final { | 43 bool Equals(const DisplayItem& other) const final { |
| 44 return DisplayItem::Equals(other) && | 44 return DisplayItem::Equals(other) && |
| 45 clip_rect_ == | 45 clip_rect_ == |
| 46 static_cast<const ClipDisplayItem&>(other).clip_rect_ && | 46 static_cast<const ClipDisplayItem&>(other).clip_rect_ && |
| 47 rounded_rect_clips_ == | 47 rounded_rect_clips_ == |
| 48 static_cast<const ClipDisplayItem&>(other).rounded_rect_clips_; | 48 static_cast<const ClipDisplayItem&>(other).rounded_rect_clips_; |
| 49 } | 49 } |
| 50 | 50 |
| 51 const IntRect clip_rect_; | 51 const IntRect clip_rect_; |
| 52 Vector<FloatRoundedRect> rounded_rect_clips_; | 52 Vector<FloatRoundedRect> rounded_rect_clips_; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 class PLATFORM_EXPORT EndClipDisplayItem final : public PairedEndDisplayItem { | 55 class PLATFORM_EXPORT EndClipDisplayItem final : public PairedEndDisplayItem { |
| 56 public: | 56 public: |
| 57 EndClipDisplayItem(const DisplayItemClient& client, Type type) | 57 EndClipDisplayItem(const DisplayItemClient& client, Type type) |
| 58 : PairedEndDisplayItem(client, type, sizeof(*this)) { | 58 : PairedEndDisplayItem(client, type, sizeof(*this)) { |
| 59 DCHECK(IsEndClipType(type)); | 59 DCHECK(IsEndClipType(type)); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void Replay(GraphicsContext&) const override; | 62 void Replay(GraphicsContext&) const override; |
| 63 void AppendToWebDisplayItemList(const IntRect&, | 63 void AppendToWebDisplayItemList(const LayoutSize&, |
| 64 WebDisplayItemList*) const override; | 64 WebDisplayItemList*) const override; |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 #if DCHECK_IS_ON() | 67 #if DCHECK_IS_ON() |
| 68 bool IsEndAndPairedWith(DisplayItem::Type other_type) const final { | 68 bool IsEndAndPairedWith(DisplayItem::Type other_type) const final { |
| 69 return DisplayItem::IsClipType(other_type); | 69 return DisplayItem::IsClipType(other_type); |
| 70 } | 70 } |
| 71 #endif | 71 #endif |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace blink | 74 } // namespace blink |
| 75 | 75 |
| 76 #endif // ClipDisplayItem_h | 76 #endif // ClipDisplayItem_h |
| OLD | NEW |