OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GFX_COMPOSITOR_LAYER_ANIMATOR_H_ | 5 #ifndef UI_GFX_COMPOSITOR_LAYER_ANIMATION_MANAGER_H_ |
6 #define UI_GFX_COMPOSITOR_LAYER_ANIMATOR_H_ | 6 #define UI_GFX_COMPOSITOR_LAYER_ANIMATION_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "third_party/skia/include/core/SkScalar.h" | 14 #include "third_party/skia/include/core/SkScalar.h" |
15 #include "third_party/skia/include/utils/SkMatrix44.h" | 15 #include "third_party/skia/include/utils/SkMatrix44.h" |
16 #include "ui/base/animation/animation_delegate.h" | 16 #include "ui/base/animation/animation_delegate.h" |
17 #include "ui/gfx/compositor/compositor_export.h" | 17 #include "ui/gfx/compositor/compositor_export.h" |
18 | 18 |
19 namespace gfx { | 19 namespace gfx { |
20 class Point; | 20 class Point; |
21 } | 21 } |
22 | 22 |
23 namespace ui { | 23 namespace ui { |
24 | 24 |
25 class Animation; | 25 class Animation; |
26 class Layer; | 26 class Layer; |
27 class LayerAnimatorDelegate; | 27 class LayerAnimatorDelegate; |
28 class Transform; | 28 class Transform; |
29 | 29 |
30 // LayerAnimator manages animating various properties of a Layer. | 30 // LayerAnimationManager manages animating various properties of a Layer. |
31 class COMPOSITOR_EXPORT LayerAnimator : public ui::AnimationDelegate { | 31 class COMPOSITOR_EXPORT LayerAnimationManager : public ui::AnimationDelegate { |
32 public: | 32 public: |
33 // Types of properties that can be animated. | 33 // Types of properties that can be animated. |
34 enum AnimationProperty { | 34 enum AnimationProperty { |
35 LOCATION, | 35 LOCATION, |
36 OPACITY, | 36 OPACITY, |
37 TRANSFORM, | 37 TRANSFORM, |
38 }; | 38 }; |
39 | 39 |
40 explicit LayerAnimator(Layer* layer); | 40 explicit LayerAnimationManager(Layer* layer); |
41 virtual ~LayerAnimator(); | 41 virtual ~LayerAnimationManager(); |
42 | 42 |
43 // Sets the animation to use. LayerAnimator takes ownership of the animation. | 43 // Sets the animation to use. LayerAnimationManager takes ownership of the |
| 44 // animation. |
44 void SetAnimation(Animation* animation); | 45 void SetAnimation(Animation* animation); |
45 | 46 |
46 ui::Layer* layer() { return layer_; } | 47 ui::Layer* layer() { return layer_; } |
47 | 48 |
48 // Animates the layer to the specified point. The point is relative to the | 49 // Animates the layer to the specified point. The point is relative to the |
49 // parent layer. | 50 // parent layer. |
50 void AnimateToPoint(const gfx::Point& target); | 51 void AnimateToPoint(const gfx::Point& target); |
51 | 52 |
52 // Animates the transform from the current transform to |transform|. | 53 // Animates the transform from the current transform to |transform|. |
53 void AnimateTransform(const Transform& transform); | 54 void AnimateTransform(const Transform& transform); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // The layer. | 114 // The layer. |
114 Layer* layer_; | 115 Layer* layer_; |
115 | 116 |
116 // Properties being animated. | 117 // Properties being animated. |
117 Elements elements_; | 118 Elements elements_; |
118 | 119 |
119 scoped_ptr<ui::Animation> animation_; | 120 scoped_ptr<ui::Animation> animation_; |
120 | 121 |
121 bool got_initial_tick_; | 122 bool got_initial_tick_; |
122 | 123 |
123 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); | 124 DISALLOW_COPY_AND_ASSIGN(LayerAnimationManager); |
124 }; | 125 }; |
125 | 126 |
126 } // namespace ui | 127 } // namespace ui |
127 | 128 |
128 #endif // UI_GFX_COMPOSITOR_LAYER_ANIMATOR_H_ | 129 #endif // UI_GFX_COMPOSITOR_LAYER_ANIMATION_MANAGER_H_ |
OLD | NEW |