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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void setCurrentTimeInternal(double newCurrentTime, TimingUpdateReason = Timi
ngUpdateOnDemand); | 78 void setCurrentTimeInternal(double newCurrentTime, TimingUpdateReason = Timi
ngUpdateOnDemand); |
79 | 79 |
80 bool paused() const { return m_paused && !m_isPausedForTesting; } | 80 bool paused() const { return m_paused && !m_isPausedForTesting; } |
81 String playState(); | 81 String playState(); |
82 AnimationPlayState playStateInternal(); | 82 AnimationPlayState playStateInternal(); |
83 | 83 |
84 void pause(); | 84 void pause(); |
85 void play(); | 85 void play(); |
86 void reverse(); | 86 void reverse(); |
87 void finish(ExceptionState&); | 87 void finish(ExceptionState&); |
88 bool finished() { return limited(currentTimeInternal()); } | 88 bool finished() { return !m_idle && limited(currentTimeInternal()); } |
89 bool playing() { return !(finished() || m_paused || m_isPausedForTesting); } | 89 bool playing() { return !(finished() || m_paused || m_isPausedForTesting ||
m_idle); } |
90 // FIXME: Resolve whether finished() should just return the flag, and | 90 // FIXME: Resolve whether finished() should just return the flag, and |
91 // remove this method. | 91 // remove this method. |
92 bool finishedInternal() const { return m_finished; } | 92 bool finishedInternal() const { return m_finished; } |
93 | 93 |
94 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish); | 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish); |
95 | 95 |
96 virtual const AtomicString& interfaceName() const OVERRIDE; | 96 virtual const AtomicString& interfaceName() const OVERRIDE; |
97 virtual ExecutionContext* executionContext() const OVERRIDE; | 97 virtual ExecutionContext* executionContext() const OVERRIDE; |
98 virtual bool hasPendingActivity() const OVERRIDE; | 98 virtual bool hasPendingActivity() const OVERRIDE; |
99 virtual void stop() OVERRIDE; | 99 virtual void stop() OVERRIDE; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 , sourceChanged(false) | 203 , sourceChanged(false) |
204 , pendingAction(Start) | 204 , pendingAction(Start) |
205 { } | 205 { } |
206 double startTime; | 206 double startTime; |
207 double holdTime; | 207 double holdTime; |
208 double playbackRate; | 208 double playbackRate; |
209 bool sourceChanged; | 209 bool sourceChanged; |
210 CompositorAction pendingAction; | 210 CompositorAction pendingAction; |
211 }; | 211 }; |
212 | 212 |
| 213 void uncancel() |
| 214 { |
| 215 if (m_idle) { |
| 216 m_idle = false; |
| 217 m_finished = false; |
| 218 m_held = true; |
| 219 m_holdTime = 0; |
| 220 } |
| 221 } |
| 222 |
213 // This mirrors the known compositor state. It is created when a compositor | 223 // This mirrors the known compositor state. It is created when a compositor |
214 // animation is started. Updated once the start time is known and each time | 224 // animation is started. Updated once the start time is known and each time |
215 // modifications are pushed to the compositor. | 225 // modifications are pushed to the compositor. |
216 OwnPtr<CompositorState> m_compositorState; | 226 OwnPtr<CompositorState> m_compositorState; |
217 bool m_compositorPending; | 227 bool m_compositorPending; |
218 bool m_currentTimePending; | 228 bool m_currentTimePending; |
| 229 bool m_idle; |
219 }; | 230 }; |
220 | 231 |
221 } // namespace blink | 232 } // namespace blink |
222 | 233 |
223 #endif | 234 #endif |
OLD | NEW |