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/FloatClipDisplayItem.h" | 5 #include "platform/graphics/paint/FloatClipDisplayItem.h" |
6 | 6 |
7 #include "platform/graphics/GraphicsContext.h" | 7 #include "platform/graphics/GraphicsContext.h" |
8 #include "public/platform/WebDisplayItemList.h" | 8 #include "public/platform/WebDisplayItemList.h" |
9 #include "third_party/skia/include/core/SkScalar.h" | 9 #include "third_party/skia/include/core/SkScalar.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 void FloatClipDisplayItem::replay(GraphicsContext& context) const | 13 void FloatClipDisplayItem::replay(GraphicsContext& context) const |
14 { | 14 { |
15 context.save(); | 15 context.save(); |
16 context.clip(m_clipRect); | 16 context.clip(m_clipRect); |
17 } | 17 } |
18 | 18 |
19 void FloatClipDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect,
WebDisplayItemList* list) const | 19 void FloatClipDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect,
WebDisplayItemList* list) const |
20 { | 20 { |
21 list->appendFloatClipItem(visualRect, m_clipRect); | 21 list->appendFloatClipItem(m_clipRect); |
22 } | 22 } |
23 | 23 |
24 void EndFloatClipDisplayItem::replay(GraphicsContext& context) const | 24 void EndFloatClipDisplayItem::replay(GraphicsContext& context) const |
25 { | 25 { |
26 context.restore(); | 26 context.restore(); |
27 } | 27 } |
28 | 28 |
29 void EndFloatClipDisplayItem::appendToWebDisplayItemList(const IntRect& visualRe
ct, WebDisplayItemList* list) const | 29 void EndFloatClipDisplayItem::appendToWebDisplayItemList(const IntRect& visualRe
ct, WebDisplayItemList* list) const |
30 { | 30 { |
31 list->appendEndFloatClipItem(visualRect); | 31 list->appendEndFloatClipItem(); |
32 } | 32 } |
33 | 33 |
34 #ifndef NDEBUG | 34 #ifndef NDEBUG |
35 void FloatClipDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& strin
gBuilder) const | 35 void FloatClipDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& strin
gBuilder) const |
36 { | 36 { |
37 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); | 37 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); |
38 stringBuilder.append(WTF::String::format(", floatClipRect: [%f,%f,%f,%f]}", | 38 stringBuilder.append(WTF::String::format(", floatClipRect: [%f,%f,%f,%f]}", |
39 m_clipRect.x(), m_clipRect.y(), m_clipRect.width(), m_clipRect.height())
); | 39 m_clipRect.x(), m_clipRect.y(), m_clipRect.width(), m_clipRect.height())
); |
40 } | 40 } |
41 | 41 |
42 #endif | 42 #endif |
43 | 43 |
44 } // namespace blink | 44 } // namespace blink |
OLD | NEW |