| 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_ANIMATOR_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| 6 #define UI_COMPOSITOR_LAYER_ANIMATOR_H_ | 6 #define UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "ui/base/animation/animation_container_element.h" | 16 #include "ui/base/animation/animation_container_element.h" |
| 17 #include "ui/base/animation/animation_container_test_helper.h" |
| 17 #include "ui/base/animation/tween.h" | 18 #include "ui/base/animation/tween.h" |
| 18 #include "ui/compositor/compositor_export.h" | 19 #include "ui/compositor/compositor_export.h" |
| 19 #include "ui/compositor/layer_animation_element.h" | 20 #include "ui/compositor/layer_animation_element.h" |
| 20 | 21 |
| 21 namespace gfx { | 22 namespace gfx { |
| 22 class Rect; | 23 class Rect; |
| 23 class Transform; | 24 class Transform; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace ui { | 27 namespace ui { |
| 27 class Animation; | 28 class Animation; |
| 28 class Layer; | 29 class Layer; |
| 29 class LayerAnimationSequence; | 30 class LayerAnimationSequence; |
| 30 class LayerAnimationDelegate; | 31 class LayerAnimationDelegate; |
| 31 class LayerAnimationObserver; | 32 class LayerAnimationObserver; |
| 32 class ScopedLayerAnimationSettings; | 33 class ScopedLayerAnimationSettings; |
| 33 | 34 |
| 35 namespace internal { |
| 36 |
| 37 // Returns the AnimationContainer we're added to. |
| 38 COMPOSITOR_EXPORT ui::AnimationContainer* GetLayerAnimationContainer(); |
| 39 |
| 40 } // namespace internal |
| 41 |
| 34 // When a property of layer needs to be changed it is set by way of | 42 // When a property of layer needs to be changed it is set by way of |
| 35 // LayerAnimator. This enables LayerAnimator to animate property changes. | 43 // LayerAnimator. This enables LayerAnimator to animate property changes. |
| 36 // NB: during many tests, set_disable_animations_for_test is used and causes | 44 // NB: during many tests, set_disable_animations_for_test is used and causes |
| 37 // all animations to complete immediately. The layer animation is ref counted | 45 // all animations to complete immediately. The layer animation is ref counted |
| 38 // so that if its owning layer is deleted (and the owning layer is only other | 46 // so that if its owning layer is deleted (and the owning layer is only other |
| 39 // class that should ever hold a ref ptr to a LayerAnimator), the animator can | 47 // class that should ever hold a ref ptr to a LayerAnimator), the animator can |
| 40 // ensure that it is not disposed of until it finishes executing. It does this | 48 // ensure that it is not disposed of until it finishes executing. It does this |
| 41 // by holding a reference to itself for the duration of methods for which it | 49 // by holding a reference to itself for the duration of methods for which it |
| 42 // must guarantee that |this| is valid. | 50 // must guarantee that |this| is valid. |
| 43 class COMPOSITOR_EXPORT LayerAnimator | 51 class COMPOSITOR_EXPORT LayerAnimator |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // Observers are notified when layer animations end, are scheduled or are | 364 // Observers are notified when layer animations end, are scheduled or are |
| 357 // aborted. | 365 // aborted. |
| 358 ObserverList<LayerAnimationObserver> observers_; | 366 ObserverList<LayerAnimationObserver> observers_; |
| 359 | 367 |
| 360 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); | 368 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); |
| 361 }; | 369 }; |
| 362 | 370 |
| 363 } // namespace ui | 371 } // namespace ui |
| 364 | 372 |
| 365 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ | 373 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| OLD | NEW |