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 | 6 |
7 #include "core/paint/ClipScope.h" | 7 #include "core/paint/ClipScope.h" |
8 | 8 |
9 #include "platform/geometry/LayoutRect.h" | 9 #include "platform/geometry/LayoutRect.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 ClipScope::~ClipScope() | 13 ClipScope::~ClipScope() |
14 { | 14 { |
15 for (int i = 0; i < m_clipCount; i++) { | 15 for (int i = 0; i < m_clipCount; i++) { |
16 m_context->restore(); | 16 m_context.restore(); |
17 } | 17 } |
18 } | 18 } |
19 | 19 |
20 void ClipScope::clip(const LayoutRect& clipRect, SkRegion::Op operation) | 20 void ClipScope::clip(const LayoutRect& clipRect, SkRegion::Op operation) |
21 { | 21 { |
22 m_context->save(); | 22 m_context.save(); |
23 m_context->clipRect(pixelSnappedIntRect(clipRect), NotAntiAliased, operation
); | 23 m_context.clipRect(pixelSnappedIntRect(clipRect), NotAntiAliased, operation)
; |
24 m_clipCount++; | 24 m_clipCount++; |
25 } | 25 } |
26 | 26 |
27 } // namespace blink | 27 } // namespace blink |
OLD | NEW |