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; | |
370 | 369 |
371 // Creates a corresponding composited layer for |type_|. | 370 // Creates a corresponding composited layer for |type_|. |
372 void CreateWebLayer(); | 371 void CreateWebLayer(); |
373 | 372 |
374 // Recomputes and sets to |cc_layer_|. | 373 // Recomputes and sets to |cc_layer_|. |
375 void RecomputeDrawsContentAndUVRect(); | 374 void RecomputeDrawsContentAndUVRect(); |
376 void RecomputePosition(); | 375 void RecomputePosition(); |
377 | 376 |
378 // Set all filters which got applied to the layer. | 377 // Set all filters which got applied to the layer. |
379 void SetLayerFilters(); | 378 void SetLayerFilters(); |
380 | 379 |
381 // Set all filters which got applied to the layer background. | 380 // Set all filters which got applied to the layer background. |
382 void SetLayerBackgroundFilters(); | 381 void SetLayerBackgroundFilters(); |
383 | 382 |
384 // Cleanup |cc_layer_| and replaces it with |new_layer|. | 383 // Cleanup |cc_layer_| and replaces it with |new_layer|. |
385 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); | 384 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); |
386 | 385 |
387 // We cannot send animations to our cc_layer_ until we have been added to a | 386 // We cannot send animations to our cc_layer_ until we have been added to a |
388 // layer tree. Instead, we hold on to these animations in | 387 // layer tree. Instead, we hold on to these animations in |
389 // pending_threaded_animations_, and expect SendPendingThreadedAnimations to | 388 // pending_threaded_animations_, and expect SendPendingThreadedAnimations to |
390 // be called once we have been added to a tree. | 389 // be called once we have been added to a tree. |
391 void SendPendingThreadedAnimations(); | 390 void SendPendingThreadedAnimations(); |
392 | 391 |
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 | |
399 const LayerType type_; | 392 const LayerType type_; |
400 | 393 |
401 Compositor* compositor_; | 394 Compositor* compositor_; |
402 | 395 |
403 Layer* parent_; | 396 Layer* parent_; |
404 | 397 |
405 // This layer's children, in bottom-to-top stacking order. | 398 // This layer's children, in bottom-to-top stacking order. |
406 std::vector<Layer*> children_; | 399 std::vector<Layer*> children_; |
407 | 400 |
408 gfx::Rect bounds_; | 401 gfx::Rect bounds_; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 471 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
479 // or SetTextureMailbox was called. | 472 // or SetTextureMailbox was called. |
480 gfx::Size frame_size_in_dip_; | 473 gfx::Size frame_size_in_dip_; |
481 | 474 |
482 DISALLOW_COPY_AND_ASSIGN(Layer); | 475 DISALLOW_COPY_AND_ASSIGN(Layer); |
483 }; | 476 }; |
484 | 477 |
485 } // namespace ui | 478 } // namespace ui |
486 | 479 |
487 #endif // UI_COMPOSITOR_LAYER_H_ | 480 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |