| 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 virtual gfx::Transform GetTransformForAnimation() const OVERRIDE; | 359 virtual gfx::Transform GetTransformForAnimation() const OVERRIDE; |
| 360 virtual float GetOpacityForAnimation() const OVERRIDE; | 360 virtual float GetOpacityForAnimation() const OVERRIDE; |
| 361 virtual bool GetVisibilityForAnimation() const OVERRIDE; | 361 virtual bool GetVisibilityForAnimation() const OVERRIDE; |
| 362 virtual float GetBrightnessForAnimation() const OVERRIDE; | 362 virtual float GetBrightnessForAnimation() const OVERRIDE; |
| 363 virtual float GetGrayscaleForAnimation() const OVERRIDE; | 363 virtual float GetGrayscaleForAnimation() const OVERRIDE; |
| 364 virtual SkColor GetColorForAnimation() const OVERRIDE; | 364 virtual SkColor GetColorForAnimation() const OVERRIDE; |
| 365 virtual float GetDeviceScaleFactor() const OVERRIDE; | 365 virtual float GetDeviceScaleFactor() const OVERRIDE; |
| 366 virtual void AddThreadedAnimation( | 366 virtual void AddThreadedAnimation( |
| 367 scoped_ptr<cc::Animation> animation) OVERRIDE; | 367 scoped_ptr<cc::Animation> animation) OVERRIDE; |
| 368 virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE; | 368 virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE; |
| 369 virtual LayerAnimatorCollection* GetLayerAnimatorCollection() OVERRIDE; |
| 369 | 370 |
| 370 // Creates a corresponding composited layer for |type_|. | 371 // Creates a corresponding composited layer for |type_|. |
| 371 void CreateWebLayer(); | 372 void CreateWebLayer(); |
| 372 | 373 |
| 373 // Recomputes and sets to |cc_layer_|. | 374 // Recomputes and sets to |cc_layer_|. |
| 374 void RecomputeDrawsContentAndUVRect(); | 375 void RecomputeDrawsContentAndUVRect(); |
| 375 void RecomputePosition(); | 376 void RecomputePosition(); |
| 376 | 377 |
| 377 // Set all filters which got applied to the layer. | 378 // Set all filters which got applied to the layer. |
| 378 void SetLayerFilters(); | 379 void SetLayerFilters(); |
| 379 | 380 |
| 380 // Set all filters which got applied to the layer background. | 381 // Set all filters which got applied to the layer background. |
| 381 void SetLayerBackgroundFilters(); | 382 void SetLayerBackgroundFilters(); |
| 382 | 383 |
| 383 // Cleanup |cc_layer_| and replaces it with |new_layer|. | 384 // Cleanup |cc_layer_| and replaces it with |new_layer|. |
| 384 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); | 385 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); |
| 385 | 386 |
| 386 // We cannot send animations to our cc_layer_ until we have been added to a | 387 // We cannot send animations to our cc_layer_ until we have been added to a |
| 387 // layer tree. Instead, we hold on to these animations in | 388 // layer tree. Instead, we hold on to these animations in |
| 388 // pending_threaded_animations_, and expect SendPendingThreadedAnimations to | 389 // pending_threaded_animations_, and expect SendPendingThreadedAnimations to |
| 389 // be called once we have been added to a tree. | 390 // be called once we have been added to a tree. |
| 390 void SendPendingThreadedAnimations(); | 391 void SendPendingThreadedAnimations(); |
| 391 | 392 |
| 393 // Returns whether the layer has an animating LayerAnimator. |
| 394 bool IsAnimating() const; |
| 395 |
| 392 const LayerType type_; | 396 const LayerType type_; |
| 393 | 397 |
| 394 Compositor* compositor_; | 398 Compositor* compositor_; |
| 395 | 399 |
| 396 Layer* parent_; | 400 Layer* parent_; |
| 397 | 401 |
| 398 // This layer's children, in bottom-to-top stacking order. | 402 // This layer's children, in bottom-to-top stacking order. |
| 399 std::vector<Layer*> children_; | 403 std::vector<Layer*> children_; |
| 400 | 404 |
| 401 gfx::Rect bounds_; | 405 gfx::Rect bounds_; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 475 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
| 472 // or SetTextureMailbox was called. | 476 // or SetTextureMailbox was called. |
| 473 gfx::Size frame_size_in_dip_; | 477 gfx::Size frame_size_in_dip_; |
| 474 | 478 |
| 475 DISALLOW_COPY_AND_ASSIGN(Layer); | 479 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 476 }; | 480 }; |
| 477 | 481 |
| 478 } // namespace ui | 482 } // namespace ui |
| 479 | 483 |
| 480 #endif // UI_COMPOSITOR_LAYER_H_ | 484 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |