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 UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_ | 5 #ifndef UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_ |
6 #define UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_ | 6 #define UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/compositor/compositor_export.h" | 9 #include "ui/compositor/compositor_export.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class Canvas; | 12 class Canvas; |
13 class Path; | |
13 class Rect; | 14 class Rect; |
14 class Transform; | 15 class Transform; |
15 } | 16 } |
16 | 17 |
17 namespace ui { | 18 namespace ui { |
18 class PaintContext; | 19 class PaintContext; |
19 | 20 |
20 // A class to provide scoped clips and transforms of painting to a | 21 // A class to provide scoped clips and transforms of painting to a |
21 // DisplayItemList. The the clip/transform provided will be applied to any | 22 // DisplayItemList. The the clip/transform provided will be applied to any |
22 // DisplayItems added to the DisplayItemList while this object is alive. In | 23 // DisplayItems added to the DisplayItemList while this object is alive. In |
23 // other words, any nested PaintRecorders or other ClipTransformRecorders will | 24 // other words, any nested PaintRecorders or other ClipTransformRecorders will |
24 // be clipped/transformed. | 25 // be clipped/transformed. |
25 class COMPOSITOR_EXPORT ClipTransformRecorder { | 26 class COMPOSITOR_EXPORT ClipTransformRecorder { |
26 public: | 27 public: |
27 ClipTransformRecorder(const PaintContext& context, | 28 ClipTransformRecorder(const PaintContext& context); |
piman
2015/04/06 21:24:01
nit: explicit
danakj
2015/04/06 21:25:33
good eye :) thanks, done.
| |
28 const gfx::Rect& clip_rect); | |
29 ClipTransformRecorder(const PaintContext& context, | |
30 const gfx::Transform& transform); | |
31 ClipTransformRecorder(const PaintContext& context, | |
32 const gfx::Rect& clip_rect, | |
33 const gfx::Transform& transform); | |
34 ~ClipTransformRecorder(); | 29 ~ClipTransformRecorder(); |
35 | 30 |
31 void ClipRect(const gfx::Rect& clip_rect); | |
32 void ClipPath(const gfx::Path& clip_path); | |
33 void ClipPathWithAntiAliasing(const gfx::Path& clip_path); | |
34 void Transform(const gfx::Transform& transform); | |
35 | |
36 private: | 36 private: |
37 gfx::Canvas* canvas_; | 37 gfx::Canvas* canvas_; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(ClipTransformRecorder); | 39 DISALLOW_COPY_AND_ASSIGN(ClipTransformRecorder); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace ui | 42 } // namespace ui |
43 | 43 |
44 #endif // UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_ | 44 #endif // UI_COMPOSITOR_CLIP_TRANSFORM_RECORDER_H_ |
OLD | NEW |