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

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

Issue 2574313002: Clean up threading around VR Scene updates. (Closed)
Patch Set: Created 4 years 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/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 a2ac61588d22344527cf9a215cd35587f0e756c6..6799881daeeb32801cd582500274040985be0b59 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -169,6 +169,11 @@ int GetPixelEncodedPoseIndexByte() {
return -1;
}
+int64_t TimeInMicroseconds() {
+ return std::chrono::duration_cast<std::chrono::microseconds>(
+ std::chrono::steady_clock::now().time_since_epoch()).count();
+}
+
} // namespace
VrShellGl::VrShellGl(
@@ -650,7 +655,7 @@ void VrShellGl::DrawFrame() {
// Update the render position of all UI elements (including desktop).
const float screen_tilt = kDesktopScreenTiltDefault * M_PI / 180.0f;
- scene_->UpdateTransforms(screen_tilt, UiScene::TimeInMicroseconds());
+ scene_->UpdateTransforms(screen_tilt, TimeInMicroseconds());
UpdateController(GetForwardVector(head_pose));
@@ -1010,4 +1015,8 @@ void VrShellGl::ForceExitVR() {
FROM_HERE, base::Bind(&VrShell::ForceExitVR, weak_vr_shell_));
}
+void VrShellGl::UpdateScene(std::unique_ptr<base::ListValue> commands) {
+ scene_->HandleCommands(std::move(commands), TimeInMicroseconds());
+}
+
} // namespace vr_shell

Powered by Google App Engine
This is Rietveld 408576698