| Index: Source/core/animation/Animation.cpp
|
| diff --git a/Source/core/animation/Animation.cpp b/Source/core/animation/Animation.cpp
|
| index 1d829a2102657783b14fea11664c07f80e8b1720..872f43b5aeeeecb5effde1ce964c65aac0a2997c 100644
|
| --- a/Source/core/animation/Animation.cpp
|
| +++ b/Source/core/animation/Animation.cpp
|
| @@ -49,26 +49,26 @@
|
|
|
| namespace blink {
|
|
|
| -PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtrWillBeRawPtr<EventDelegate> eventDelegate)
|
| +Animation* Animation::create(Element* target, AnimationEffect* effect, const Timing& timing, Priority priority, EventDelegate* eventDelegate)
|
| {
|
| - return adoptRefWillBeNoop(new Animation(target, effect, timing, priority, eventDelegate));
|
| + return new Animation(target, effect, timing, priority, eventDelegate);
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
|
| +Animation* Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
|
| {
|
| ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
|
| if (element)
|
| UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
|
| return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(duration));
|
| }
|
| -PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, const AnimationTimingProperties& timingInput, ExceptionState& exceptionState)
|
| +Animation* Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, const AnimationTimingProperties& timingInput, ExceptionState& exceptionState)
|
| {
|
| ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
|
| if (element)
|
| UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
|
| return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(timingInput));
|
| }
|
| -PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
|
| +Animation* Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
|
| {
|
| ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
|
| if (element)
|
| @@ -76,25 +76,17 @@ PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
|
| return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), Timing());
|
| }
|
|
|
| -Animation::Animation(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtrWillBeRawPtr<EventDelegate> eventDelegate)
|
| +Animation::Animation(Element* target, AnimationEffect* effect, const Timing& timing, Priority priority, EventDelegate* eventDelegate)
|
| : AnimationNode(timing, eventDelegate)
|
| , m_target(target)
|
| , m_effect(effect)
|
| , m_sampledEffect(nullptr)
|
| , m_priority(priority)
|
| {
|
| -#if !ENABLE(OILPAN)
|
| - if (m_target)
|
| - m_target->ensureElementAnimations().addAnimation(this);
|
| -#endif
|
| }
|
|
|
| Animation::~Animation()
|
| {
|
| -#if !ENABLE(OILPAN)
|
| - if (m_target)
|
| - m_target->elementAnimations()->notifyAnimationDestroyed(this);
|
| -#endif
|
| }
|
|
|
| void Animation::attach(AnimationPlayer* player)
|
| @@ -146,15 +138,15 @@ void Animation::applyEffects()
|
|
|
| double iteration = currentIteration();
|
| ASSERT(iteration >= 0);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> interpolations = m_sampledEffect ? m_sampledEffect->mutableInterpolations() : nullptr;
|
| + HeapVector<Member<Interpolation>>* interpolations = m_sampledEffect ? m_sampledEffect->mutableInterpolations() : nullptr;
|
| // FIXME: Handle iteration values which overflow int.
|
| m_effect->sample(static_cast<int>(iteration), timeFraction(), iterationDuration(), interpolations);
|
| if (m_sampledEffect) {
|
| - m_sampledEffect->setInterpolations(interpolations.release());
|
| + m_sampledEffect->setInterpolations(interpolations);
|
| } else if (interpolations && !interpolations->isEmpty()) {
|
| - OwnPtrWillBeRawPtr<SampledEffect> sampledEffect = SampledEffect::create(this, interpolations.release());
|
| - m_sampledEffect = sampledEffect.get();
|
| - ensureAnimationStack(m_target).add(sampledEffect.release());
|
| + SampledEffect* sampledEffect = SampledEffect::create(this, interpolations);
|
| + m_sampledEffect = sampledEffect;
|
| + ensureAnimationStack(m_target).add(sampledEffect);
|
| } else {
|
| return;
|
| }
|
| @@ -223,21 +215,6 @@ double Animation::calculateTimeToEffectChange(bool forwards, double localTime, d
|
| }
|
| }
|
|
|
| -#if !ENABLE(OILPAN)
|
| -void Animation::notifyElementDestroyed()
|
| -{
|
| - // If our player is kept alive just by the sampledEffect, we might get our
|
| - // destructor called when we call SampledEffect::clear(), so we need to
|
| - // clear m_sampledEffect first.
|
| - m_target = nullptr;
|
| - clearEventDelegate();
|
| - SampledEffect* sampledEffect = m_sampledEffect;
|
| - m_sampledEffect = nullptr;
|
| - if (sampledEffect)
|
| - sampledEffect->clear();
|
| -}
|
| -#endif
|
| -
|
| bool Animation::isCandidateForAnimationOnCompositor(double playerPlaybackRate) const
|
| {
|
| if (!effect()
|
|
|