PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > KeyframeEffectModelBase::sample(int iteration, double fraction, double iterationDuration) const
{
    ASSERT(iteration >= 0);
    ASSERT(!isNull(fraction));
    ensureKeyframeGroups();
    ensureInterpolationEffect();

    return m_interpolationEffect->getActiveInterpolations(fraction, iterationDuration);
}
Beispiel #2
0
bool KeyframeEffectModelBase::isReplaceOnly() {
  ensureKeyframeGroups();
  for (const auto& entry : *m_keyframeGroups) {
    for (const auto& keyframe : entry.value->keyframes()) {
      if (keyframe->composite() != EffectModel::CompositeReplace)
        return false;
    }
  }
  return true;
}
bool KeyframeEffectModelBase::isReplaceOnly()
{
    ensureKeyframeGroups();
    for (KeyframeGroupMap::iterator iter = m_keyframeGroups->begin(); iter != m_keyframeGroups->end(); ++iter) {
        const PropertySpecificKeyframeVector& keyframeVector = iter->value->keyframes();
        for (size_t i = 0; i < keyframeVector.size(); ++i) {
            if (keyframeVector[i]->composite() != AnimationEffect::CompositeReplace)
                return false;
        }
    }
    return true;
}
bool KeyframeEffectModelBase::snapshotAllCompositorKeyframes(Element& element, const ComputedStyle* baseStyle)
{
    bool updated = false;
    ensureKeyframeGroups();
    for (CSSPropertyID property : CompositorAnimations::compositableProperties) {
        PropertySpecificKeyframeGroup* keyframeGroup = m_keyframeGroups->get(PropertyHandle(property));
        if (!keyframeGroup)
            continue;
        for (auto& keyframe : keyframeGroup->m_keyframes)
            updated |= keyframe->populateAnimatableValue(property, element, baseStyle, true);
    }
    return updated;
}
bool KeyframeEffectModelBase::sample(int iteration, double fraction, double iterationDuration, Vector<RefPtr<Interpolation>>& result) const
{
    ASSERT(iteration >= 0);
    ASSERT(!isNull(fraction));
    ensureKeyframeGroups();
    ensureInterpolationEffect();

    bool changed = iteration != m_lastIteration || fraction != m_lastFraction || iterationDuration != m_lastIterationDuration;
    m_lastIteration = iteration;
    m_lastFraction = fraction;
    m_lastIterationDuration = iterationDuration;
    m_interpolationEffect->getActiveInterpolations(fraction, iterationDuration, result);
    return changed;
}
bool KeyframeEffectModelBase::snapshotNeutralCompositorKeyframes(Element& element, const ComputedStyle& oldStyle, const ComputedStyle& newStyle)
{
    bool updated = false;
    ensureKeyframeGroups();
    for (CSSPropertyID property : CompositorAnimations::compositableProperties) {
        if (CSSPropertyEquality::propertiesEqual(property, oldStyle, newStyle))
            continue;
        PropertySpecificKeyframeGroup* keyframeGroup = m_keyframeGroups->get(PropertyHandle(property));
        if (!keyframeGroup)
            continue;
        for (auto& keyframe : keyframeGroup->m_keyframes) {
            if (keyframe->isNeutral())
                updated |= keyframe->populateAnimatableValue(property, element, &newStyle, true);
        }
    }
    return updated;
}
void KeyframeEffectModelBase::forceConversionsToAnimatableValues(Element& element, const ComputedStyle* baseStyle)
{
    ensureKeyframeGroups();
    snapshotAllCompositorKeyframes(element, baseStyle);
    ensureInterpolationEffect(&element, baseStyle);
}