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 2574313002: Clean up threading around VR Scene updates. (Closed)
Patch Set: rebase 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 16c061416795471028b1da0a8793614b395b9137..9be9b9196ec936b3c76b70231f33f76339c6b242 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(
@@ -630,7 +635,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));
@@ -983,4 +988,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
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_gl.h ('k') | chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698