OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 ScopedPaintChunkProperties_h | 5 #ifndef ScopedPaintChunkProperties_h |
6 #define ScopedPaintChunkProperties_h | 6 #define ScopedPaintChunkProperties_h |
7 | 7 |
8 #include "platform/graphics/paint/PaintChunkProperties.h" | 8 #include "platform/graphics/paint/PaintChunkProperties.h" |
9 #include "platform/graphics/paint/PaintController.h" | 9 #include "platform/graphics/paint/PaintController.h" |
| 10 #include "wtf/Allocator.h" |
10 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
11 | 12 |
12 namespace blink { | 13 namespace blink { |
13 | 14 |
14 class ScopedPaintChunkProperties { | 15 class ScopedPaintChunkProperties { |
| 16 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
15 WTF_MAKE_NONCOPYABLE(ScopedPaintChunkProperties); | 17 WTF_MAKE_NONCOPYABLE(ScopedPaintChunkProperties); |
16 public: | 18 public: |
17 ScopedPaintChunkProperties(PaintController& paintController, const PaintChun
kProperties& properties) | 19 ScopedPaintChunkProperties(PaintController& paintController, const PaintChun
kProperties& properties) |
18 : m_paintController(paintController) | 20 : m_paintController(paintController) |
19 , m_previousProperties(paintController.currentPaintChunkProperties()) | 21 , m_previousProperties(paintController.currentPaintChunkProperties()) |
20 { | 22 { |
21 m_paintController.updateCurrentPaintChunkProperties(properties); | 23 m_paintController.updateCurrentPaintChunkProperties(properties); |
22 } | 24 } |
23 | 25 |
24 ~ScopedPaintChunkProperties() | 26 ~ScopedPaintChunkProperties() |
25 { | 27 { |
26 m_paintController.updateCurrentPaintChunkProperties(m_previousProperties
); | 28 m_paintController.updateCurrentPaintChunkProperties(m_previousProperties
); |
27 } | 29 } |
28 | 30 |
29 private: | 31 private: |
30 PaintController& m_paintController; | 32 PaintController& m_paintController; |
31 PaintChunkProperties m_previousProperties; | 33 PaintChunkProperties m_previousProperties; |
32 }; | 34 }; |
33 | 35 |
34 } // namespace blink | 36 } // namespace blink |
35 | 37 |
36 #endif // ScopedPaintChunkProperties_h | 38 #endif // ScopedPaintChunkProperties_h |
OLD | NEW |