OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 // Pausing via this method is not reflected in the value returned by | 117 // Pausing via this method is not reflected in the value returned by |
118 // paused() and must never overlap with pausing via pause(). | 118 // paused() and must never overlap with pausing via pause(). |
119 void pauseForTesting(double pauseTime); | 119 void pauseForTesting(double pauseTime); |
120 // This should only be used for CSS | 120 // This should only be used for CSS |
121 void unpause(); | 121 void unpause(); |
122 | 122 |
123 void setOutdated(); | 123 void setOutdated(); |
124 bool outdated() { return m_outdated; } | 124 bool outdated() { return m_outdated; } |
125 | 125 |
126 bool canStartAnimationOnCompositor(); | 126 void setPending(); |
127 bool maybeStartAnimationOnCompositor(); | |
128 void cancelAnimationOnCompositor(); | |
129 bool hasActiveAnimationsOnCompositor(); | |
130 void setCompositorPending(bool sourceChanged = false); | |
131 void notifyCompositorStartTime(double timelineTime); | 127 void notifyCompositorStartTime(double timelineTime); |
132 | 128 |
133 | 129 |
134 void preCommit(bool startOnCompositor); | 130 void preCommit(); |
135 void postCommit(double timelineTime); | 131 void postCommit(double timelineTime); |
136 | 132 |
137 unsigned sequenceNumber() const { return m_sequenceNumber; } | 133 unsigned sequenceNumber() const { return m_sequenceNumber; } |
138 | 134 |
139 static bool hasLowerPriority(AnimationPlayer* player1, AnimationPlayer* play
er2) | 135 static bool hasLowerPriority(AnimationPlayer* player1, AnimationPlayer* play
er2) |
140 { | 136 { |
141 return player1->sequenceNumber() < player2->sequenceNumber(); | 137 return player1->sequenceNumber() < player2->sequenceNumber(); |
142 } | 138 } |
143 | 139 |
144 // Checks if the AnimationStack is the last reference holder to the Player. | 140 // Checks if the AnimationStack is the last reference holder to the Player. |
(...skipping 25 matching lines...) Expand all Loading... |
170 // This indicates timing information relevant to the player's effect | 166 // This indicates timing information relevant to the player's effect |
171 // has changed by means other than the ordinary progression of time | 167 // has changed by means other than the ordinary progression of time |
172 bool m_outdated; | 168 bool m_outdated; |
173 | 169 |
174 bool m_finished; | 170 bool m_finished; |
175 // Holds a 'finished' event queued for asynchronous dispatch via the | 171 // Holds a 'finished' event queued for asynchronous dispatch via the |
176 // ScriptedAnimationController. This object remains active until the | 172 // ScriptedAnimationController. This object remains active until the |
177 // event is actually dispatched. | 173 // event is actually dispatched. |
178 RefPtr<Event> m_pendingFinishedEvent; | 174 RefPtr<Event> m_pendingFinishedEvent; |
179 | 175 |
180 enum CompositorAction { | 176 bool m_pending; |
181 None, | |
182 Pause, | |
183 Start, | |
184 PauseThenStart | |
185 }; | |
186 | |
187 class CompositorState { | |
188 public: | |
189 CompositorState(AnimationPlayer& player) | |
190 : startTime(player.m_startTime) | |
191 , holdTime(player.m_holdTime) | |
192 , playbackRate(player.m_playbackRate) | |
193 , sourceChanged(false) | |
194 , pendingAction(Start) | |
195 { } | |
196 double startTime; | |
197 double holdTime; | |
198 double playbackRate; | |
199 bool sourceChanged; | |
200 CompositorAction pendingAction; | |
201 }; | |
202 | |
203 // This mirrors the known compositor state. It is created when a compositor | |
204 // animation is started. Updated once the start time is known and each time | |
205 // modifications are pushed to the compositor. | |
206 OwnPtr<CompositorState> m_compositorState; | |
207 bool m_compositorPending; | |
208 bool m_currentTimePending; | 177 bool m_currentTimePending; |
209 }; | 178 }; |
210 | 179 |
211 } // namespace blink | 180 } // namespace blink |
212 | 181 |
213 #endif // SKY_ENGINE_CORE_ANIMATION_ANIMATIONPLAYER_H_ | 182 #endif // SKY_ENGINE_CORE_ANIMATION_ANIMATIONPLAYER_H_ |
OLD | NEW |