| Index: ui/views/animation/square_ink_drop_ripple.cc
|
| diff --git a/ui/views/animation/square_ink_drop_ripple.cc b/ui/views/animation/square_ink_drop_ripple.cc
|
| index 94fa10dbbda3378fd5f0b85222a6d1e32976fdf7..ea1e6a0c420981bf56a280cdf768594dff675a0e 100644
|
| --- a/ui/views/animation/square_ink_drop_ripple.cc
|
| +++ b/ui/views/animation/square_ink_drop_ripple.cc
|
| @@ -170,26 +170,8 @@ SquareInkDropRipple::SquareInkDropRipple(const gfx::Size& large_size,
|
| const gfx::Point& center_point,
|
| SkColor color,
|
| float visible_opacity)
|
| - : SquareInkDropRipple(large_size,
|
| - large_corner_radius,
|
| - small_size,
|
| - small_corner_radius,
|
| - center_point,
|
| - center_point,
|
| - color,
|
| - visible_opacity) {}
|
| -
|
| -SquareInkDropRipple::SquareInkDropRipple(const gfx::Size& large_size,
|
| - int large_corner_radius,
|
| - const gfx::Size& small_size,
|
| - int small_corner_radius,
|
| - const gfx::Point& initial_center_point,
|
| - const gfx::Point& target_center_point,
|
| - SkColor color,
|
| - float visible_opacity)
|
| : activated_shape_(ROUNDED_RECT),
|
| visible_opacity_(visible_opacity),
|
| - target_center_point_(target_center_point),
|
| large_size_(large_size),
|
| large_corner_radius_(large_corner_radius),
|
| small_size_(small_size),
|
| @@ -209,7 +191,7 @@ SquareInkDropRipple::SquareInkDropRipple(const gfx::Size& large_size,
|
| root_layer_.SetBounds(gfx::Rect(large_size_));
|
|
|
| gfx::Transform transform;
|
| - transform.Translate(initial_center_point.x(), initial_center_point.y());
|
| + transform.Translate(center_point.x(), center_point.y());
|
| root_layer_.SetTransform(transform);
|
|
|
| SetStateToHidden();
|
| @@ -297,10 +279,6 @@ void SquareInkDropRipple::AnimateStateChange(
|
| GetAnimationDuration(ACTION_PENDING_TRANSFORM),
|
| ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| gfx::Tween::EASE_IN_OUT, animation_observer);
|
| - AnimateCenterPoint(target_center_point_,
|
| - GetAnimationDuration(ACTION_PENDING_TRANSFORM),
|
| - ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| - gfx::Tween::EASE_IN, animation_observer);
|
| break;
|
| case InkDropState::ACTION_TRIGGERED: {
|
| DCHECK(old_ink_drop_state == InkDropState::HIDDEN ||
|
| @@ -320,10 +298,6 @@ void SquareInkDropRipple::AnimateStateChange(
|
| GetAnimationDuration(ACTION_TRIGGERED_TRANSFORM),
|
| ui::LayerAnimator::ENQUEUE_NEW_ANIMATION,
|
| gfx::Tween::EASE_IN_OUT, animation_observer);
|
| - AnimateCenterPoint(target_center_point_,
|
| - GetAnimationDuration(ACTION_TRIGGERED_TRANSFORM),
|
| - ui::LayerAnimator::ENQUEUE_NEW_ANIMATION,
|
| - gfx::Tween::EASE_IN, animation_observer);
|
| break;
|
| }
|
| case InkDropState::ALTERNATE_ACTION_PENDING:
|
| @@ -338,10 +312,6 @@ void SquareInkDropRipple::AnimateStateChange(
|
| GetAnimationDuration(ALTERNATE_ACTION_PENDING),
|
| ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| gfx::Tween::EASE_IN_OUT, animation_observer);
|
| - AnimateCenterPoint(target_center_point_,
|
| - GetAnimationDuration(ALTERNATE_ACTION_PENDING),
|
| - ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| - gfx::Tween::EASE_IN, animation_observer);
|
| break;
|
| case InkDropState::ALTERNATE_ACTION_TRIGGERED: {
|
| DCHECK_EQ(InkDropState::ALTERNATE_ACTION_PENDING, old_ink_drop_state)
|
| @@ -361,11 +331,6 @@ void SquareInkDropRipple::AnimateStateChange(
|
| ALTERNATE_ACTION_TRIGGERED_TRANSFORM),
|
| ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| gfx::Tween::EASE_IN_OUT, animation_observer);
|
| - AnimateCenterPoint(
|
| - target_center_point_,
|
| - GetAnimationDuration(ALTERNATE_ACTION_TRIGGERED_TRANSFORM),
|
| - ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| - gfx::Tween::EASE_IN, animation_observer);
|
| break;
|
| }
|
| case InkDropState::ACTIVATED: {
|
| @@ -385,10 +350,6 @@ void SquareInkDropRipple::AnimateStateChange(
|
| transforms, GetAnimationDuration(ACTIVATED_CIRCLE_TRANSFORM),
|
| ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| gfx::Tween::EASE_IN_OUT, animation_observer);
|
| - AnimateCenterPoint(target_center_point_,
|
| - GetAnimationDuration(ACTIVATED_CIRCLE_TRANSFORM),
|
| - ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| - gfx::Tween::EASE_IN, animation_observer);
|
| } else if (old_ink_drop_state == InkDropState::ACTION_PENDING) {
|
| rect_transform_preemption_strategy =
|
| ui::LayerAnimator::ENQUEUE_NEW_ANIMATION;
|
| @@ -399,10 +360,6 @@ void SquareInkDropRipple::AnimateStateChange(
|
| GetAnimationDuration(ACTIVATED_RECT_TRANSFORM),
|
| rect_transform_preemption_strategy,
|
| gfx::Tween::EASE_IN_OUT, animation_observer);
|
| - AnimateCenterPoint(target_center_point_,
|
| - GetAnimationDuration(ACTIVATED_RECT_TRANSFORM),
|
| - rect_transform_preemption_strategy,
|
| - gfx::Tween::EASE_IN, animation_observer);
|
| break;
|
| }
|
| case InkDropState::DEACTIVATED: {
|
| @@ -421,10 +378,6 @@ void SquareInkDropRipple::AnimateStateChange(
|
| GetAnimationDuration(DEACTIVATED_TRANSFORM),
|
| ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| gfx::Tween::EASE_IN_OUT, animation_observer);
|
| - AnimateCenterPoint(target_center_point_,
|
| - GetAnimationDuration(DEACTIVATED_TRANSFORM),
|
| - ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
|
| - gfx::Tween::EASE_IN, animation_observer);
|
| break;
|
| }
|
| }
|
| @@ -445,29 +398,6 @@ void SquareInkDropRipple::AbortAllAnimations() {
|
| painted_layers_[i]->GetAnimator()->AbortAllAnimations();
|
| }
|
|
|
| -void SquareInkDropRipple::AnimateCenterPoint(
|
| - const gfx::Point& center_point,
|
| - base::TimeDelta duration,
|
| - ui::LayerAnimator::PreemptionStrategy preemption_strategy,
|
| - gfx::Tween::Type tween,
|
| - ui::LayerAnimationObserver* observer) {
|
| - ui::LayerAnimator* animator = root_layer_.GetAnimator();
|
| - ui::ScopedLayerAnimationSettings animation(animator);
|
| - animation.SetPreemptionStrategy(preemption_strategy);
|
| - animation.SetTweenType(tween);
|
| - gfx::Transform transform;
|
| - transform.Translate(target_center_point_.x(), target_center_point_.y());
|
| - std::unique_ptr<ui::LayerAnimationElement> element =
|
| - ui::LayerAnimationElement::CreateTransformElement(transform, duration);
|
| - ui::LayerAnimationSequence* sequence =
|
| - new ui::LayerAnimationSequence(std::move(element));
|
| -
|
| - if (observer)
|
| - sequence->AddObserver(observer);
|
| -
|
| - animator->StartAnimation(sequence);
|
| -}
|
| -
|
| void SquareInkDropRipple::AnimateToTransforms(
|
| const InkDropTransforms transforms,
|
| base::TimeDelta duration,
|
|
|