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/animation/tween.h" | 5 #include "ui/gfx/animation/tween.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <float.h> | 10 #include <float.h> |
11 #endif | 11 #endif |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "ui/gfx/geometry/cubic_bezier.h" | 17 #include "ui/gfx/animation/cubic_bezier.h" |
18 #include "ui/gfx/safe_integer_conversions.h" | 18 #include "ui/gfx/safe_integer_conversions.h" |
19 | 19 |
20 namespace gfx { | 20 namespace gfx { |
21 | 21 |
22 // static | 22 // static |
23 double Tween::CalculateValue(Tween::Type type, double state) { | 23 double Tween::CalculateValue(Tween::Type type, double state) { |
24 DCHECK_GE(state, 0); | 24 DCHECK_GE(state, 0); |
25 DCHECK_LE(state, 1); | 25 DCHECK_LE(state, 1); |
26 | 26 |
27 switch (type) { | 27 switch (type) { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 if (value <= 0.0) | 174 if (value <= 0.0) |
175 return start_transform; | 175 return start_transform; |
176 | 176 |
177 gfx::Transform to_return = end_transform; | 177 gfx::Transform to_return = end_transform; |
178 to_return.Blend(start_transform, value); | 178 to_return.Blend(start_transform, value); |
179 | 179 |
180 return to_return; | 180 return to_return; |
181 } | 181 } |
182 | 182 |
183 } // namespace gfx | 183 } // namespace gfx |
OLD | NEW |