Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: ash/rotator/screen_rotation_animation.cc

Issue 1315573003: Snap screen rotation animation layers to final position if the animation is aborted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added // AshTestBase: to override list. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/ash.gyp ('k') | ash/rotator/screen_rotation_animation_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 delegate->SetOpacityFromAnimation(gfx::Tween::FloatValueBetween( 54 delegate->SetOpacityFromAnimation(gfx::Tween::FloatValueBetween(
55 tweened, initial_opacity_, target_opacity_)); 55 tweened, initial_opacity_, target_opacity_));
56 return true; 56 return true;
57 } 57 }
58 58
59 void ScreenRotationAnimation::OnGetTarget(TargetValue* target) const { 59 void ScreenRotationAnimation::OnGetTarget(TargetValue* target) const {
60 target->transform = interpolated_transform_->Interpolate(1.0); 60 target->transform = interpolated_transform_->Interpolate(1.0);
61 } 61 }
62 62
63 void ScreenRotationAnimation::OnAbort(ui::LayerAnimationDelegate* delegate) { 63 void ScreenRotationAnimation::OnAbort(ui::LayerAnimationDelegate* delegate) {
64 TargetValue target_value;
65 OnGetTarget(&target_value);
66 delegate->SetTransformFromAnimation(target_value.transform);
64 } 67 }
65 68
66 } // namespace ash 69 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/rotator/screen_rotation_animation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698