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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 | 167 |
168 if (timeToNextEffect < s_minimumDelay) { | 168 if (timeToNextEffect < s_minimumDelay) { |
169 m_timing->serviceOnNextFrame(); | 169 m_timing->serviceOnNextFrame(); |
170 } else if (timeToNextEffect != std::numeric_limits<double>::infinity()) { | 170 } else if (timeToNextEffect != std::numeric_limits<double>::infinity()) { |
171 m_timing->wakeAfter(timeToNextEffect - s_minimumDelay); | 171 m_timing->wakeAfter(timeToNextEffect - s_minimumDelay); |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 void AnimationTimeline::AnimationTimelineTiming::wakeAfter(double duration) | 175 void AnimationTimeline::AnimationTimelineTiming::wakeAfter(double duration) |
176 { | 176 { |
177 double nextFireTime = m_timeline->currentTime() + duration; | |
alancutter (OOO until 2018)
2015/08/17 07:30:36
currentTime() is affected by m_playbackRate making
dtapuska
2015/08/17 17:50:44
Acknowledged.
| |
178 if (m_timer.isActive() && nextFireTime >= m_currentScheduledTime) | |
dstockwell
2015/08/17 08:05:36
You should be able to retrieve the next fire time
dtapuska
2015/08/17 17:50:44
Done.
| |
179 return; | |
180 m_currentScheduledTime = nextFireTime; | |
177 m_timer.startOneShot(duration, FROM_HERE); | 181 m_timer.startOneShot(duration, FROM_HERE); |
178 } | 182 } |
179 | 183 |
180 void AnimationTimeline::AnimationTimelineTiming::cancelWake() | 184 void AnimationTimeline::AnimationTimelineTiming::cancelWake() |
181 { | 185 { |
186 m_currentScheduledTime = std::numeric_limits<double>::infinity(); | |
182 m_timer.stop(); | 187 m_timer.stop(); |
183 } | 188 } |
184 | 189 |
185 void AnimationTimeline::AnimationTimelineTiming::serviceOnNextFrame() | 190 void AnimationTimeline::AnimationTimelineTiming::serviceOnNextFrame() |
186 { | 191 { |
187 if (m_timeline->m_document && m_timeline->m_document->view()) | 192 if (m_timeline->m_document && m_timeline->m_document->view()) |
188 m_timeline->m_document->view()->scheduleAnimation(); | 193 m_timeline->m_document->view()->scheduleAnimation(); |
189 } | 194 } |
190 | 195 |
191 DEFINE_TRACE(AnimationTimeline::AnimationTimelineTiming) | 196 DEFINE_TRACE(AnimationTimeline::AnimationTimelineTiming) |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 { | 328 { |
324 #if ENABLE(OILPAN) | 329 #if ENABLE(OILPAN) |
325 visitor->trace(m_document); | 330 visitor->trace(m_document); |
326 visitor->trace(m_timing); | 331 visitor->trace(m_timing); |
327 visitor->trace(m_animationsNeedingUpdate); | 332 visitor->trace(m_animationsNeedingUpdate); |
328 visitor->trace(m_animations); | 333 visitor->trace(m_animations); |
329 #endif | 334 #endif |
330 } | 335 } |
331 | 336 |
332 } // namespace | 337 } // namespace |
OLD | NEW |