diff options
author | danakj <danakj@chromium.org> | 2015-10-21 11:14:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-21 18:15:11 +0000 |
commit | 8864f4c7beb7f0e341bc622d917ed6af3b332584 (patch) | |
tree | 6c0167a6ee004fbed198c87cdb253c9933be5115 | |
parent | 2d758574a12f5f5c18218687f32bc6a9e218fca9 (diff) | |
download | chromium_src-8864f4c7beb7f0e341bc622d917ed6af3b332584.zip chromium_src-8864f4c7beb7f0e341bc622d917ed6af3b332584.tar.gz chromium_src-8864f4c7beb7f0e341bc622d917ed6af3b332584.tar.bz2 |
Remove implicit Point to PointF conversion in InterpolatedTransform.
The InterpolatedTransform stores a PointF, so take a PointF in its
constructor, and fix callsites to pass a PointF.
R=sky
BUG=342848
Review URL: https://codereview.chromium.org/1410593008
Cr-Commit-Position: refs/heads/master@{#355341}
-rw-r--r-- | ash/rotator/window_rotation.cc | 4 | ||||
-rw-r--r-- | ash/wm/window_animations.cc | 5 | ||||
-rw-r--r-- | ui/gfx/interpolated_transform.cc | 16 | ||||
-rw-r--r-- | ui/gfx/interpolated_transform.h | 8 | ||||
-rw-r--r-- | ui/gfx/interpolated_transform_unittest.cc | 16 | ||||
-rw-r--r-- | ui/wm/core/window_animations.cc | 4 |
6 files changed, 23 insertions, 30 deletions
diff --git a/ash/rotator/window_rotation.cc b/ash/rotator/window_rotation.cc index a82d4ac..b64477d 100644 --- a/ash/rotator/window_rotation.cc +++ b/ash/rotator/window_rotation.cc @@ -83,8 +83,8 @@ void WindowRotation::InitTransform(ui::Layer* layer) { scoped_ptr<ui::InterpolatedTransform> translation( new ui::InterpolatedTranslation( - gfx::Point(0, 0), gfx::Point(new_pivot.x() - old_pivot.x(), - new_pivot.y() - old_pivot.y()))); + gfx::PointF(), gfx::PointF(new_pivot.x() - old_pivot.x(), + new_pivot.y() - old_pivot.y()))); float scale_factor = 0.9f; scoped_ptr<ui::InterpolatedTransform> scale_down( diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc index dbd8bf3..277f537 100644 --- a/ash/wm/window_animations.cc +++ b/ash/wm/window_animations.cc @@ -112,9 +112,8 @@ void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { scoped_ptr<ui::InterpolatedTransform> translation( new ui::InterpolatedTranslation( - gfx::Point(), - gfx::Point(target_bounds.x() - bounds.x(), - target_bounds.y() - bounds.y()))); + gfx::PointF(), gfx::PointF(target_bounds.x() - bounds.x(), + target_bounds.y() - bounds.y()))); scale->SetChild(translation.release()); scale->SetReversed(show); diff --git a/ui/gfx/interpolated_transform.cc b/ui/gfx/interpolated_transform.cc index 6699ec9..d692b10 100644 --- a/ui/gfx/interpolated_transform.cc +++ b/ui/gfx/interpolated_transform.cc @@ -239,21 +239,17 @@ gfx::Transform InterpolatedScale::InterpolateButDoNotCompose(float t) const { // InterpolatedTranslation // -InterpolatedTranslation::InterpolatedTranslation(const gfx::Point& start_pos, - const gfx::Point& end_pos) - : InterpolatedTransform(), - start_pos_(start_pos), - end_pos_(end_pos) { -} +InterpolatedTranslation::InterpolatedTranslation(const gfx::PointF& start_pos, + const gfx::PointF& end_pos) + : InterpolatedTransform(), start_pos_(start_pos), end_pos_(end_pos) {} -InterpolatedTranslation::InterpolatedTranslation(const gfx::Point& start_pos, - const gfx::Point& end_pos, +InterpolatedTranslation::InterpolatedTranslation(const gfx::PointF& start_pos, + const gfx::PointF& end_pos, float start_time, float end_time) : InterpolatedTransform(start_time, end_time), start_pos_(start_pos), - end_pos_(end_pos) { -} + end_pos_(end_pos) {} InterpolatedTranslation::InterpolatedTranslation(const gfx::Point3F& start_pos, const gfx::Point3F& end_pos) diff --git a/ui/gfx/interpolated_transform.h b/ui/gfx/interpolated_transform.h index c7e9032..691ea97 100644 --- a/ui/gfx/interpolated_transform.h +++ b/ui/gfx/interpolated_transform.h @@ -163,10 +163,10 @@ class GFX_EXPORT InterpolatedScale : public InterpolatedTransform { class GFX_EXPORT InterpolatedTranslation : public InterpolatedTransform { public: - InterpolatedTranslation(const gfx::Point& start_pos, - const gfx::Point& end_pos); - InterpolatedTranslation(const gfx::Point& start_pos, - const gfx::Point& end_pos, + InterpolatedTranslation(const gfx::PointF& start_pos, + const gfx::PointF& end_pos); + InterpolatedTranslation(const gfx::PointF& start_pos, + const gfx::PointF& end_pos, float start_time, float end_time); InterpolatedTranslation(const gfx::Point3F& start_pos, diff --git a/ui/gfx/interpolated_transform_unittest.cc b/ui/gfx/interpolated_transform_unittest.cc index be95eace..75b2c73 100644 --- a/ui/gfx/interpolated_transform_unittest.cc +++ b/ui/gfx/interpolated_transform_unittest.cc @@ -53,11 +53,11 @@ TEST(InterpolatedTransformTest, InterpolatedScale) { } TEST(InterpolatedTransformTest, InterpolatedTranslate) { - ui::InterpolatedTranslation interpolated_xform(gfx::Point(0, 0), - gfx::Point(100, 100)); + ui::InterpolatedTranslation interpolated_xform(gfx::PointF(), + gfx::PointF(100.f, 100.f)); ui::InterpolatedTranslation interpolated_xform_diff_start_end( - gfx::Point(0, 0), gfx::Point(100, 100), 100, 200); + gfx::PointF(), gfx::PointF(100.f, 100.f), 100, 200); for (int i = 0; i <= 100; ++i) { gfx::Transform xform; @@ -149,9 +149,8 @@ ui::InterpolatedTransform* GetScreenRotation(int degrees, bool reversed) { scoped_ptr<ui::InterpolatedTransform> translation( new ui::InterpolatedTranslation( - gfx::Point(0, 0), - gfx::Point(new_pivot.x() - old_pivot.x(), - new_pivot.y() - old_pivot.y()))); + gfx::PointF(), gfx::PointF(new_pivot.x() - old_pivot.x(), + new_pivot.y() - old_pivot.y()))); float scale_factor = 0.9f; scoped_ptr<ui::InterpolatedTransform> scale_down( @@ -206,9 +205,8 @@ ui::InterpolatedTransform* GetMaximize() { scoped_ptr<ui::InterpolatedTransform> translation( new ui::InterpolatedTranslation( - gfx::Point(), - gfx::Point(target_bounds.x() - initial_bounds.x(), - target_bounds.y() - initial_bounds.y()))); + gfx::PointF(), gfx::PointF(target_bounds.x() - initial_bounds.x(), + target_bounds.y() - initial_bounds.y()))); scoped_ptr<ui::InterpolatedTransform> rotation( new ui::InterpolatedRotation(0, 4.0f)); diff --git a/ui/wm/core/window_animations.cc b/ui/wm/core/window_animations.cc index 2497ffa..129cfda 100644 --- a/ui/wm/core/window_animations.cc +++ b/ui/wm/core/window_animations.cc @@ -460,8 +460,8 @@ void AddLayerAnimationsForRotate(aura::Window* window, bool show) { scale.release())); scoped_ptr<ui::InterpolatedTransform> translation( - new ui::InterpolatedTranslation(gfx::Point(), gfx::Point( - 0, kWindowAnimation_Rotate_TranslateY))); + new ui::InterpolatedTranslation( + gfx::PointF(), gfx::PointF(0, kWindowAnimation_Rotate_TranslateY))); scoped_ptr<ui::InterpolatedTransform> rotation( new ui::InterpolatedAxisAngleRotation( |