| OLD | NEW |
| 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 "ui/gfx/interpolated_transform.h" | 5 #include "ui/gfx/interpolated_transform.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #ifndef M_PI | 9 #ifndef M_PI |
| 10 #define M_PI 3.14159265358979323846 | 10 #define M_PI 3.14159265358979323846 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 float scale_y = ValueBetween(t, start_scale_.y(), end_scale_.y()); | 232 float scale_y = ValueBetween(t, start_scale_.y(), end_scale_.y()); |
| 233 float scale_z = ValueBetween(t, start_scale_.z(), end_scale_.z()); | 233 float scale_z = ValueBetween(t, start_scale_.z(), end_scale_.z()); |
| 234 result.Scale3d(scale_x, scale_y, scale_z); | 234 result.Scale3d(scale_x, scale_y, scale_z); |
| 235 return result; | 235 return result; |
| 236 } | 236 } |
| 237 | 237 |
| 238 /////////////////////////////////////////////////////////////////////////////// | 238 /////////////////////////////////////////////////////////////////////////////// |
| 239 // InterpolatedTranslation | 239 // InterpolatedTranslation |
| 240 // | 240 // |
| 241 | 241 |
| 242 InterpolatedTranslation::InterpolatedTranslation(const gfx::Point& start_pos, | 242 InterpolatedTranslation::InterpolatedTranslation(const gfx::PointF& start_pos, |
| 243 const gfx::Point& end_pos) | 243 const gfx::PointF& end_pos) |
| 244 : InterpolatedTransform(), | 244 : InterpolatedTransform(), start_pos_(start_pos), end_pos_(end_pos) {} |
| 245 start_pos_(start_pos), | |
| 246 end_pos_(end_pos) { | |
| 247 } | |
| 248 | 245 |
| 249 InterpolatedTranslation::InterpolatedTranslation(const gfx::Point& start_pos, | 246 InterpolatedTranslation::InterpolatedTranslation(const gfx::PointF& start_pos, |
| 250 const gfx::Point& end_pos, | 247 const gfx::PointF& end_pos, |
| 251 float start_time, | 248 float start_time, |
| 252 float end_time) | 249 float end_time) |
| 253 : InterpolatedTransform(start_time, end_time), | 250 : InterpolatedTransform(start_time, end_time), |
| 254 start_pos_(start_pos), | 251 start_pos_(start_pos), |
| 255 end_pos_(end_pos) { | 252 end_pos_(end_pos) {} |
| 256 } | |
| 257 | 253 |
| 258 InterpolatedTranslation::InterpolatedTranslation(const gfx::Point3F& start_pos, | 254 InterpolatedTranslation::InterpolatedTranslation(const gfx::Point3F& start_pos, |
| 259 const gfx::Point3F& end_pos) | 255 const gfx::Point3F& end_pos) |
| 260 : InterpolatedTransform(), start_pos_(start_pos), end_pos_(end_pos) { | 256 : InterpolatedTransform(), start_pos_(start_pos), end_pos_(end_pos) { |
| 261 } | 257 } |
| 262 | 258 |
| 263 InterpolatedTranslation::InterpolatedTranslation(const gfx::Point3F& start_pos, | 259 InterpolatedTranslation::InterpolatedTranslation(const gfx::Point3F& start_pos, |
| 264 const gfx::Point3F& end_pos, | 260 const gfx::Point3F& end_pos, |
| 265 float start_time, | 261 float start_time, |
| 266 float end_time) | 262 float end_time) |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 371 |
| 376 void InterpolatedMatrixTransform::Init(const gfx::Transform& start_transform, | 372 void InterpolatedMatrixTransform::Init(const gfx::Transform& start_transform, |
| 377 const gfx::Transform& end_transform) { | 373 const gfx::Transform& end_transform) { |
| 378 bool success = gfx::DecomposeTransform(&start_decomp_, start_transform); | 374 bool success = gfx::DecomposeTransform(&start_decomp_, start_transform); |
| 379 DCHECK(success); | 375 DCHECK(success); |
| 380 success = gfx::DecomposeTransform(&end_decomp_, end_transform); | 376 success = gfx::DecomposeTransform(&end_decomp_, end_transform); |
| 381 DCHECK(success); | 377 DCHECK(success); |
| 382 } | 378 } |
| 383 | 379 |
| 384 } // namespace ui | 380 } // namespace ui |
| OLD | NEW |