Rename KeyframeEffect::isAnimation to KeyframeEffect::isKeyframeEffect

BUG=483272

Review URL: https://codereview.chromium.org/1328723003

git-svn-id: svn://svn.chromium.org/blink/trunk@201687 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2db34f63
...@@ -360,7 +360,7 @@ void Animation::notifyStartTime(double timelineTime) ...@@ -360,7 +360,7 @@ void Animation::notifyStartTime(double timelineTime)
bool Animation::affects(const Element& element, CSSPropertyID property) const bool Animation::affects(const Element& element, CSSPropertyID property) const
{ {
if (!m_content || !m_content->isAnimation()) if (!m_content || !m_content->isKeyframeEffect())
return false; return false;
const KeyframeEffect* effect = toKeyframeEffect(m_content.get()); const KeyframeEffect* effect = toKeyframeEffect(m_content.get());
...@@ -695,7 +695,7 @@ bool Animation::canStartAnimationOnCompositor() const ...@@ -695,7 +695,7 @@ bool Animation::canStartAnimationOnCompositor() const
if (m_playbackRate == 0 || (std::isinf(effectEnd()) && m_playbackRate < 0) || (timeline() && timeline()->playbackRate() != 1)) if (m_playbackRate == 0 || (std::isinf(effectEnd()) && m_playbackRate < 0) || (timeline() && timeline()->playbackRate() != 1))
return false; return false;
return m_timeline && m_content && m_content->isAnimation() && playing(); return m_timeline && m_content && m_content->isKeyframeEffect() && playing();
} }
bool Animation::isCandidateForAnimationOnCompositor() const bool Animation::isCandidateForAnimationOnCompositor() const
...@@ -767,13 +767,13 @@ void Animation::restartAnimationOnCompositor() ...@@ -767,13 +767,13 @@ void Animation::restartAnimationOnCompositor()
void Animation::cancelIncompatibleAnimationsOnCompositor() void Animation::cancelIncompatibleAnimationsOnCompositor()
{ {
if (m_content && m_content->isAnimation()) if (m_content && m_content->isKeyframeEffect())
toKeyframeEffect(m_content.get())->cancelIncompatibleAnimationsOnCompositor(); toKeyframeEffect(m_content.get())->cancelIncompatibleAnimationsOnCompositor();
} }
bool Animation::hasActiveAnimationsOnCompositor() bool Animation::hasActiveAnimationsOnCompositor()
{ {
if (!m_content || !m_content->isAnimation()) if (!m_content || !m_content->isKeyframeEffect())
return false; return false;
return toKeyframeEffect(m_content.get())->hasActiveAnimationsOnCompositor(); return toKeyframeEffect(m_content.get())->hasActiveAnimationsOnCompositor();
...@@ -954,7 +954,7 @@ void Animation::attachCompositedLayers() ...@@ -954,7 +954,7 @@ void Animation::attachCompositedLayers()
return; return;
ASSERT(m_content); ASSERT(m_content);
ASSERT(m_content->isAnimation()); ASSERT(m_content->isKeyframeEffect());
if (toKeyframeEffect(m_content.get())->canAttachCompositedLayers()) if (toKeyframeEffect(m_content.get())->canAttachCompositedLayers())
toKeyframeEffect(m_content.get())->attachCompositedLayers(); toKeyframeEffect(m_content.get())->attachCompositedLayers();
......
...@@ -115,7 +115,7 @@ void AnimationEffect::computedTiming(ComputedTimingProperties& computedTiming) ...@@ -115,7 +115,7 @@ void AnimationEffect::computedTiming(ComputedTimingProperties& computedTiming)
// KeyframeEffectOptions members. // KeyframeEffectOptions members.
computedTiming.setDelay(specifiedTiming().startDelay * 1000); computedTiming.setDelay(specifiedTiming().startDelay * 1000);
computedTiming.setEndDelay(specifiedTiming().endDelay * 1000); computedTiming.setEndDelay(specifiedTiming().endDelay * 1000);
computedTiming.setFill(Timing::fillModeString(resolvedFillMode(specifiedTiming().fillMode, isAnimation()))); computedTiming.setFill(Timing::fillModeString(resolvedFillMode(specifiedTiming().fillMode, isKeyframeEffect())));
computedTiming.setIterationStart(specifiedTiming().iterationStart); computedTiming.setIterationStart(specifiedTiming().iterationStart);
computedTiming.setIterations(specifiedTiming().iterationCount); computedTiming.setIterations(specifiedTiming().iterationCount);
...@@ -150,7 +150,7 @@ void AnimationEffect::updateInheritedTime(double inheritedTime, TimingUpdateReas ...@@ -150,7 +150,7 @@ void AnimationEffect::updateInheritedTime(double inheritedTime, TimingUpdateReas
const Phase currentPhase = calculatePhase(activeDuration, localTime, m_timing); const Phase currentPhase = calculatePhase(activeDuration, localTime, m_timing);
// FIXME: parentPhase depends on groups being implemented. // FIXME: parentPhase depends on groups being implemented.
const AnimationEffect::Phase parentPhase = AnimationEffect::PhaseActive; const AnimationEffect::Phase parentPhase = AnimationEffect::PhaseActive;
const double activeTime = calculateActiveTime(activeDuration, resolvedFillMode(m_timing.fillMode, isAnimation()), localTime, parentPhase, currentPhase, m_timing); const double activeTime = calculateActiveTime(activeDuration, resolvedFillMode(m_timing.fillMode, isKeyframeEffect()), localTime, parentPhase, currentPhase, m_timing);
double currentIteration; double currentIteration;
double timeFraction; double timeFraction;
...@@ -176,7 +176,7 @@ void AnimationEffect::updateInheritedTime(double inheritedTime, TimingUpdateReas ...@@ -176,7 +176,7 @@ void AnimationEffect::updateInheritedTime(double inheritedTime, TimingUpdateReas
ASSERT(localActiveDuration >= 0); ASSERT(localActiveDuration >= 0);
const double localLocalTime = localTime < m_timing.startDelay ? localTime : localActiveDuration + m_timing.startDelay; const double localLocalTime = localTime < m_timing.startDelay ? localTime : localActiveDuration + m_timing.startDelay;
const AnimationEffect::Phase localCurrentPhase = calculatePhase(localActiveDuration, localLocalTime, m_timing); const AnimationEffect::Phase localCurrentPhase = calculatePhase(localActiveDuration, localLocalTime, m_timing);
const double localActiveTime = calculateActiveTime(localActiveDuration, resolvedFillMode(m_timing.fillMode, isAnimation()), localLocalTime, parentPhase, localCurrentPhase, m_timing); const double localActiveTime = calculateActiveTime(localActiveDuration, resolvedFillMode(m_timing.fillMode, isKeyframeEffect()), localLocalTime, parentPhase, localCurrentPhase, m_timing);
const double startOffset = m_timing.iterationStart * localIterationDuration; const double startOffset = m_timing.iterationStart * localIterationDuration;
ASSERT(startOffset >= 0); ASSERT(startOffset >= 0);
const double scaledActiveTime = calculateScaledActiveTime(localActiveDuration, localActiveTime, startOffset, m_timing); const double scaledActiveTime = calculateScaledActiveTime(localActiveDuration, localActiveTime, startOffset, m_timing);
......
...@@ -83,7 +83,7 @@ public: ...@@ -83,7 +83,7 @@ public:
virtual ~AnimationEffect() { } virtual ~AnimationEffect() { }
virtual bool isAnimation() const { return false; } virtual bool isKeyframeEffect() const { return false; }
Phase phase() const { return ensureCalculated().phase; } Phase phase() const { return ensureCalculated().phase; }
bool isCurrent() const { return ensureCalculated().isCurrent; } bool isCurrent() const { return ensureCalculated().isCurrent; }
......
...@@ -50,7 +50,7 @@ void ElementAnimations::updateAnimationFlags(ComputedStyle& style) ...@@ -50,7 +50,7 @@ void ElementAnimations::updateAnimationFlags(ComputedStyle& style)
const Animation& animation = *entry.key; const Animation& animation = *entry.key;
ASSERT(animation.effect()); ASSERT(animation.effect());
// FIXME: Needs to consider AnimationGroup once added. // FIXME: Needs to consider AnimationGroup once added.
ASSERT(animation.effect()->isAnimation()); ASSERT(animation.effect()->isKeyframeEffect());
const KeyframeEffect& effect = *toKeyframeEffect(animation.effect()); const KeyframeEffect& effect = *toKeyframeEffect(animation.effect());
if (effect.isCurrent()) { if (effect.isCurrent()) {
if (effect.affects(PropertyHandle(CSSPropertyOpacity))) if (effect.affects(PropertyHandle(CSSPropertyOpacity)))
......
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
~KeyframeEffect() override; ~KeyframeEffect() override;
bool isAnimation() const override { return true; } bool isKeyframeEffect() const override { return true; }
bool affects(PropertyHandle) const; bool affects(PropertyHandle) const;
const EffectModel* model() const { return m_model.get(); } const EffectModel* model() const { return m_model.get(); }
...@@ -118,7 +118,7 @@ private: ...@@ -118,7 +118,7 @@ private:
friend class AnimationAnimationV8Test; friend class AnimationAnimationV8Test;
}; };
DEFINE_TYPE_CASTS(KeyframeEffect, AnimationEffect, animationNode, animationNode->isAnimation(), animationNode.isAnimation()); DEFINE_TYPE_CASTS(KeyframeEffect, AnimationEffect, animationNode, animationNode->isKeyframeEffect(), animationNode.isKeyframeEffect());
} // namespace blink } // namespace blink
......
...@@ -268,7 +268,7 @@ void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate& update, const E ...@@ -268,7 +268,7 @@ void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate& update, const E
update.updateAnimation(animationName, animation, InertEffect::create( update.updateAnimation(animationName, animation, InertEffect::create(
createKeyframeEffectModel(resolver, animatingElement, element, &style, parentStyle, animationName, keyframeTimingFunction.get(), i), createKeyframeEffectModel(resolver, animatingElement, element, &style, parentStyle, animationName, keyframeTimingFunction.get(), i),
timing, isPaused, animation->unlimitedCurrentTimeInternal()), specifiedTiming, keyframesRule); timing, isPaused, animation->unlimitedCurrentTimeInternal()), specifiedTiming, keyframesRule);
} else if (!isAnimationStyleChange && animation->effect() && animation->effect()->isAnimation()) { } else if (!isAnimationStyleChange && animation->effect() && animation->effect()->isKeyframeEffect()) {
EffectModel* model = toKeyframeEffect(animation->effect())->model(); EffectModel* model = toKeyframeEffect(animation->effect())->model();
if (model && model->isKeyframeEffectModel()) { if (model && model->isKeyframeEffectModel()) {
KeyframeEffectModelBase* keyframeEffect = toKeyframeEffectModelBase(model); KeyframeEffectModelBase* keyframeEffect = toKeyframeEffectModelBase(model);
...@@ -389,7 +389,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) ...@@ -389,7 +389,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
// after cancelation, transitions must be downgraded or they'll fail // after cancelation, transitions must be downgraded or they'll fail
// to be considered when retriggering themselves. This can happen if // to be considered when retriggering themselves. This can happen if
// the transition is captured through getAnimations then played. // the transition is captured through getAnimations then played.
if (animation->effect() && animation->effect()->isAnimation()) if (animation->effect() && animation->effect()->isKeyframeEffect())
toKeyframeEffect(animation->effect())->downgradeToNormal(); toKeyframeEffect(animation->effect())->downgradeToNormal();
animation->update(TimingUpdateOnDemand); animation->update(TimingUpdateOnDemand);
} }
...@@ -399,7 +399,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) ...@@ -399,7 +399,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
if (m_transitions.contains(id)) { if (m_transitions.contains(id)) {
Animation* animation = m_transitions.take(id).animation; Animation* animation = m_transitions.take(id).animation;
// Transition must be downgraded // Transition must be downgraded
if (animation->effect() && animation->effect()->isAnimation()) if (animation->effect() && animation->effect()->isKeyframeEffect())
toKeyframeEffect(animation->effect())->downgradeToNormal(); toKeyframeEffect(animation->effect())->downgradeToNormal();
} }
} }
......
...@@ -742,7 +742,7 @@ PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorAnimationEvent::data(c ...@@ -742,7 +742,7 @@ PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorAnimationEvent::data(c
value->setString("state", player.playState()); value->setString("state", player.playState());
if (const AnimationEffect* effect = player.effect()) { if (const AnimationEffect* effect = player.effect()) {
value->setString("name", effect->name()); value->setString("name", effect->name());
if (effect->isAnimation()) { if (effect->isKeyframeEffect()) {
if (Element* target = toKeyframeEffect(effect)->target()) if (Element* target = toKeyframeEffect(effect)->target())
setNodeInfo(value.get(), target, "nodeId", "nodeName"); setNodeInfo(value.get(), target, "nodeId", "nodeName");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment