diff options
author | dongseong.hwang@intel.com <dongseong.hwang@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-18 03:02:46 +0000 |
---|---|---|
committer | dongseong.hwang@intel.com <dongseong.hwang@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-18 03:02:46 +0000 |
commit | 47788db62a753d17a594343ddb5ea04ac7edb627 (patch) | |
tree | 16806d722a749a7bc57cc4dc68c0cdf54e6087b1 /cc/animation | |
parent | 1a7227164b0d13ff69f111b63497bea673a92bac (diff) | |
download | chromium_src-47788db62a753d17a594343ddb5ea04ac7edb627.zip chromium_src-47788db62a753d17a594343ddb5ea04ac7edb627.tar.gz chromium_src-47788db62a753d17a594343ddb5ea04ac7edb627.tar.bz2 |
Remove Animation::InstanceType.
A cloned Animation instance is always controlling instance, so
Animation::InstanceType enum is useless.
BUG=290217
Review URL: https://codereview.chromium.org/26205006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229287 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/animation')
-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()); |