| 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
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2c8d1713b3923a3adfc58b0031b995abf3666910
|
| --- /dev/null
|
| +++ b/chrome/browser/android/vr_shell/easing.cc
|
| @@ -0,0 +1,31 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/android/vr_shell/easing.h"
|
| +
|
| +namespace vr_shell {
|
| +namespace easing {
|
| +
|
| +CubicBezier::CubicBezier(double p1x, double p1y, double p2x, double p2y)
|
| + : bezier(p1x, p1y, p2x, p2y) {}
|
| +double CubicBezier::CalculateValue(double state) {
|
| + return bezier.Solve(state);
|
| +}
|
| +
|
| +EaseIn::EaseIn(double power) : mPower(power) {}
|
| +double EaseIn::CalculateValue(double state) {
|
| + return pow(state, mPower);
|
| +}
|
| +
|
| +EaseOut::EaseOut(double power) : mPower(power) {}
|
| +double EaseOut::CalculateValue(double state) {
|
| + return 1.0 - pow(1.0 - state, mPower);
|
| +}
|
| +
|
| +double Linear::CalculateValue(double state) {
|
| + return state;
|
| +}
|
| +
|
| +} // namespace easing
|
| +} // namespace vr_shell
|
|
|