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