OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 double startTime() const { return m_startTime; } | 83 double startTime() const { return m_startTime; } |
84 void setStartTime(double monotonicTime) { m_startTime = monotonicTime; } | 84 void setStartTime(double monotonicTime) { m_startTime = monotonicTime; } |
85 bool hasSetStartTime() const { return m_startTime; } | 85 bool hasSetStartTime() const { return m_startTime; } |
86 | 86 |
87 double timeOffset() const { return m_timeOffset; } | 87 double timeOffset() const { return m_timeOffset; } |
88 void setTimeOffset(double monotonicTime) { m_timeOffset = monotonicTime; } | 88 void setTimeOffset(double monotonicTime) { m_timeOffset = monotonicTime; } |
89 | 89 |
90 void suspend(double monotonicTime); | 90 void suspend(double monotonicTime); |
91 void resume(double monotonicTime); | 91 void resume(double monotonicTime); |
92 | 92 |
| 93 // If alternatesDirection is true, on odd numbered iterations we reverse the
curve. |
| 94 bool alternatesDirection() const { return m_alternatesDirection; } |
| 95 void setAlternatesDirection(bool alternates) { m_alternatesDirection = alter
nates; } |
| 96 |
93 bool isFinishedAt(double monotonicTime) const; | 97 bool isFinishedAt(double monotonicTime) const; |
94 bool isFinished() const { return m_runState == Finished || m_runState == Abo
rted; } | 98 bool isFinished() const { return m_runState == Finished || m_runState == Abo
rted; } |
95 | 99 |
96 CCAnimationCurve* curve() { return m_curve.get(); } | 100 CCAnimationCurve* curve() { return m_curve.get(); } |
97 const CCAnimationCurve* curve() const { return m_curve.get(); } | 101 const CCAnimationCurve* curve() const { return m_curve.get(); } |
98 | 102 |
99 // If this is true, even if the animation is running, it will not be tickabl
e until | 103 // If this is true, even if the animation is running, it will not be tickabl
e until |
100 // it is given a start time. This is true for animations running on the main
thread. | 104 // it is given a start time. This is true for animations running on the main
thread. |
101 bool needsSynchronizedStartTime() const { return m_needsSynchronizedStartTim
e; } | 105 bool needsSynchronizedStartTime() const { return m_needsSynchronizedStartTim
e; } |
102 void setNeedsSynchronizedStartTime(bool needsSynchronizedStartTime) { m_need
sSynchronizedStartTime = needsSynchronizedStartTime; } | 106 void setNeedsSynchronizedStartTime(bool needsSynchronizedStartTime) { m_need
sSynchronizedStartTime = needsSynchronizedStartTime; } |
(...skipping 18 matching lines...) Expand all Loading... |
121 // Grouped animations are guaranteed to start at the same time and no other
animations | 125 // Grouped animations are guaranteed to start at the same time and no other
animations |
122 // may animate any of the group's target properties until all animations in
the | 126 // may animate any of the group's target properties until all animations in
the |
123 // group have finished animating. Note: an active animation's group id and t
arget | 127 // group have finished animating. Note: an active animation's group id and t
arget |
124 // property uniquely identify that animation. | 128 // property uniquely identify that animation. |
125 int m_group; | 129 int m_group; |
126 | 130 |
127 TargetProperty m_targetProperty; | 131 TargetProperty m_targetProperty; |
128 RunState m_runState; | 132 RunState m_runState; |
129 int m_iterations; | 133 int m_iterations; |
130 double m_startTime; | 134 double m_startTime; |
| 135 bool m_alternatesDirection; |
131 | 136 |
132 // The time offset effectively pushes the start of the animation back in tim
e. This is | 137 // The time offset effectively pushes the start of the animation back in tim
e. This is |
133 // used for resuming paused animations -- an animation is added with a non-z
ero time | 138 // used for resuming paused animations -- an animation is added with a non-z
ero time |
134 // offset, causing the animation to skip ahead to the desired point in time. | 139 // offset, causing the animation to skip ahead to the desired point in time. |
135 double m_timeOffset; | 140 double m_timeOffset; |
136 | 141 |
137 bool m_needsSynchronizedStartTime; | 142 bool m_needsSynchronizedStartTime; |
138 | 143 |
139 // When an animation is suspended, it behaves as if it is paused and it also
ignores | 144 // When an animation is suspended, it behaves as if it is paused and it also
ignores |
140 // all run state changes until it is resumed. This is used for testing purpo
ses. | 145 // all run state changes until it is resumed. This is used for testing purpo
ses. |
141 bool m_suspended; | 146 bool m_suspended; |
142 | 147 |
143 // These are used in trimTimeToCurrentIteration to account for time | 148 // These are used in trimTimeToCurrentIteration to account for time |
144 // spent while paused. This is not included in AnimationState since it | 149 // spent while paused. This is not included in AnimationState since it |
145 // there is absolutely no need for clients of this controller to know | 150 // there is absolutely no need for clients of this controller to know |
146 // about these values. | 151 // about these values. |
147 double m_pauseTime; | 152 double m_pauseTime; |
148 double m_totalPausedTime; | 153 double m_totalPausedTime; |
149 }; | 154 }; |
150 | 155 |
151 } // namespace WebCore | 156 } // namespace WebCore |
152 | 157 |
153 #endif // CCActiveAnimation_h | 158 #endif // CCActiveAnimation_h |
OLD | NEW |