| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" | 5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" |
| 6 | 6 |
| 7 #include <chrono> | 7 #include <chrono> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 vr::Mat4f view_proj_matrix; | 1173 vr::Mat4f view_proj_matrix; |
| 1174 vr::Mat4f perspective_matrix; | 1174 vr::Mat4f perspective_matrix; |
| 1175 GvrMatToMatf(PerspectiveMatrixFromView(buffer_viewport_->GetSourceFov(), | 1175 GvrMatToMatf(PerspectiveMatrixFromView(buffer_viewport_->GetSourceFov(), |
| 1176 kZNear, kZFar), | 1176 kZNear, kZFar), |
| 1177 &perspective_matrix); | 1177 &perspective_matrix); |
| 1178 | 1178 |
| 1179 vr::MatrixMul(perspective_matrix, eye_view_matrix, &view_proj_matrix); | 1179 vr::MatrixMul(perspective_matrix, eye_view_matrix, &view_proj_matrix); |
| 1180 | 1180 |
| 1181 DrawElements(view_proj_matrix, sorted_elements, draw_reticle); | 1181 DrawElements(view_proj_matrix, sorted_elements, draw_reticle); |
| 1182 if (draw_reticle) { | 1182 if (draw_reticle) { |
| 1183 DrawController(view_proj_matrix); |
| 1183 DrawLaser(view_proj_matrix); | 1184 DrawLaser(view_proj_matrix); |
| 1184 DrawController(view_proj_matrix); | |
| 1185 } | 1185 } |
| 1186 } | 1186 } |
| 1187 } | 1187 } |
| 1188 | 1188 |
| 1189 void VrShellGl::DrawElements(const vr::Mat4f& view_proj_matrix, | 1189 void VrShellGl::DrawElements(const vr::Mat4f& view_proj_matrix, |
| 1190 const std::vector<const UiElement*>& elements, | 1190 const std::vector<const UiElement*>& elements, |
| 1191 bool draw_reticle) { | 1191 bool draw_reticle) { |
| 1192 if (elements.empty()) | 1192 if (elements.empty()) |
| 1193 return; | 1193 return; |
| 1194 int initial_draw_phase = elements.front()->draw_phase(); | 1194 int initial_draw_phase = elements.front()->draw_phase(); |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 // This assumes that the initial webvr_surface_size_ was set to the | 1540 // This assumes that the initial webvr_surface_size_ was set to the |
| 1541 // appropriate recommended render resolution as the default size during | 1541 // appropriate recommended render resolution as the default size during |
| 1542 // InitializeGl. Revisit if the initialization order changes. | 1542 // InitializeGl. Revisit if the initialization order changes. |
| 1543 device::mojom::VRDisplayInfoPtr info = | 1543 device::mojom::VRDisplayInfoPtr info = |
| 1544 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), | 1544 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), |
| 1545 webvr_surface_size_, device_id); | 1545 webvr_surface_size_, device_id); |
| 1546 browser_->RunVRDisplayInfoCallback(callback, &info); | 1546 browser_->RunVRDisplayInfoCallback(callback, &info); |
| 1547 } | 1547 } |
| 1548 | 1548 |
| 1549 } // namespace vr_shell | 1549 } // namespace vr_shell |
| OLD | NEW |