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 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 const gfx::Rect& bounds() const { return bounds_; } | 98 const gfx::Rect& bounds() const { return bounds_; } |
99 | 99 |
100 // The opacity of the layer. The opacity is applied to each pixel of the | 100 // The opacity of the layer. The opacity is applied to each pixel of the |
101 // texture (resulting alpha = opacity * alpha). | 101 // texture (resulting alpha = opacity * alpha). |
102 float opacity() const { return opacity_; } | 102 float opacity() const { return opacity_; } |
103 void SetOpacity(float opacity); | 103 void SetOpacity(float opacity); |
104 | 104 |
105 // Sets the visibility of the Layer. A Layer may be visible but not | 105 // Sets the visibility of the Layer. A Layer may be visible but not |
106 // drawn. This happens if any ancestor of a Layer is not visible. | 106 // drawn. This happens if any ancestor of a Layer is not visible. |
107 void SetVisible(bool visible); | 107 void SetVisible(bool visible); |
| 108 bool visible() const { return visible_; } |
108 | 109 |
109 // Returns true if this Layer is drawn. A Layer is drawn only if all ancestors | 110 // Returns true if this Layer is drawn. A Layer is drawn only if all ancestors |
110 // are visible. | 111 // are visible. |
111 bool IsDrawn() const; | 112 bool IsDrawn() const; |
112 | 113 |
113 // Returns true if this layer can have a texture (has_texture_ is true) | 114 // Returns true if this layer can have a texture (has_texture_ is true) |
114 // and is not completely obscured by a child. | 115 // and is not completely obscured by a child. |
115 bool ShouldDraw(); | 116 bool ShouldDraw(); |
116 | 117 |
117 // Converts a point from the coordinates of |source| to the coordinates of | 118 // Converts a point from the coordinates of |source| to the coordinates of |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 LayerDelegate* delegate_; | 266 LayerDelegate* delegate_; |
266 | 267 |
267 scoped_ptr<LayerAnimator> animator_; | 268 scoped_ptr<LayerAnimator> animator_; |
268 | 269 |
269 DISALLOW_COPY_AND_ASSIGN(Layer); | 270 DISALLOW_COPY_AND_ASSIGN(Layer); |
270 }; | 271 }; |
271 | 272 |
272 } // namespace ui | 273 } // namespace ui |
273 | 274 |
274 #endif // UI_GFX_COMPOSITOR_LAYER_H_ | 275 #endif // UI_GFX_COMPOSITOR_LAYER_H_ |
OLD | NEW |