Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Side by Side Diff: chrome/browser/android/vr_shell/easing.cc

Issue 2335643002: Add VR Shell animation classes and unit test. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/android/vr_shell/easing.h"
6
7 namespace vr_shell {
8 namespace easing {
9
10 CubicBezier::CubicBezier(double p1x, double p1y, double p2x, double p2y)
11 : bezier(p1x, p1y, p2x, p2y) {}
12 double CubicBezier::CalculateValue(double state) {
13 return bezier.Solve(state);
14 }
15
16 EaseIn::EaseIn(double power) : mPower(power) {}
17 double EaseIn::CalculateValue(double state) {
18 return pow(state, mPower);
19 }
20
21 EaseOut::EaseOut(double power) : mPower(power) {}
22 double EaseOut::CalculateValue(double state) {
23 return 1.0 - pow(1.0 - state, mPower);
24 }
25
26 double Linear::CalculateValue(double state) {
27 return state;
28 }
29
30 } // namespace easing
31 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698