| 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_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_BUT_NEEDS_COMPLETION |
| 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 }; |
| 49 | 53 |
| 50 enum FillMode { | 54 enum FillMode { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ |
| OLD | NEW |