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

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

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/window_rotation.h" 5 #include "ash/rotator/window_rotation.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/gfx/geometry/rect.h" 9 #include "ui/gfx/geometry/rect.h"
10 #include "ui/gfx/interpolated_transform.h" 10 #include "ui/gfx/interpolated_transform.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 current_transform.TransformPoint(&old_pivot); 76 current_transform.TransformPoint(&old_pivot);
77 current_transform.TransformPoint(&new_pivot); 77 current_transform.TransformPoint(&new_pivot);
78 current_transform.TransformPoint(&new_origin_); 78 current_transform.TransformPoint(&new_origin_);
79 79
80 scoped_ptr<ui::InterpolatedTransform> rotation( 80 scoped_ptr<ui::InterpolatedTransform> rotation(
81 new ui::InterpolatedTransformAboutPivot( 81 new ui::InterpolatedTransformAboutPivot(
82 old_pivot, new ui::InterpolatedRotation(0, degrees_))); 82 old_pivot, new ui::InterpolatedRotation(0, degrees_)));
83 83
84 scoped_ptr<ui::InterpolatedTransform> translation( 84 scoped_ptr<ui::InterpolatedTransform> translation(
85 new ui::InterpolatedTranslation( 85 new ui::InterpolatedTranslation(
86 gfx::Point(0, 0), gfx::Point(new_pivot.x() - old_pivot.x(), 86 gfx::PointF(), gfx::PointF(new_pivot.x() - old_pivot.x(),
87 new_pivot.y() - old_pivot.y()))); 87 new_pivot.y() - old_pivot.y())));
88 88
89 float scale_factor = 0.9f; 89 float scale_factor = 0.9f;
90 scoped_ptr<ui::InterpolatedTransform> scale_down( 90 scoped_ptr<ui::InterpolatedTransform> scale_down(
91 new ui::InterpolatedScale(1.0f, scale_factor, 0.0f, 0.5f)); 91 new ui::InterpolatedScale(1.0f, scale_factor, 0.0f, 0.5f));
92 92
93 scoped_ptr<ui::InterpolatedTransform> scale_up( 93 scoped_ptr<ui::InterpolatedTransform> scale_up(
94 new ui::InterpolatedScale(1.0f, 1.0f / scale_factor, 0.5f, 1.0f)); 94 new ui::InterpolatedScale(1.0f, 1.0f / scale_factor, 0.5f, 1.0f));
95 95
96 interpolated_transform_.reset( 96 interpolated_transform_.reset(
97 new ui::InterpolatedConstantTransform(current_transform)); 97 new ui::InterpolatedConstantTransform(current_transform));
(...skipping 14 matching lines...) Expand all
112 } 112 }
113 113
114 void WindowRotation::OnGetTarget(TargetValue* target) const { 114 void WindowRotation::OnGetTarget(TargetValue* target) const {
115 target->transform = interpolated_transform_->Interpolate(1.0); 115 target->transform = interpolated_transform_->Interpolate(1.0);
116 } 116 }
117 117
118 void WindowRotation::OnAbort(ui::LayerAnimationDelegate* delegate) { 118 void WindowRotation::OnAbort(ui::LayerAnimationDelegate* delegate) {
119 } 119 }
120 120
121 } // namespace ash 121 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698