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 void AddAnimatorsInTreeToCollection(LayerAnimatorCollection* collection); |
| 394 void RemoveAnimatorsInTreeFromCollection(LayerAnimatorCollection* collection); |
| 395 |
| 396 // Returns whether the layer has an animating LayerAnimator. |
| 397 bool IsAnimating() const; |
| 398 |
392 const LayerType type_; | 399 const LayerType type_; |
393 | 400 |
394 Compositor* compositor_; | 401 Compositor* compositor_; |
395 | 402 |
396 Layer* parent_; | 403 Layer* parent_; |
397 | 404 |
398 // This layer's children, in bottom-to-top stacking order. | 405 // This layer's children, in bottom-to-top stacking order. |
399 std::vector<Layer*> children_; | 406 std::vector<Layer*> children_; |
400 | 407 |
401 gfx::Rect bounds_; | 408 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 | 478 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
472 // or SetTextureMailbox was called. | 479 // or SetTextureMailbox was called. |
473 gfx::Size frame_size_in_dip_; | 480 gfx::Size frame_size_in_dip_; |
474 | 481 |
475 DISALLOW_COPY_AND_ASSIGN(Layer); | 482 DISALLOW_COPY_AND_ASSIGN(Layer); |
476 }; | 483 }; |
477 | 484 |
478 } // namespace ui | 485 } // namespace ui |
479 | 486 |
480 #endif // UI_COMPOSITOR_LAYER_H_ | 487 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |