本文整理汇总了C++中AnimationPlayer::timeToEffectChange方法的典型用法代码示例。如果您正苦于以下问题:C++ AnimationPlayer::timeToEffectChange方法的具体用法?C++ AnimationPlayer::timeToEffectChange怎么用?C++ AnimationPlayer::timeToEffectChange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnimationPlayer
的用法示例。
在下文中一共展示了AnimationPlayer::timeToEffectChange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serviceAnimations
void AnimationTimeline::serviceAnimations(TimingUpdateReason reason)
{
TRACE_EVENT0("blink", "AnimationTimeline::serviceAnimations");
m_timing->cancelWake();
double timeToNextEffect = std::numeric_limits<double>::infinity();
Vector<RawPtr<AnimationPlayer> > players;
players.reserveInitialCapacity(m_playersNeedingUpdate.size());
for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it)
players.append(it->get());
std::sort(players.begin(), players.end(), AnimationPlayer::hasLowerPriority);
for (size_t i = 0; i < players.size(); ++i) {
AnimationPlayer* player = players[i];
if (player->update(reason))
timeToNextEffect = std::min(timeToNextEffect, player->timeToEffectChange());
else
m_playersNeedingUpdate.remove(player);
}
if (timeToNextEffect < s_minimumDelay)
m_timing->serviceOnNextFrame();
else if (timeToNextEffect != std::numeric_limits<double>::infinity())
m_timing->wakeAfter(timeToNextEffect - s_minimumDelay);
ASSERT(!hasOutdatedAnimationPlayer());
}