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

Unified Diff: chrome/browser/android/vr_shell/vr_shell_gl.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
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell_gl.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc
index 363b0108ce5b58e517856080c76fc97d8f85b480..34879157f449a22123520c7578158ce11d765fc5 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -131,12 +131,6 @@ enum class ViewerType {
VIEWER_TYPE_MAX,
};
-int64_t TimeInMicroseconds() {
- return std::chrono::duration_cast<std::chrono::microseconds>(
- std::chrono::steady_clock::now().time_since_epoch())
- .count();
-}
-
void RunVRDisplayInfoCallback(
const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback,
device::mojom::VRDisplayInfoPtr info) {
@@ -722,6 +716,8 @@ void VrShellGl::SendGesture(InputTarget input_target,
void VrShellGl::DrawFrame(int16_t frame_index) {
TRACE_EVENT1("gpu", "VrShellGl::DrawFrame", "frame", frame_index);
+ base::TimeTicks current_time = base::TimeTicks::Now();
+
// Reset the viewport list to just the pair of viewports for the
// primary buffer each frame. Head-locked viewports get added by
// DrawVrShell if needed.
@@ -823,7 +819,7 @@ void VrShellGl::DrawFrame(int16_t frame_index) {
}
// Update the render position of all UI elements (including desktop).
- scene_->UpdateTransforms(TimeInMicroseconds());
+ scene_->UpdateTransforms(current_time);
{
// TODO(crbug.com/704690): Acquire controller state in a way that's timely
@@ -1268,7 +1264,7 @@ void VrShellGl::ForceExitVr() {
}
void VrShellGl::UpdateScene(std::unique_ptr<base::ListValue> commands) {
- scene_->HandleCommands(std::move(commands), TimeInMicroseconds());
+ scene_->HandleCommands(std::move(commands), base::TimeTicks::Now());
}
void VrShellGl::SendVSync(base::TimeDelta time,
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698