Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: cc/animation/layer_animation_controller.h

Issue 68503014: cc: Alow animations to be aborted from either thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_LAYER_ANIMATION_CONTROLLER_H_ 5 #ifndef CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_
6 #define CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ 6 #define CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 20 matching lines...) Expand all
31 class KeyframeValueList; 31 class KeyframeValueList;
32 class LayerAnimationValueObserver; 32 class LayerAnimationValueObserver;
33 33
34 class CC_EXPORT LayerAnimationController 34 class CC_EXPORT LayerAnimationController
35 : public base::RefCounted<LayerAnimationController> { 35 : public base::RefCounted<LayerAnimationController> {
36 public: 36 public:
37 static scoped_refptr<LayerAnimationController> Create(int id); 37 static scoped_refptr<LayerAnimationController> Create(int id);
38 38
39 int id() const { return id_; } 39 int id() const { return id_; }
40 40
41 // These methods are virtual for testing. 41 void AddAnimation(scoped_ptr<Animation> animation);
42 virtual void AddAnimation(scoped_ptr<Animation> animation); 42 void PauseAnimation(int animation_id, double time_offset);
43 virtual void PauseAnimation(int animation_id, double time_offset); 43 void RemoveAnimation(int animation_id);
44 virtual void RemoveAnimation(int animation_id); 44 void RemoveAnimation(int animation_id,
45 virtual void RemoveAnimation(int animation_id, 45 Animation::TargetProperty target_property);
ajuma 2013/11/14 21:56:03 These were marked "virtual for testing", but none
Ian Vollick 2013/11/15 01:48:56 Thanks for fixing up the comment/virts.
46 Animation::TargetProperty target_property); 46 void AbortAnimations(Animation::TargetProperty target_property);
47 47
48 // Ensures that the list of active animations on the main thread and the impl 48 // Ensures that the list of active animations on the main thread and the impl
49 // thread are kept in sync. This function does not take ownership of the impl 49 // thread are kept in sync. This function does not take ownership of the impl
50 // thread controller. 50 // thread controller. This method is virtual for testing.
51 virtual void PushAnimationUpdatesTo( 51 virtual void PushAnimationUpdatesTo(
52 LayerAnimationController* controller_impl); 52 LayerAnimationController* controller_impl);
53 53
54 void Animate(double monotonic_time); 54 void Animate(double monotonic_time);
55 void AccumulatePropertyUpdates(double monotonic_time, 55 void AccumulatePropertyUpdates(double monotonic_time,
56 AnimationEventsVector* events); 56 AnimationEventsVector* events);
57 57
58 void UpdateState(bool start_ready_animations, 58 void UpdateState(bool start_ready_animations,
59 AnimationEventsVector* events); 59 AnimationEventsVector* events);
60 60
(...skipping 22 matching lines...) Expand all
83 // impl thread, all animations will be transferred. 83 // impl thread, all animations will be transferred.
84 void set_force_sync() { force_sync_ = true; } 84 void set_force_sync() { force_sync_ = true; }
85 85
86 void SetAnimationRegistrar(AnimationRegistrar* registrar); 86 void SetAnimationRegistrar(AnimationRegistrar* registrar);
87 AnimationRegistrar* animation_registrar() { return registrar_; } 87 AnimationRegistrar* animation_registrar() { return registrar_; }
88 88
89 void NotifyAnimationStarted(const AnimationEvent& event, 89 void NotifyAnimationStarted(const AnimationEvent& event,
90 double wall_clock_time); 90 double wall_clock_time);
91 void NotifyAnimationFinished(const AnimationEvent& event, 91 void NotifyAnimationFinished(const AnimationEvent& event,
92 double wall_clock_time); 92 double wall_clock_time);
93 void NotifyAnimationAborted(const AnimationEvent& event);
93 void NotifyAnimationPropertyUpdate(const AnimationEvent& event); 94 void NotifyAnimationPropertyUpdate(const AnimationEvent& event);
94 95
95 void AddValueObserver(LayerAnimationValueObserver* observer); 96 void AddValueObserver(LayerAnimationValueObserver* observer);
96 void RemoveValueObserver(LayerAnimationValueObserver* observer); 97 void RemoveValueObserver(LayerAnimationValueObserver* observer);
97 98
98 void AddEventObserver(LayerAnimationEventObserver* observer); 99 void AddEventObserver(LayerAnimationEventObserver* observer);
99 void RemoveEventObserver(LayerAnimationEventObserver* observer); 100 void RemoveEventObserver(LayerAnimationEventObserver* observer);
100 101
101 void set_layer_animation_delegate(AnimationDelegate* delegate) { 102 void set_layer_animation_delegate(AnimationDelegate* delegate) {
102 layer_animation_delegate_ = delegate; 103 layer_animation_delegate_ = delegate;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 ObserverList<LayerAnimationEventObserver> event_observers_; 165 ObserverList<LayerAnimationEventObserver> event_observers_;
165 166
166 AnimationDelegate* layer_animation_delegate_; 167 AnimationDelegate* layer_animation_delegate_;
167 168
168 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); 169 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController);
169 }; 170 };
170 171
171 } // namespace cc 172 } // namespace cc
172 173
173 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ 174 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698