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

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

Issue 1734063003: Share animations from compositor to main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make NotifyAnimationTakeover pure virtual Created 4 years, 10 months 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
« no previous file with comments | « no previous file | cc/animation/animation_delegate.h » ('j') | cc/animation/animation_delegate.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ANIMATION_H_ 5 #ifndef CC_ANIMATION_ANIMATION_H_
6 #define CC_ANIMATION_ANIMATION_H_ 6 #define CC_ANIMATION_ANIMATION_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "cc/animation/target_property.h" 11 #include "cc/animation/target_property.h"
12 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
13 13
14 namespace cc { 14 namespace cc {
15 15
16 class AnimationCurve; 16 class AnimationCurve;
17 17
18 // An Animation contains all the state required to play an AnimationCurve. 18 // An Animation contains all the state required to play an AnimationCurve.
19 // Specifically, the affected property, the run state (paused, finished, etc.), 19 // Specifically, the affected property, the run state (paused, finished, etc.),
20 // loop count, last pause time, and the total time spent paused. 20 // loop count, last pause time, and the total time spent paused.
21 class CC_EXPORT Animation { 21 class CC_EXPORT Animation {
22 public: 22 public:
23 // Animations begin in the 'WAITING_FOR_TARGET_AVAILABILITY' state. An 23 // Animations begin in the 'WAITING_FOR_TARGET_AVAILABILITY' state. An
24 // Animation waiting for target availibility will run as soon as its target 24 // Animation waiting for target availibility will run as soon as its target
25 // property is free (and all the animations animating with it are also able to 25 // property is free (and all the animations animating with it are also able to
26 // run). When this time arrives, the controller will move the animation into 26 // run). When this time arrives, the controller will move the animation into
27 // the STARTING state, and then into the RUNNING state. RUNNING animations may 27 // the STARTING state, and then into the RUNNING state. RUNNING animations may
28 // toggle between RUNNING and PAUSED, and may be stopped by moving into either 28 // toggle between RUNNING and PAUSED, and may be stopped by moving into either
29 // the ABORTED or FINISHED states. A FINISHED animation was allowed to run to 29 // the ABORTED or FINISHED states. A FINISHED animation was allowed to run to
30 // completion, but an ABORTED animation was not. 30 // completion, but an ABORTED animation was not. An animation in the state
31 // ABORTED_BUT_NEEDS_COMPLETION is an animation that was aborted for
32 // some reason, but needs to be finished. Currently this is for impl-only
33 // scroll offset animations that need to be completed on the main thread.
31 enum RunState { 34 enum RunState {
32 WAITING_FOR_TARGET_AVAILABILITY = 0, 35 WAITING_FOR_TARGET_AVAILABILITY = 0,
33 WAITING_FOR_DELETION, 36 WAITING_FOR_DELETION,
34 STARTING, 37 STARTING,
35 RUNNING, 38 RUNNING,
36 PAUSED, 39 PAUSED,
37 FINISHED, 40 FINISHED,
38 ABORTED, 41 ABORTED,
42 ABORTED_BUT_NEEDS_COMPLETION,
39 // This sentinel must be last. 43 // This sentinel must be last.
40 LAST_RUN_STATE = ABORTED 44 LAST_RUN_STATE = ABORTED
41 }; 45 };
42 46
43 enum Direction { 47 enum Direction {
44 DIRECTION_NORMAL, 48 DIRECTION_NORMAL,
45 DIRECTION_REVERSE, 49 DIRECTION_REVERSE,
46 DIRECTION_ALTERNATE, 50 DIRECTION_ALTERNATE,
47 DIRECTION_ALTERNATE_REVERSE 51 DIRECTION_ALTERNATE_REVERSE
48 }; 52 };
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // longer affect any observers, and are deleted. 239 // longer affect any observers, and are deleted.
236 bool affects_active_observers_; 240 bool affects_active_observers_;
237 bool affects_pending_observers_; 241 bool affects_pending_observers_;
238 242
239 DISALLOW_COPY_AND_ASSIGN(Animation); 243 DISALLOW_COPY_AND_ASSIGN(Animation);
240 }; 244 };
241 245
242 } // namespace cc 246 } // namespace cc
243 247
244 #endif // CC_ANIMATION_ANIMATION_H_ 248 #endif // CC_ANIMATION_ANIMATION_H_
OLDNEW
« no previous file with comments | « no previous file | cc/animation/animation_delegate.h » ('j') | cc/animation/animation_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698