OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_ANIMATION_ANIMATION_REGISTRAR_H_ | 5 #ifndef CC_ANIMATION_ANIMATION_REGISTRAR_H_ |
6 #define CC_ANIMATION_ANIMATION_REGISTRAR_H_ | 6 #define CC_ANIMATION_ANIMATION_REGISTRAR_H_ |
7 | 7 |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "cc/animation/animation_events.h" | 12 #include "base/time/time.h" |
13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
| 17 class AnimationEvents; |
17 class LayerAnimationController; | 18 class LayerAnimationController; |
18 | 19 |
19 class CC_EXPORT AnimationRegistrar { | 20 class CC_EXPORT AnimationRegistrar { |
20 public: | 21 public: |
21 typedef base::hash_map<int, LayerAnimationController*> AnimationControllerMap; | 22 typedef base::hash_map<int, LayerAnimationController*> AnimationControllerMap; |
22 | 23 |
23 static scoped_ptr<AnimationRegistrar> Create() { | 24 static scoped_ptr<AnimationRegistrar> Create() { |
24 return make_scoped_ptr(new AnimationRegistrar()); | 25 return make_scoped_ptr(new AnimationRegistrar()); |
25 } | 26 } |
26 | 27 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 61 |
61 bool supports_scroll_animations() { return supports_scroll_animations_; } | 62 bool supports_scroll_animations() { return supports_scroll_animations_; } |
62 | 63 |
63 bool needs_animate_layers() const { | 64 bool needs_animate_layers() const { |
64 return !active_animation_controllers_.empty(); | 65 return !active_animation_controllers_.empty(); |
65 } | 66 } |
66 | 67 |
67 bool ActivateAnimations(); | 68 bool ActivateAnimations(); |
68 bool AnimateLayers(base::TimeTicks monotonic_time); | 69 bool AnimateLayers(base::TimeTicks monotonic_time); |
69 bool UpdateAnimationState(bool start_ready_animations, | 70 bool UpdateAnimationState(bool start_ready_animations, |
70 AnimationEventsVector* events); | 71 AnimationEvents* events); |
71 | 72 |
72 scoped_ptr<AnimationEventsVector> CreateEvents() { | 73 scoped_ptr<AnimationEvents> CreateEvents(); |
73 return make_scoped_ptr(new AnimationEventsVector()); | 74 void SetAnimationEvents(scoped_ptr<AnimationEvents> events); |
74 } | |
75 | |
76 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> events); | |
77 | 75 |
78 private: | 76 private: |
79 AnimationRegistrar(); | 77 AnimationRegistrar(); |
80 | 78 |
81 AnimationControllerMap active_animation_controllers_; | 79 AnimationControllerMap active_animation_controllers_; |
82 AnimationControllerMap all_animation_controllers_; | 80 AnimationControllerMap all_animation_controllers_; |
83 | 81 |
84 bool supports_scroll_animations_; | 82 bool supports_scroll_animations_; |
85 | 83 |
86 DISALLOW_COPY_AND_ASSIGN(AnimationRegistrar); | 84 DISALLOW_COPY_AND_ASSIGN(AnimationRegistrar); |
87 }; | 85 }; |
88 | 86 |
89 } // namespace cc | 87 } // namespace cc |
90 | 88 |
91 #endif // CC_ANIMATION_ANIMATION_REGISTRAR_H_ | 89 #endif // CC_ANIMATION_ANIMATION_REGISTRAR_H_ |
OLD | NEW |