diff options
-rw-r--r-- | cc/animation/animation.cc | 10 | ||||
-rw-r--r-- | cc/animation/animation.h | 10 | ||||
-rw-r--r-- | cc/animation/layer_animation_controller.cc | 6 |
3 files changed, 9 insertions, 17 deletions
diff --git a/cc/animation/animation.cc b/cc/animation/animation.cc index d4ad016..6b45917 100644 --- a/cc/animation/animation.cc +++ b/cc/animation/animation.cc @@ -211,12 +211,11 @@ double Animation::TrimTimeToCurrentIteration(double monotonic_time) const { return trimmed; } -scoped_ptr<Animation> Animation::Clone(InstanceType instance_type) const { - return CloneAndInitialize(instance_type, run_state_, start_time_); +scoped_ptr<Animation> Animation::Clone() const { + return CloneAndInitialize(run_state_, start_time_); } -scoped_ptr<Animation> Animation::CloneAndInitialize(InstanceType instance_type, - RunState initial_run_state, +scoped_ptr<Animation> Animation::CloneAndInitialize(RunState initial_run_state, double start_time) const { scoped_ptr<Animation> to_return( new Animation(curve_->Clone(), id_, group_, target_property_)); @@ -227,7 +226,8 @@ scoped_ptr<Animation> Animation::CloneAndInitialize(InstanceType instance_type, to_return->total_paused_time_ = total_paused_time_; to_return->time_offset_ = time_offset_; to_return->alternates_direction_ = alternates_direction_; - to_return->is_controlling_instance_ = instance_type == ControllingInstance; + DCHECK(!to_return->is_controlling_instance_); + to_return->is_controlling_instance_ = true; return to_return.Pass(); } diff --git a/cc/animation/animation.h b/cc/animation/animation.h index 58da1e5..9946298 100644 --- a/cc/animation/animation.h +++ b/cc/animation/animation.h @@ -121,14 +121,8 @@ class CC_EXPORT Animation { // of iterations, returns the relative time in the current iteration. double TrimTimeToCurrentIteration(double monotonic_time) const; - enum InstanceType { - ControllingInstance = 0, - NonControllingInstance - }; - - scoped_ptr<Animation> Clone(InstanceType instance_type) const; - scoped_ptr<Animation> CloneAndInitialize(InstanceType instance_type, - RunState initial_run_state, + scoped_ptr<Animation> Clone() const; + scoped_ptr<Animation> CloneAndInitialize(RunState initial_run_state, double start_time) const; bool is_controlling_instance() const { return is_controlling_instance_; } diff --git a/cc/animation/layer_animation_controller.cc b/cc/animation/layer_animation_controller.cc index 93453d3..995a3931 100644 --- a/cc/animation/layer_animation_controller.cc +++ b/cc/animation/layer_animation_controller.cc @@ -417,7 +417,7 @@ void LayerAnimationController::PushNewAnimationsToImplThread( Animation::WaitingForTargetAvailability; double start_time = 0; scoped_ptr<Animation> to_add(active_animations_[i]->CloneAndInitialize( - Animation::ControllingInstance, initial_run_state, start_time)); + initial_run_state, start_time)); DCHECK(!to_add->needs_synchronized_start_time()); controller_impl->AddAnimation(to_add.Pass()); } @@ -675,11 +675,9 @@ void LayerAnimationController::ReplaceImplThreadAnimations( Animation::WaitingForTargetAvailability; double start_time = 0; to_add = active_animations_[i]->CloneAndInitialize( - Animation::ControllingInstance, initial_run_state, start_time).Pass(); } else { - to_add = active_animations_[i]->Clone( - Animation::ControllingInstance).Pass(); + to_add = active_animations_[i]->Clone().Pass(); } controller_impl->AddAnimation(to_add.Pass()); |