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

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

Issue 2801073002: [vr] Use base's time classes (Closed)
Patch Set: updated tests Created 3 years, 8 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
Index: chrome/browser/android/vr_shell/ui_elements.cc
diff --git a/chrome/browser/android/vr_shell/ui_elements.cc b/chrome/browser/android/vr_shell/ui_elements.cc
index c779d37ded8248002585e81569dc21c2bb76d446..82d1cdb0c65c6840d26c20a80bce6da67b717a17 100644
--- a/chrome/browser/android/vr_shell/ui_elements.cc
+++ b/chrome/browser/android/vr_shell/ui_elements.cc
@@ -7,6 +7,7 @@
#include <limits>
#include "base/logging.h"
+#include "base/time/time.h"
#include "chrome/browser/android/vr_shell/animation.h"
#include "chrome/browser/android/vr_shell/easing.h"
@@ -100,7 +101,7 @@ ContentRectangle::ContentRectangle() = default;
ContentRectangle::~ContentRectangle() = default;
-void ContentRectangle::Animate(int64_t time) {
+void ContentRectangle::Animate(const base::TimeTicks& time) {
for (auto& it : animations) {
Animation& animation = *it;
if (time < animation.start)
@@ -150,7 +151,8 @@ void ContentRectangle::Animate(int64_t time) {
continue;
}
double value = animation.easing->CalculateValue(
- static_cast<double>(time - animation.start) / animation.duration);
+ (time - animation.start).InMillisecondsF() /
+ animation.duration.InMillisecondsF());
values[i] =
animation.from[i] + (value * (animation.to[i] - animation.from[i]));
}
« no previous file with comments | « chrome/browser/android/vr_shell/ui_elements.h ('k') | chrome/browser/android/vr_shell/ui_elements_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698