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 #include "platform/graphics/paint/ClipDisplayItem.h" | 5 #include "platform/graphics/paint/ClipDisplayItem.h" |
6 | 6 |
7 #include "platform/geometry/FloatRoundedRect.h" | 7 #include "platform/geometry/FloatRoundedRect.h" |
8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
9 #include "public/platform/WebDisplayItemList.h" | 9 #include "public/platform/WebDisplayItemList.h" |
10 #include "third_party/skia/include/core/SkScalar.h" | 10 #include "third_party/skia/include/core/SkScalar.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 for (const FloatRoundedRect& roundedRect : m_roundedRectClips) | 25 for (const FloatRoundedRect& roundedRect : m_roundedRectClips) |
26 context.clipRoundedRect(roundedRect); | 26 context.clipRoundedRect(roundedRect); |
27 } | 27 } |
28 | 28 |
29 void ClipDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect, WebD
isplayItemList* list) const | 29 void ClipDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect, WebD
isplayItemList* list) const |
30 { | 30 { |
31 WebVector<SkRRect> webRoundedRects(m_roundedRectClips.size()); | 31 WebVector<SkRRect> webRoundedRects(m_roundedRectClips.size()); |
32 for (size_t i = 0; i < m_roundedRectClips.size(); ++i) | 32 for (size_t i = 0; i < m_roundedRectClips.size(); ++i) |
33 webRoundedRects[i] = m_roundedRectClips[i]; | 33 webRoundedRects[i] = m_roundedRectClips[i]; |
34 | 34 |
35 list->appendClipItem(visualRect, m_clipRect, webRoundedRects); | 35 list->appendClipItem(m_clipRect, webRoundedRects); |
36 } | 36 } |
37 | 37 |
38 void EndClipDisplayItem::replay(GraphicsContext& context) const | 38 void EndClipDisplayItem::replay(GraphicsContext& context) const |
39 { | 39 { |
40 context.restore(); | 40 context.restore(); |
41 } | 41 } |
42 | 42 |
43 void EndClipDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect, W
ebDisplayItemList* list) const | 43 void EndClipDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect, W
ebDisplayItemList* list) const |
44 { | 44 { |
45 list->appendEndClipItem(visualRect); | 45 list->appendEndClipItem(); |
46 } | 46 } |
47 | 47 |
48 #ifndef NDEBUG | 48 #ifndef NDEBUG |
49 void ClipDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuil
der) const | 49 void ClipDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuil
der) const |
50 { | 50 { |
51 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); | 51 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); |
52 stringBuilder.append(WTF::String::format(", clipRect: [%d,%d,%d,%d]", | 52 stringBuilder.append(WTF::String::format(", clipRect: [%d,%d,%d,%d]", |
53 m_clipRect.x(), m_clipRect.y(), m_clipRect.width(), m_clipRect.height())
); | 53 m_clipRect.x(), m_clipRect.y(), m_clipRect.width(), m_clipRect.height())
); |
54 } | 54 } |
55 #endif | 55 #endif |
56 | 56 |
57 } // namespace blink | 57 } // namespace blink |
OLD | NEW |