void AnimationPlayer::notifyCompositorStartTime(double timelineTime) { if (m_compositorState) { ASSERT(m_compositorState->pendingAction == Start); ASSERT(std::isnan(m_compositorState->startTime)); double initialCompositorHoldTime = m_compositorState->holdTime; m_compositorState->pendingAction = None; m_compositorState->startTime = timelineTime; if (paused() || m_compositorState->playbackRate != m_playbackRate || m_compositorState->sourceChanged) { // Paused state, playback rate, or source changed while starting. setCompositorPending(); } if (m_startTime == timelineTime) { // The start time was set to the incoming compositor start time. // Unlikely, but possible. // FIXME: Depending on what changed above this might still be pending. // Maybe... m_currentTimePending = false; return; } if (!std::isnan(m_startTime) || currentTimeInternal() != initialCompositorHoldTime) { // A new start time or current time was set while starting. setCompositorPending(); return; } } if (playing()) { ASSERT(std::isnan(m_startTime)); ASSERT(m_held); if (m_playbackRate == 0) { setStartTimeInternal(timelineTime); } else { setStartTimeInternal(timelineTime + currentTimeInternal() / -m_playbackRate); } // FIXME: This avoids marking this player as outdated needlessly when a start time // is notified, but we should refactor how outdating works to avoid this. m_outdated = false; m_currentTimePending = false; } }
void Animation::notifyStartTime(double timelineTime) { if (playing()) { ASSERT(std::isnan(m_startTime)); ASSERT(m_held); if (m_playbackRate == 0) { setStartTimeInternal(timelineTime); } else { setStartTimeInternal(timelineTime + currentTimeInternal() / -m_playbackRate); } // FIXME: This avoids marking this animation as outdated needlessly when a start time // is notified, but we should refactor how outdating works to avoid this. clearOutdated(); m_currentTimePending = false; } }
void Animation::setStartTime(double startTime) { PlayStateUpdateScope updateScope(*this, TimingUpdateOnDemand); if (m_paused || playStateInternal() == Idle) return; if (startTime == m_startTime) return; m_currentTimePending = false; setStartTimeInternal(startTime / 1000); }
void AnimationPlayer::setStartTime(double startTime) { if (m_paused) // FIXME: Should this throw an exception? return; if (!std::isfinite(startTime)) return; if (startTime == m_startTime) return; setCompositorPending(); m_currentTimePending = false; setStartTimeInternal(startTime / 1000); }
void AnimationPlayer::setStartTime(double startTime) { PlayStateUpdateScope updateScope(*this, TimingUpdateOnDemand); UseCounter::count(executionContext(), UseCounter::AnimationPlayerSetStartTime); if (m_paused || playStateInternal() == Idle) return; if (!std::isfinite(startTime)) return; if (startTime == m_startTime) return; m_currentTimePending = false; setStartTimeInternal(startTime / 1000); }