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 #ifndef ClipScope_h | 5 #ifndef ClipScope_h |
6 #define ClipScope_h | 6 #define ClipScope_h |
7 | 7 |
8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class ClipScope { | 13 class ClipScope { |
14 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 14 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
15 WTF_MAKE_NONCOPYABLE(ClipScope); | 15 WTF_MAKE_NONCOPYABLE(ClipScope); |
16 public: | 16 public: |
17 ClipScope(GraphicsContext* context) | 17 ClipScope(GraphicsContext& context) |
18 : m_context(context) | 18 : m_context(context) |
19 , m_clipCount(0) { } | 19 , m_clipCount(0) { } |
20 ~ClipScope(); | 20 ~ClipScope(); |
21 | 21 |
22 void clip(const LayoutRect& clipRect, SkRegion::Op operation); | 22 void clip(const LayoutRect& clipRect, SkRegion::Op operation); |
23 | 23 |
24 private: | 24 private: |
25 GraphicsContext* m_context; | 25 GraphicsContext& m_context; |
26 int m_clipCount; | 26 int m_clipCount; |
27 }; | 27 }; |
28 | 28 |
29 } // namespace blink | 29 } // namespace blink |
30 | 30 |
31 #endif // ClipScope_h | 31 #endif // ClipScope_h |
OLD | NEW |