OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LAYER_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_H_ |
6 #define UI_COMPOSITOR_LAYER_H_ | 6 #define UI_COMPOSITOR_LAYER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // The opacity of the layer. The opacity is applied to each pixel of the | 127 // The opacity of the layer. The opacity is applied to each pixel of the |
128 // texture (resulting alpha = opacity * alpha). | 128 // texture (resulting alpha = opacity * alpha). |
129 float opacity() const { return opacity_; } | 129 float opacity() const { return opacity_; } |
130 void SetOpacity(float opacity); | 130 void SetOpacity(float opacity); |
131 | 131 |
132 // Blur pixels by this amount in anything below the layer and visible through | 132 // Blur pixels by this amount in anything below the layer and visible through |
133 // the layer. | 133 // the layer. |
134 int background_blur() const { return background_blur_radius_; } | 134 int background_blur() const { return background_blur_radius_; } |
135 void SetBackgroundBlur(int blur_radius); | 135 void SetBackgroundBlur(int blur_radius); |
136 | 136 |
137 // Invert the layer. | |
138 bool inverted() const { return inverted_; } | |
139 void SetInverted(bool inverted); | |
140 | |
141 // Return the target opacity if animator is running, or the current opacity | 137 // Return the target opacity if animator is running, or the current opacity |
142 // otherwise. | 138 // otherwise. |
143 float GetTargetOpacity() const; | 139 float GetTargetOpacity() const; |
144 | 140 |
145 // Sets the visibility of the Layer. A Layer may be visible but not | 141 // Sets the visibility of the Layer. A Layer may be visible but not |
146 // drawn. This happens if any ancestor of a Layer is not visible. | 142 // drawn. This happens if any ancestor of a Layer is not visible. |
147 void SetVisible(bool visible); | 143 void SetVisible(bool visible); |
148 bool visible() const { return visible_; } | 144 bool visible() const { return visible_; } |
149 | 145 |
150 // Returns the target visibility if the animator is running. Otherwise, it | 146 // Returns the target visibility if the animator is running. Otherwise, it |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 281 |
286 // If true the layer is always up to date. | 282 // If true the layer is always up to date. |
287 bool layer_updated_externally_; | 283 bool layer_updated_externally_; |
288 | 284 |
289 // Union of damaged rects, in pixel coordinates, to be used when | 285 // Union of damaged rects, in pixel coordinates, to be used when |
290 // compositor is ready to paint the content. | 286 // compositor is ready to paint the content. |
291 SkRegion damaged_region_; | 287 SkRegion damaged_region_; |
292 | 288 |
293 float opacity_; | 289 float opacity_; |
294 int background_blur_radius_; | 290 int background_blur_radius_; |
295 bool inverted_; | |
296 | 291 |
297 std::string name_; | 292 std::string name_; |
298 | 293 |
299 LayerDelegate* delegate_; | 294 LayerDelegate* delegate_; |
300 | 295 |
301 scoped_ptr<LayerAnimator> animator_; | 296 scoped_ptr<LayerAnimator> animator_; |
302 | 297 |
303 WebKit::WebLayer web_layer_; | 298 WebKit::WebLayer web_layer_; |
304 bool web_layer_is_accelerated_; | 299 bool web_layer_is_accelerated_; |
305 bool show_debug_borders_; | 300 bool show_debug_borders_; |
306 | 301 |
307 // If true, the layer scales the canvas using device scale factor | 302 // If true, the layer scales the canvas using device scale factor |
308 // before passing to LayerDelegate::OnLayerPaint. | 303 // before passing to LayerDelegate::OnLayerPaint. |
309 bool scale_canvas_; | 304 bool scale_canvas_; |
310 | 305 |
311 // A cached copy of |Compositor::device_scale_factor()|. | 306 // A cached copy of |Compositor::device_scale_factor()|. |
312 float device_scale_factor_; | 307 float device_scale_factor_; |
313 | 308 |
314 DISALLOW_COPY_AND_ASSIGN(Layer); | 309 DISALLOW_COPY_AND_ASSIGN(Layer); |
315 }; | 310 }; |
316 | 311 |
317 } // namespace ui | 312 } // namespace ui |
318 | 313 |
319 #endif // UI_COMPOSITOR_LAYER_H_ | 314 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |