| Index: cc/animation.cc
|
| diff --git a/cc/active_animation.cc b/cc/animation.cc
|
| similarity index 74%
|
| rename from cc/active_animation.cc
|
| rename to cc/animation.cc
|
| index bdc2c8dd363e3cdb581c0d6afb1edfdfe5d9642d..e5279b043ff332810f8ffef146388ebaacc312c9 100644
|
| --- a/cc/active_animation.cc
|
| +++ b/cc/animation.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "cc/active_animation.h"
|
| +#include "cc/animation.h"
|
|
|
| #include <cmath>
|
|
|
| @@ -24,7 +24,7 @@ static const char* const s_runStateNames[] = {
|
| "Aborted"
|
| };
|
|
|
| -COMPILE_ASSERT(static_cast<int>(cc::ActiveAnimation::RunStateEnumSize) == arraysize(s_runStateNames), RunState_names_match_enum);
|
| +COMPILE_ASSERT(static_cast<int>(cc::Animation::RunStateEnumSize) == arraysize(s_runStateNames), RunState_names_match_enum);
|
|
|
| // This should match the TargetProperty enum.
|
| static const char* const s_targetPropertyNames[] = {
|
| @@ -32,18 +32,18 @@ static const char* const s_targetPropertyNames[] = {
|
| "Opacity"
|
| };
|
|
|
| -COMPILE_ASSERT(static_cast<int>(cc::ActiveAnimation::TargetPropertyEnumSize) == arraysize(s_targetPropertyNames), TargetProperty_names_match_enum);
|
| +COMPILE_ASSERT(static_cast<int>(cc::Animation::TargetPropertyEnumSize) == arraysize(s_targetPropertyNames), TargetProperty_names_match_enum);
|
|
|
| } // namespace
|
|
|
| namespace cc {
|
|
|
| -scoped_ptr<ActiveAnimation> ActiveAnimation::create(scoped_ptr<AnimationCurve> curve, int animationId, int groupId, TargetProperty targetProperty)
|
| +scoped_ptr<Animation> Animation::create(scoped_ptr<AnimationCurve> curve, int animationId, int groupId, TargetProperty targetProperty)
|
| {
|
| - return make_scoped_ptr(new ActiveAnimation(curve.Pass(), animationId, groupId, targetProperty));
|
| + return make_scoped_ptr(new Animation(curve.Pass(), animationId, groupId, targetProperty));
|
| }
|
|
|
| -ActiveAnimation::ActiveAnimation(scoped_ptr<AnimationCurve> curve, int animationId, int groupId, TargetProperty targetProperty)
|
| +Animation::Animation(scoped_ptr<AnimationCurve> curve, int animationId, int groupId, TargetProperty targetProperty)
|
| : m_curve(curve.Pass())
|
| , m_id(animationId)
|
| , m_group(groupId)
|
| @@ -61,13 +61,13 @@ ActiveAnimation::ActiveAnimation(scoped_ptr<AnimationCurve> curve, int animation
|
| {
|
| }
|
|
|
| -ActiveAnimation::~ActiveAnimation()
|
| +Animation::~Animation()
|
| {
|
| if (m_runState == Running || m_runState == Paused)
|
| setRunState(Aborted, 0);
|
| }
|
|
|
| -void ActiveAnimation::setRunState(RunState runState, double monotonicTime)
|
| +void Animation::setRunState(RunState runState, double monotonicTime)
|
| {
|
| if (m_suspended)
|
| return;
|
| @@ -80,7 +80,7 @@ void ActiveAnimation::setRunState(RunState runState, double monotonicTime)
|
| || m_runState == WaitingForStartTime;
|
|
|
| if (isWaitingToStart && runState == Running)
|
| - TRACE_EVENT_ASYNC_BEGIN1("cc", "ActiveAnimation", this, "Name", TRACE_STR_COPY(nameBuffer));
|
| + TRACE_EVENT_ASYNC_BEGIN1("cc", "Animation", this, "Name", TRACE_STR_COPY(nameBuffer));
|
|
|
| bool wasFinished = isFinished();
|
|
|
| @@ -95,7 +95,7 @@ void ActiveAnimation::setRunState(RunState runState, double monotonicTime)
|
| const char* newRunStateName = s_runStateNames[runState];
|
|
|
| if (!wasFinished && isFinished())
|
| - TRACE_EVENT_ASYNC_END0("cc", "ActiveAnimation", this);
|
| + TRACE_EVENT_ASYNC_END0("cc", "Animation", this);
|
|
|
| char stateBuffer[256];
|
| base::snprintf(stateBuffer, sizeof(stateBuffer), "%s->%s", oldRunStateName, newRunStateName);
|
| @@ -103,19 +103,19 @@ void ActiveAnimation::setRunState(RunState runState, double monotonicTime)
|
| TRACE_EVENT_INSTANT2("cc", "LayerAnimationController::setRunState", "Name", TRACE_STR_COPY(nameBuffer), "State", TRACE_STR_COPY(stateBuffer));
|
| }
|
|
|
| -void ActiveAnimation::suspend(double monotonicTime)
|
| +void Animation::suspend(double monotonicTime)
|
| {
|
| setRunState(Paused, monotonicTime);
|
| m_suspended = true;
|
| }
|
|
|
| -void ActiveAnimation::resume(double monotonicTime)
|
| +void Animation::resume(double monotonicTime)
|
| {
|
| m_suspended = false;
|
| setRunState(Running, monotonicTime);
|
| }
|
|
|
| -bool ActiveAnimation::isFinishedAt(double monotonicTime) const
|
| +bool Animation::isFinishedAt(double monotonicTime) const
|
| {
|
| if (isFinished())
|
| return true;
|
| @@ -128,7 +128,7 @@ bool ActiveAnimation::isFinishedAt(double monotonicTime) const
|
| && m_iterations * m_curve->duration() <= monotonicTime - startTime() - m_totalPausedTime;
|
| }
|
|
|
| -double ActiveAnimation::trimTimeToCurrentIteration(double monotonicTime) const
|
| +double Animation::trimTimeToCurrentIteration(double monotonicTime) const
|
| {
|
| double trimmed = monotonicTime + m_timeOffset;
|
|
|
| @@ -176,14 +176,14 @@ double ActiveAnimation::trimTimeToCurrentIteration(double monotonicTime) const
|
| return trimmed;
|
| }
|
|
|
| -scoped_ptr<ActiveAnimation> ActiveAnimation::clone(InstanceType instanceType) const
|
| +scoped_ptr<Animation> Animation::clone(InstanceType instanceType) const
|
| {
|
| return cloneAndInitialize(instanceType, m_runState, m_startTime);
|
| }
|
|
|
| -scoped_ptr<ActiveAnimation> ActiveAnimation::cloneAndInitialize(InstanceType instanceType, RunState initialRunState, double startTime) const
|
| +scoped_ptr<Animation> Animation::cloneAndInitialize(InstanceType instanceType, RunState initialRunState, double startTime) const
|
| {
|
| - scoped_ptr<ActiveAnimation> toReturn(new ActiveAnimation(m_curve->clone(), m_id, m_group, m_targetProperty));
|
| + scoped_ptr<Animation> toReturn(new Animation(m_curve->clone(), m_id, m_group, m_targetProperty));
|
| toReturn->m_runState = initialRunState;
|
| toReturn->m_iterations = m_iterations;
|
| toReturn->m_startTime = startTime;
|
| @@ -195,10 +195,10 @@ scoped_ptr<ActiveAnimation> ActiveAnimation::cloneAndInitialize(InstanceType ins
|
| return toReturn.Pass();
|
| }
|
|
|
| -void ActiveAnimation::pushPropertiesTo(ActiveAnimation* other) const
|
| +void Animation::pushPropertiesTo(Animation* other) const
|
| {
|
| // Currently, we only push changes due to pausing and resuming animations on the main thread.
|
| - if (m_runState == ActiveAnimation::Paused || other->m_runState == ActiveAnimation::Paused) {
|
| + if (m_runState == Animation::Paused || other->m_runState == Animation::Paused) {
|
| other->m_runState = m_runState;
|
| other->m_pauseTime = m_pauseTime;
|
| other->m_totalPausedTime = m_totalPausedTime;
|
|
|