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

Side by Side Diff: ash/wm/window_animations.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/wm/window_animations.h" 5 #include "ash/wm/window_animations.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 float scale_x = static_cast<float>(target_bounds.width()) / bounds.width(); 106 float scale_x = static_cast<float>(target_bounds.width()) / bounds.width();
107 float scale_y = static_cast<float>(target_bounds.height()) / bounds.height(); 107 float scale_y = static_cast<float>(target_bounds.height()) / bounds.height();
108 108
109 scoped_ptr<ui::InterpolatedTransform> scale( 109 scoped_ptr<ui::InterpolatedTransform> scale(
110 new ui::InterpolatedScale(gfx::Point3F(1, 1, 1), 110 new ui::InterpolatedScale(gfx::Point3F(1, 1, 1),
111 gfx::Point3F(scale_x, scale_y, 1))); 111 gfx::Point3F(scale_x, scale_y, 1)));
112 112
113 scoped_ptr<ui::InterpolatedTransform> translation( 113 scoped_ptr<ui::InterpolatedTransform> translation(
114 new ui::InterpolatedTranslation( 114 new ui::InterpolatedTranslation(
115 gfx::Point(), 115 gfx::PointF(), gfx::PointF(target_bounds.x() - bounds.x(),
116 gfx::Point(target_bounds.x() - bounds.x(), 116 target_bounds.y() - bounds.y())));
117 target_bounds.y() - bounds.y())));
118 117
119 scale->SetChild(translation.release()); 118 scale->SetChild(translation.release());
120 scale->SetReversed(show); 119 scale->SetReversed(show);
121 120
122 base::TimeDelta duration = window->layer()->GetAnimator()-> 121 base::TimeDelta duration = window->layer()->GetAnimator()->
123 GetTransitionDuration(); 122 GetTransitionDuration();
124 123
125 scoped_ptr<ui::LayerAnimationElement> transition( 124 scoped_ptr<ui::LayerAnimationElement> transition(
126 ui::LayerAnimationElement::CreateInterpolatedTransformElement( 125 ui::LayerAnimationElement::CreateInterpolatedTransformElement(
127 scale.release(), duration)); 126 scale.release(), duration));
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 case SHELF_ALIGNMENT_LEFT: 503 case SHELF_ALIGNMENT_LEFT:
505 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); 504 return gfx::Rect(work_area.x(), work_area.y(), 0, 0);
506 case SHELF_ALIGNMENT_RIGHT: 505 case SHELF_ALIGNMENT_RIGHT:
507 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); 506 return gfx::Rect(work_area.right(), work_area.y(), 0, 0);
508 } 507 }
509 NOTREACHED(); 508 NOTREACHED();
510 return gfx::Rect(); 509 return gfx::Rect();
511 } 510 }
512 511
513 } // namespace ash 512 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698