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

Unified Diff: chrome/browser/android/vr_shell/easing.cc

Issue 2696293002: Adds in-out easing type. (Closed)
Patch Set: Rebased to ToT Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/easing.h ('k') | chrome/browser/android/vr_shell/ui_scene.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..137bcb5f66a3eff0d7686401af5b9093acf89244 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) {}
+double EaseInOut::CalculateValueImpl(double state) {
+ if (state < 0.5) {
+ return ease_in_.CalculateValueImpl(state * 2) / 2;
+ } else {
+ return 1.0 - ease_in_.CalculateValueImpl((1.0 - state) * 2) / 2;
+ }
+}
+
double Linear::CalculateValueImpl(double state) {
return state;
}
« no previous file with comments | « chrome/browser/android/vr_shell/easing.h ('k') | chrome/browser/android/vr_shell/ui_scene.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698