| 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 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 glDepthMask(GL_TRUE); | 1168 glDepthMask(GL_TRUE); |
| 1169 | 1169 |
| 1170 const SkColor backgroundColor = scene_->GetWorldBackgroundColor(); | 1170 const SkColor backgroundColor = scene_->GetWorldBackgroundColor(); |
| 1171 glClearColor(SkColorGetR(backgroundColor) / 255.0, | 1171 glClearColor(SkColorGetR(backgroundColor) / 255.0, |
| 1172 SkColorGetG(backgroundColor) / 255.0, | 1172 SkColorGetG(backgroundColor) / 255.0, |
| 1173 SkColorGetB(backgroundColor) / 255.0, | 1173 SkColorGetB(backgroundColor) / 255.0, |
| 1174 SkColorGetA(backgroundColor) / 255.0); | 1174 SkColorGetA(backgroundColor) / 255.0); |
| 1175 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | 1175 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| 1176 } | 1176 } |
| 1177 std::vector<const UiElement*> elements = scene_->GetWorldElements(); | 1177 std::vector<const UiElement*> elements = scene_->GetWorldElements(); |
| 1178 const bool draw_reticle = !(scene_->is_exiting() || ShouldDrawWebVr()); | 1178 const bool draw_reticle = |
| 1179 !(scene_->is_exiting() || scene_->showing_splash_screen() || |
| 1180 ShouldDrawWebVr()); |
| 1179 DrawUiView(head_pose, elements, render_size_primary_, | 1181 DrawUiView(head_pose, elements, render_size_primary_, |
| 1180 kViewportListPrimaryOffset, draw_reticle); | 1182 kViewportListPrimaryOffset, draw_reticle); |
| 1181 } | 1183 } |
| 1182 | 1184 |
| 1183 void VrShellGl::DrawOverlayElements(const gfx::Transform& head_pose) { | 1185 void VrShellGl::DrawOverlayElements(const gfx::Transform& head_pose) { |
| 1184 std::vector<const UiElement*> elements = scene_->GetOverlayElements(); | 1186 std::vector<const UiElement*> elements = scene_->GetOverlayElements(); |
| 1185 if (elements.empty()) | 1187 if (elements.empty()) |
| 1186 return; | 1188 return; |
| 1187 | 1189 |
| 1188 glDisable(GL_CULL_FACE); | 1190 glDisable(GL_CULL_FACE); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 // This assumes that the initial webvr_surface_size_ was set to the | 1619 // This assumes that the initial webvr_surface_size_ was set to the |
| 1618 // appropriate recommended render resolution as the default size during | 1620 // appropriate recommended render resolution as the default size during |
| 1619 // InitializeGl. Revisit if the initialization order changes. | 1621 // InitializeGl. Revisit if the initialization order changes. |
| 1620 device::mojom::VRDisplayInfoPtr info = | 1622 device::mojom::VRDisplayInfoPtr info = |
| 1621 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), | 1623 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), |
| 1622 webvr_surface_size_, device_id); | 1624 webvr_surface_size_, device_id); |
| 1623 browser_->RunVRDisplayInfoCallback(callback, &info); | 1625 browser_->RunVRDisplayInfoCallback(callback, &info); |
| 1624 } | 1626 } |
| 1625 | 1627 |
| 1626 } // namespace vr_shell | 1628 } // namespace vr_shell |
| OLD | NEW |