OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GFX_COMPOSITOR_LAYER_H_ | 5 #ifndef UI_GFX_COMPOSITOR_LAYER_H_ |
6 #define UI_GFX_COMPOSITOR_LAYER_H_ | 6 #define UI_GFX_COMPOSITOR_LAYER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
13 #include "ui/gfx/transform.h" | 13 #include "ui/gfx/transform.h" |
14 #include "ui/gfx/compositor/compositor.h" | 14 #include "ui/gfx/compositor/compositor.h" |
15 | 15 |
16 class SkCanvas; | 16 class SkCanvas; |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 | 19 |
20 class Compositor; | 20 class Compositor; |
21 class Texture; | 21 class Texture; |
22 | 22 |
23 // Layer manages a texture, transform and a set of child Layers. Any View that | 23 // Layer manages a texture, transform and a set of child Layers. Any View that |
24 // has enabled layers ends up creating a Layer to manage the texture. | 24 // has enabled layers ends up creating a Layer to manage the texture. |
25 // | 25 // |
26 // NOTE: unlike Views, each Layer does *not* own its children views. If you | 26 // NOTE: unlike Views, each Layer does *not* own its children views. If you |
27 // delete a Layer and it has children, the parent of each child layer is set to | 27 // delete a Layer and it has children, the parent of each child layer is set to |
28 // NULL, but the children are not deleted. | 28 // NULL, but the children are not deleted. |
29 class Layer { | 29 class COMPOSITOR_EXPORT Layer { |
30 public: | 30 public: |
31 explicit Layer(Compositor* compositor); | 31 explicit Layer(Compositor* compositor); |
32 ~Layer(); | 32 ~Layer(); |
33 | 33 |
34 // Adds a new Layer to this Layer. | 34 // Adds a new Layer to this Layer. |
35 void Add(Layer* child); | 35 void Add(Layer* child); |
36 | 36 |
37 // Removes a Layer from this Layer. | 37 // Removes a Layer from this Layer. |
38 void Remove(Layer* child); | 38 void Remove(Layer* child); |
39 | 39 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 bool fills_bounds_opaquely_; | 117 bool fills_bounds_opaquely_; |
118 | 118 |
119 gfx::Rect hole_rect_; | 119 gfx::Rect hole_rect_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(Layer); | 121 DISALLOW_COPY_AND_ASSIGN(Layer); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace ui | 124 } // namespace ui |
125 | 125 |
126 #endif // UI_GFX_COMPOSITOR_LAYER_H_ | 126 #endif // UI_GFX_COMPOSITOR_LAYER_H_ |
OLD | NEW |