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)
bool Animation::affects(const Element& element, CSSPropertyID property) const
{
if (!m_content || !m_content->isAnimation())
if (!m_content || !m_content->isKeyframeEffect())
return false;
const KeyframeEffect* effect = toKeyframeEffect(m_content.get());
......@@ -695,7 +695,7 @@ bool Animation::canStartAnimationOnCompositor() const
if (m_playbackRate == 0 || (std::isinf(effectEnd()) && m_playbackRate < 0) || (timeline() && timeline()->playbackRate() != 1))
return false;
return m_timeline && m_content && m_content->isAnimation() && playing();
return m_timeline && m_content && m_content->isKeyframeEffect() && playing();
}
bool Animation::isCandidateForAnimationOnCompositor() const
......@@ -767,13 +767,13 @@ void Animation::restartAnimationOnCompositor()
void Animation::cancelIncompatibleAnimationsOnCompositor()
{
if (m_content && m_content->isAnimation())
if (m_content && m_content->isKeyframeEffect())
toKeyframeEffect(m_content.get())->cancelIncompatibleAnimationsOnCompositor();
}
bool Animation::hasActiveAnimationsOnCompositor()
{
if (!m_content || !m_content->isAnimation())
if (!m_content || !m_content->isKeyframeEffect())
return false;
return toKeyframeEffect(m_content.get())->hasActiveAnimationsOnCompositor();
......@@ -954,7 +954,7 @@ void Animation::attachCompositedLayers()
return;
ASSERT(m_content);
ASSERT(m_content->isAnimation());
ASSERT(m_content->isKeyframeEffect());
if (toKeyframeEffect(m_content.get())->canAttachCompositedLayers())
toKeyframeEffect(m_content.get())->attachCompositedLayers();
......
......@@ -115,7 +115,7 @@ void AnimationEffect::computedTiming(ComputedTimingProperties& computedTiming)
// KeyframeEffectOptions members.
computedTiming.setDelay(specifiedTiming().startDelay * 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.setIterations(specifiedTiming().iterationCount);
......@@ -150,7 +150,7 @@ void AnimationEffect::updateInheritedTime(double inheritedTime, TimingUpdateReas
const Phase currentPhase = calculatePhase(activeDuration, localTime, m_timing);
// FIXME: parentPhase depends on groups being implemented.
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 timeFraction;
......@@ -176,7 +176,7 @@ void AnimationEffect::updateInheritedTime(double inheritedTime, TimingUpdateReas
ASSERT(localActiveDuration >= 0);
const double localLocalTime = localTime < m_timing.startDelay ? localTime : localActiveDuration + m_timing.startDelay;
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;
ASSERT(startOffset >= 0);
const double scaledActiveTime = calculateScaledActiveTime(localActiveDuration, localActiveTime, startOffset, m_timing);
......
......@@ -83,7 +83,7 @@ public:
virtual ~AnimationEffect() { }
virtual bool isAnimation() const { return false; }
virtual bool isKeyframeEffect() const { return false; }
Phase phase() const { return ensureCalculated().phase; }
bool isCurrent() const { return ensureCalculated().isCurrent; }
......
......@@ -50,7 +50,7 @@ void ElementAnimations::updateAnimationFlags(ComputedStyle& style)
const Animation& animation = *entry.key;
ASSERT(animation.effect());
// FIXME: Needs to consider AnimationGroup once added.
ASSERT(animation.effect()->isAnimation());
ASSERT(animation.effect()->isKeyframeEffect());
const KeyframeEffect& effect = *toKeyframeEffect(animation.effect());
if (effect.isCurrent()) {
if (effect.affects(PropertyHandle(CSSPropertyOpacity)))
......
......@@ -61,7 +61,7 @@ public:
~KeyframeEffect() override;
bool isAnimation() const override { return true; }
bool isKeyframeEffect() const override { return true; }
bool affects(PropertyHandle) const;
const EffectModel* model() const { return m_model.get(); }
......@@ -118,7 +118,7 @@ private:
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
......
......@@ -268,7 +268,7 @@ void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate& update, const E
update.updateAnimation(animationName, animation, InertEffect::create(
createKeyframeEffectModel(resolver, animatingElement, element, &style, parentStyle, animationName, keyframeTimingFunction.get(), i),
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();
if (model && model->isKeyframeEffectModel()) {
KeyframeEffectModelBase* keyframeEffect = toKeyframeEffectModelBase(model);
......@@ -389,7 +389,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
// after cancelation, transitions must be downgraded or they'll fail
// to be considered when retriggering themselves. This can happen if
// the transition is captured through getAnimations then played.
if (animation->effect() && animation->effect()->isAnimation())
if (animation->effect() && animation->effect()->isKeyframeEffect())
toKeyframeEffect(animation->effect())->downgradeToNormal();
animation->update(TimingUpdateOnDemand);
}
......@@ -399,7 +399,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
if (m_transitions.contains(id)) {
Animation* animation = m_transitions.take(id).animation;
// Transition must be downgraded
if (animation->effect() && animation->effect()->isAnimation())
if (animation->effect() && animation->effect()->isKeyframeEffect())
toKeyframeEffect(animation->effect())->downgradeToNormal();
}
}
......
......@@ -742,7 +742,7 @@ PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorAnimationEvent::data(c
value->setString("state", player.playState());
if (const AnimationEffect* effect = player.effect()) {
value->setString("name", effect->name());
if (effect->isAnimation()) {
if (effect->isKeyframeEffect()) {
if (Element* target = toKeyframeEffect(effect)->target())
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