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