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

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

Issue 2775283004: Rendering Daydream controller in a fixed position. (Closed)
Patch Set: Moving code to more appropriate locations. Created 3 years, 9 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/vr_shell_gl.h ('k') | chrome/browser/android/vr_shell/vr_shell_renderer.h » ('j') | 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 c3b906768d2fd7e09fea01670323b19e788e14ad..04576097918cdeb873940654a892d8a31229dee4 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -935,6 +935,7 @@ void VrShellGl::DrawUiView(const gvr::Mat4f& head_pose,
DrawElements(render_matrix, elementsInDrawOrder);
if (draw_cursor) {
DrawCursor(render_matrix);
+ DrawController(render_matrix);
}
}
}
@@ -1095,6 +1096,14 @@ void VrShellGl::DrawCursor(const gvr::Mat4f& render_matrix) {
}
}
+void VrShellGl::DrawController(const gvr::Mat4f& view_proj_matrix) {
+ if (!vr_shell_renderer_->GetControllerRenderer()->IsSetUp())
+ return;
+ auto transform = MatrixMul(view_proj_matrix, controller_->GetTransform());
+ auto state = controller_->GetModelState();
+ vr_shell_renderer_->GetControllerRenderer()->Draw(state, transform);
+}
+
bool VrShellGl::ShouldDrawWebVr() {
return web_vr_mode_ && scene_->GetWebVrRenderingEnabled();
}
@@ -1189,6 +1198,10 @@ base::WeakPtr<VrShellGl> VrShellGl::GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
+void VrShellGl::SetControllerModel(std::unique_ptr<VrControllerModel> model) {
+ vr_shell_renderer_->GetControllerRenderer()->SetUp(std::move(model));
+}
+
void VrShellGl::OnVSync() {
while (premature_received_frames_ > 0) {
TRACE_EVENT0("gpu", "VrShellGl::OnWebVRFrameAvailableRetry");
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_gl.h ('k') | chrome/browser/android/vr_shell/vr_shell_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698