| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/rotator/screen_rotation_animation.h" | 5 #include "ash/rotator/screen_rotation_animation.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "ui/compositor/layer.h" | 8 #include "ui/compositor/layer.h" |
| 9 #include "ui/compositor/layer_animation_delegate.h" | 9 #include "ui/compositor/layer_animation_delegate.h" |
| 10 #include "ui/gfx/animation/tween.h" | 10 #include "ui/gfx/animation/tween.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 delegate->SetOpacityFromAnimation(gfx::Tween::FloatValueBetween( | 61 delegate->SetOpacityFromAnimation(gfx::Tween::FloatValueBetween( |
| 62 tweened, initial_opacity_, target_opacity_)); | 62 tweened, initial_opacity_, target_opacity_)); |
| 63 return true; | 63 return true; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void ScreenRotationAnimation::OnGetTarget(TargetValue* target) const { | 66 void ScreenRotationAnimation::OnGetTarget(TargetValue* target) const { |
| 67 target->transform = interpolated_transform_->Interpolate(1.0); | 67 target->transform = interpolated_transform_->Interpolate(1.0); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void ScreenRotationAnimation::OnAbort(ui::LayerAnimationDelegate* delegate) { | 70 void ScreenRotationAnimation::OnAbort(ui::LayerAnimationDelegate* delegate) { |
| 71 TargetValue target_value; |
| 72 OnGetTarget(&target_value); |
| 73 delegate->SetTransformFromAnimation(target_value.transform); |
| 71 } | 74 } |
| 72 | 75 |
| 73 } // namespace ash | 76 } // namespace ash |
| OLD | NEW |