Chromium Code Reviews| Index: chrome/browser/android/vr_shell/easing.cc |
| diff --git a/chrome/browser/android/vr_shell/easing.cc b/chrome/browser/android/vr_shell/easing.cc |
| index 8138c6dd1f51f4e53d6cf1bb671ae35aee870411..39188b62906879aac47c9283aceca3d1d1c0ca0e 100644 |
| --- a/chrome/browser/android/vr_shell/easing.cc |
| +++ b/chrome/browser/android/vr_shell/easing.cc |
| @@ -33,6 +33,15 @@ double EaseOut::CalculateValueImpl(double state) { |
| return 1.0 - pow(1.0 - state, power_); |
| } |
| +EaseInOut::EaseInOut(double power) : ease_in_(power), ease_out_(power) {} |
| +double EaseInOut::CalculateValueImpl(double state) { |
| + if (state < 0.5) { |
| + return ease_in_.CalculateValueImpl(state * 2) / 2; |
| + } else { |
| + return ease_out_.CalculateValueImpl((state - 0.5) * 2) / 2 + 0.5; |
|
mthiesse
2017/02/16 15:36:43
Could reuse ease_in_, i.e. return 1.0 - (ease_in_.
tiborg
2017/02/16 18:39:33
Good call. Math works. Should we do the same for E
mthiesse
2017/02/16 19:15:07
I wouldn't bother, I don't think that would simpli
|
| + } |
| +} |
| + |
| double Linear::CalculateValueImpl(double state) { |
| return state; |
| } |