本文整理汇总了C++中PendingAnimationTracker::IsWaitingToPlay方法的典型用法代码示例。如果您正苦于以下问题:C++ PendingAnimationTracker::IsWaitingToPlay方法的具体用法?C++ PendingAnimationTracker::IsWaitingToPlay怎么用?C++ PendingAnimationTracker::IsWaitingToPlay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PendingAnimationTracker
的用法示例。
在下文中一共展示了PendingAnimationTracker::IsWaitingToPlay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRenderedDocument
bool
Animation::IsPossiblyOrphanedPendingAnimation() const
{
// Check if we are pending but might never start because we are not being
// tracked.
//
// This covers the following cases:
//
// * We started playing but our effect's target element was orphaned
// or bound to a different document.
// (note that for the case of our effect changing we should handle
// that in SetEffect)
// * We started playing but our timeline became inactive.
// In this case the pending animation tracker will drop us from its hashmap
// when we have been painted.
// * When we started playing we couldn't find a PendingAnimationTracker to
// register with (perhaps the effect had no document) so we simply
// set mPendingState in DoPlay and relied on this method to catch us on the
// next tick.
// If we're not pending we're ok.
if (mPendingState == PendingState::NotPending) {
return false;
}
// If we have a pending ready time then we will be started on the next
// tick.
if (!mPendingReadyTime.IsNull()) {
return false;
}
// If we don't have an active timeline then we shouldn't start until
// we do.
if (!mTimeline || mTimeline->GetCurrentTime().IsNull()) {
return false;
}
// If we have no rendered document, or we're not in our rendered document's
// PendingAnimationTracker then there's a good chance no one is tracking us.
//
// If we're wrong and another document is tracking us then, at worst, we'll
// simply start/pause the animation one tick too soon. That's better than
// never starting/pausing the animation and is unlikely.
nsIDocument* doc = GetRenderedDocument();
if (!doc) {
return false;
}
PendingAnimationTracker* tracker = doc->GetPendingAnimationTracker();
return !tracker ||
(!tracker->IsWaitingToPlay(*this) &&
!tracker->IsWaitingToPause(*this));
}