Ejemplo n.º 1
0
ActiveInterpolationsMap AnimationStack::activeInterpolations(
    AnimationStack* animationStack,
    const HeapVector<Member<const InertEffect>>* newAnimations,
    const HeapHashSet<Member<const Animation>>* suppressedAnimations,
    KeyframeEffectReadOnly::Priority priority,
    PropertyHandleFilter propertyHandleFilter) {
  ActiveInterpolationsMap result;

  if (animationStack) {
    HeapVector<Member<SampledEffect>>& sampledEffects =
        animationStack->m_sampledEffects;
    // std::sort doesn't work with OwnPtrs
    nonCopyingSort(sampledEffects.begin(), sampledEffects.end(),
                   compareSampledEffects);
    animationStack->removeRedundantSampledEffects();
    for (const auto& sampledEffect : sampledEffects) {
      if (sampledEffect->priority() != priority ||
          (suppressedAnimations && sampledEffect->effect() &&
           suppressedAnimations->contains(
               sampledEffect->effect()->animation())))
        continue;
      copyToActiveInterpolationsMap(sampledEffect->interpolations(),
                                    propertyHandleFilter, result);
    }
  }

  if (newAnimations)
    copyNewAnimationsToActiveInterpolationsMap(*newAnimations,
                                               propertyHandleFilter, result);

  return result;
}
Ejemplo n.º 2
0
ActiveInterpolationsMap AnimationStack::activeInterpolations(AnimationStack* animationStack, const HeapVector<Member<InertEffect>>* newAnimations, const HeapHashSet<Member<const Animation>>* suppressedAnimations, KeyframeEffect::Priority priority, double timelineCurrentTime)
{
    // We don't exactly know when new animations will start, but timelineCurrentTime is a good estimate.

    ActiveInterpolationsMap result;

    if (animationStack) {
        HeapVector<Member<SampledEffect>>& effects = animationStack->m_effects;
        // std::sort doesn't work with OwnPtrs
        nonCopyingSort(effects.begin(), effects.end(), compareEffects);
        animationStack->removeClearedEffects();
        for (const auto& effect : effects) {
            if (effect->priority() != priority || (suppressedAnimations && effect->effect() && suppressedAnimations->contains(effect->effect()->animation())))
                continue;
            copyToActiveInterpolationsMap(effect->interpolations(), result);
        }
    }

    if (newAnimations)
        copyNewAnimationsToActiveInterpolationsMap(*newAnimations, result);

    return result;
}