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/base/animation/tween.h" | 5 #include "ui/base/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> |
(...skipping 24 matching lines...) Expand all Loading... |
35 case LINEAR: | 35 case LINEAR: |
36 return state; | 36 return state; |
37 | 37 |
38 case EASE_OUT_SNAP: | 38 case EASE_OUT_SNAP: |
39 state = 0.95 * (1.0 - pow(1.0 - state, 2)); | 39 state = 0.95 * (1.0 - pow(1.0 - state, 2)); |
40 return state; | 40 return state; |
41 | 41 |
42 case EASE_OUT: | 42 case EASE_OUT: |
43 return 1.0 - pow(1.0 - state, 2); | 43 return 1.0 - pow(1.0 - state, 2); |
44 | 44 |
| 45 case SMOOTH_IN_OUT: |
| 46 return sin(state); |
| 47 |
45 case ZERO: | 48 case ZERO: |
46 return 0; | 49 return 0; |
47 } | 50 } |
48 | 51 |
49 NOTREACHED(); | 52 NOTREACHED(); |
50 return state; | 53 return state; |
51 } | 54 } |
52 | 55 |
53 // static | 56 // static |
54 double Tween::ValueBetween(double value, double start, double target) { | 57 double Tween::ValueBetween(double value, double start, double target) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 start_transform.matrix().get(row, col), | 121 start_transform.matrix().get(row, col), |
119 end_transform.matrix().get(row, col))); | 122 end_transform.matrix().get(row, col))); |
120 } | 123 } |
121 } | 124 } |
122 } | 125 } |
123 | 126 |
124 return to_return; | 127 return to_return; |
125 } | 128 } |
126 | 129 |
127 } // namespace ui | 130 } // namespace ui |
OLD | NEW |