| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 Transform* transform) const; | 290 Transform* transform) const; |
| 291 | 291 |
| 292 // The only externally updated layers are ones that get their pixels from | 292 // The only externally updated layers are ones that get their pixels from |
| 293 // WebKit and WebKit does not produce valid alpha values. All other layers | 293 // WebKit and WebKit does not produce valid alpha values. All other layers |
| 294 // should have valid alpha. | 294 // should have valid alpha. |
| 295 bool has_valid_alpha_channel() const { return !layer_updated_externally_; } | 295 bool has_valid_alpha_channel() const { return !layer_updated_externally_; } |
| 296 | 296 |
| 297 // Following are invoked from the animation or if no animation exists to | 297 // Following are invoked from the animation or if no animation exists to |
| 298 // update the values immediately. | 298 // update the values immediately. |
| 299 void SetBoundsImmediately(const gfx::Rect& bounds); | 299 void SetBoundsImmediately(const gfx::Rect& bounds); |
| 300 void SetTransformImmediately(const ui::Transform& transform); | 300 void SetTransformImmediately(const gfx::Transform& transform); |
| 301 void SetOpacityImmediately(float opacity); | 301 void SetOpacityImmediately(float opacity); |
| 302 void SetVisibilityImmediately(bool visibility); | 302 void SetVisibilityImmediately(bool visibility); |
| 303 void SetBrightnessImmediately(float brightness); | 303 void SetBrightnessImmediately(float brightness); |
| 304 void SetGrayscaleImmediately(float grayscale); | 304 void SetGrayscaleImmediately(float grayscale); |
| 305 | 305 |
| 306 // Implementation of LayerAnimatorDelegate | 306 // Implementation of LayerAnimatorDelegate |
| 307 virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) OVERRIDE; | 307 virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) OVERRIDE; |
| 308 virtual void SetTransformFromAnimation(const Transform& transform) OVERRIDE; | 308 virtual void SetTransformFromAnimation(const Transform& transform) OVERRIDE; |
| 309 virtual void SetOpacityFromAnimation(float opacity) OVERRIDE; | 309 virtual void SetOpacityFromAnimation(float opacity) OVERRIDE; |
| 310 virtual void SetVisibilityFromAnimation(bool visibility) OVERRIDE; | 310 virtual void SetVisibilityFromAnimation(bool visibility) OVERRIDE; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 330 | 330 |
| 331 Compositor* compositor_; | 331 Compositor* compositor_; |
| 332 | 332 |
| 333 scoped_refptr<ui::Texture> texture_; | 333 scoped_refptr<ui::Texture> texture_; |
| 334 | 334 |
| 335 Layer* parent_; | 335 Layer* parent_; |
| 336 | 336 |
| 337 // This layer's children, in bottom-to-top stacking order. | 337 // This layer's children, in bottom-to-top stacking order. |
| 338 std::vector<Layer*> children_; | 338 std::vector<Layer*> children_; |
| 339 | 339 |
| 340 ui::Transform transform_; | 340 gfx::Transform transform_; |
| 341 | 341 |
| 342 gfx::Rect bounds_; | 342 gfx::Rect bounds_; |
| 343 | 343 |
| 344 // Visibility of this layer. See SetVisible/IsDrawn for more details. | 344 // Visibility of this layer. See SetVisible/IsDrawn for more details. |
| 345 bool visible_; | 345 bool visible_; |
| 346 | 346 |
| 347 bool force_render_surface_; | 347 bool force_render_surface_; |
| 348 | 348 |
| 349 bool fills_bounds_opaquely_; | 349 bool fills_bounds_opaquely_; |
| 350 | 350 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 // A cached copy of |Compositor::device_scale_factor()|. | 394 // A cached copy of |Compositor::device_scale_factor()|. |
| 395 float device_scale_factor_; | 395 float device_scale_factor_; |
| 396 | 396 |
| 397 DISALLOW_COPY_AND_ASSIGN(Layer); | 397 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 398 }; | 398 }; |
| 399 | 399 |
| 400 } // namespace ui | 400 } // namespace ui |
| 401 | 401 |
| 402 #endif // UI_COMPOSITOR_LAYER_H_ | 402 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |