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/ClipDisplayItem.h" | 6 #include "platform/graphics/paint/ClipDisplayItem.h" |
7 | 7 |
8 #include "platform/geometry/RoundedRect.h" | 8 #include "platform/geometry/RoundedRect.h" |
9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 void ClipDisplayItem::replay(GraphicsContext* context) | 13 void ClipDisplayItem::replay(GraphicsContext* context) |
14 { | 14 { |
15 context->save(); | 15 context->save(); |
16 context->clip(m_clipRect); | 16 context->clipRect(m_clipRect, NotAntiAliased, m_operation); |
17 for (RoundedRect roundedRect : m_roundedRectClips) | 17 for (RoundedRect roundedRect : m_roundedRectClips) |
18 context->clipRoundedRect(roundedRect); | 18 context->clipRoundedRect(roundedRect, m_operation); |
19 } | 19 } |
20 | 20 |
21 void EndClipDisplayItem::replay(GraphicsContext* context) | 21 void EndClipDisplayItem::replay(GraphicsContext* context) |
22 { | 22 { |
23 context->restore(); | 23 context->restore(); |
24 } | 24 } |
25 | 25 |
26 #ifndef NDEBUG | 26 #ifndef NDEBUG |
27 WTF::String ClipDisplayItem::asDebugString() const | 27 WTF::String ClipDisplayItem::asDebugString() const |
28 { | 28 { |
29 return String::format("{%s, type: \"%s\", clipRect: [%d,%d,%d,%d]}", | 29 return String::format("{%s, type: \"%s\", clipRect: [%d,%d,%d,%d]}", |
30 clientDebugString().utf8().data(), typeAsDebugString(type()).utf8().data
(), | 30 clientDebugString().utf8().data(), typeAsDebugString(type()).utf8().data
(), |
31 m_clipRect.x(), m_clipRect.y(), m_clipRect.width(), m_clipRect.height())
; | 31 m_clipRect.x(), m_clipRect.y(), m_clipRect.width(), m_clipRect.height())
; |
32 } | 32 } |
33 #endif | 33 #endif |
34 | 34 |
35 } // namespace blink | 35 } // namespace blink |
OLD | NEW |