| 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 |
| 11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
| 12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/task_scheduler/post_task.h" | 15 #include "base/task_scheduler/post_task.h" |
| 16 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
| 17 #include "chrome/browser/android/vr_shell/fps_meter.h" | 17 #include "chrome/browser/android/vr_shell/fps_meter.h" |
| 18 #include "chrome/browser/android/vr_shell/gl_browser_interface.h" |
| 18 #include "chrome/browser/android/vr_shell/mailbox_to_surface_bridge.h" | 19 #include "chrome/browser/android/vr_shell/mailbox_to_surface_bridge.h" |
| 19 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" | 20 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" |
| 20 #include "chrome/browser/android/vr_shell/ui_interface.h" | 21 #include "chrome/browser/android/vr_shell/ui_interface.h" |
| 21 #include "chrome/browser/android/vr_shell/ui_scene.h" | 22 #include "chrome/browser/android/vr_shell/ui_scene.h" |
| 22 #include "chrome/browser/android/vr_shell/vr_browser_interface.h" | |
| 23 #include "chrome/browser/android/vr_shell/vr_controller.h" | 23 #include "chrome/browser/android/vr_shell/vr_controller.h" |
| 24 #include "chrome/browser/android/vr_shell/vr_gl_util.h" | 24 #include "chrome/browser/android/vr_shell/vr_gl_util.h" |
| 25 #include "chrome/browser/android/vr_shell/vr_shell.h" | 25 #include "chrome/browser/android/vr_shell/vr_shell.h" |
| 26 #include "chrome/browser/android/vr_shell/vr_shell_renderer.h" | 26 #include "chrome/browser/android/vr_shell/vr_shell_renderer.h" |
| 27 #include "device/vr/android/gvr/gvr_delegate.h" | 27 #include "device/vr/android/gvr/gvr_delegate.h" |
| 28 #include "device/vr/android/gvr/gvr_device.h" | 28 #include "device/vr/android/gvr/gvr_device.h" |
| 29 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" | 29 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" |
| 30 #include "device/vr/vr_math.h" | 30 #include "device/vr/vr_math.h" |
| 31 #include "third_party/WebKit/public/platform/WebGestureEvent.h" | 31 #include "third_party/WebKit/public/platform/WebGestureEvent.h" |
| 32 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 32 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 auto controller_model = VrControllerModel::LoadFromResources(); | 214 auto controller_model = VrControllerModel::LoadFromResources(); |
| 215 if (controller_model) { | 215 if (controller_model) { |
| 216 task_runner->PostTask( | 216 task_runner->PostTask( |
| 217 FROM_HERE, base::Bind(&VrShellGl::SetControllerModel, weak_vr_shell_gl, | 217 FROM_HERE, base::Bind(&VrShellGl::SetControllerModel, weak_vr_shell_gl, |
| 218 base::Passed(&controller_model))); | 218 base::Passed(&controller_model))); |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 | 221 |
| 222 } // namespace | 222 } // namespace |
| 223 | 223 |
| 224 VrShellGl::VrShellGl(VrBrowserInterface* browser, | 224 VrShellGl::VrShellGl(GlBrowserInterface* browser, |
| 225 gvr_context* gvr_api, | 225 gvr_context* gvr_api, |
| 226 bool initially_web_vr, | 226 bool initially_web_vr, |
| 227 bool reprojected_rendering, | 227 bool reprojected_rendering, |
| 228 bool daydream_support, | 228 bool daydream_support, |
| 229 UiScene* scene) | 229 UiScene* scene) |
| 230 : web_vr_mode_(initially_web_vr), | 230 : web_vr_mode_(initially_web_vr), |
| 231 surfaceless_rendering_(reprojected_rendering), | 231 surfaceless_rendering_(reprojected_rendering), |
| 232 daydream_support_(daydream_support), | 232 daydream_support_(daydream_support), |
| 233 task_runner_(base::ThreadTaskRunnerHandle::Get()), | 233 task_runner_(base::ThreadTaskRunnerHandle::Get()), |
| 234 binding_(this), | 234 binding_(this), |
| (...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 // This assumes that the initial webvr_surface_size_ was set to the | 1599 // This assumes that the initial webvr_surface_size_ was set to the |
| 1600 // appropriate recommended render resolution as the default size during | 1600 // appropriate recommended render resolution as the default size during |
| 1601 // InitializeGl. Revisit if the initialization order changes. | 1601 // InitializeGl. Revisit if the initialization order changes. |
| 1602 device::mojom::VRDisplayInfoPtr info = | 1602 device::mojom::VRDisplayInfoPtr info = |
| 1603 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), | 1603 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), |
| 1604 webvr_surface_size_, device_id); | 1604 webvr_surface_size_, device_id); |
| 1605 browser_->RunVRDisplayInfoCallback(callback, &info); | 1605 browser_->RunVRDisplayInfoCallback(callback, &info); |
| 1606 } | 1606 } |
| 1607 | 1607 |
| 1608 } // namespace vr_shell | 1608 } // namespace vr_shell |
| OLD | NEW |