| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef DEVICE_VR_OPENVR_DEVICE_H | 5 #ifndef DEVICE_VR_OPENVR_DEVICE_H |
| 6 #define DEVICE_VR_OPENVR_DEVICE_H | 6 #define DEVICE_VR_OPENVR_DEVICE_H |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/threading/simple_thread.h" | 9 #include "base/threading/simple_thread.h" |
| 10 #include "device/vr/vr_device.h" | 10 #include "device/vr/vr_device.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 void UnregisterPollingEventCallback(); | 53 void UnregisterPollingEventCallback(); |
| 54 | 54 |
| 55 void Bind(mojom::VRVSyncProviderRequest request); | 55 void Bind(mojom::VRVSyncProviderRequest request); |
| 56 | 56 |
| 57 mojom::VRPosePtr getPose(); | 57 mojom::VRPosePtr getPose(); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 void Run() override; | 60 void Run() override; |
| 61 | 61 |
| 62 void GetVSync(const device::mojom::VRVSyncProvider::GetVSyncCallback& | 62 void GetVSync( |
| 63 callback) override; | 63 device::mojom::VRVSyncProvider::GetVSyncCallback callback) override; |
| 64 | 64 |
| 65 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 65 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 66 base::Callback<void()> on_polling_events_; | 66 base::Callback<void()> on_polling_events_; |
| 67 vr::IVRSystem* vr_system_; | 67 vr::IVRSystem* vr_system_; |
| 68 mojo::Binding<device::mojom::VRVSyncProvider> binding_; | 68 mojo::Binding<device::mojom::VRVSyncProvider> binding_; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 std::unique_ptr<OpenVRRenderLoop> | 71 std::unique_ptr<OpenVRRenderLoop> |
| 72 render_loop_; // TODO (BillOrr): This should not be a unique_ptr because | 72 render_loop_; // TODO (BillOrr): This should not be a unique_ptr because |
| 73 // the render_loop_ binds to VRVSyncProvider requests, | 73 // the render_loop_ binds to VRVSyncProvider requests, |
| 74 // so its lifetime should be tied to the lifetime of that | 74 // so its lifetime should be tied to the lifetime of that |
| 75 // binding. | 75 // binding. |
| 76 | 76 |
| 77 mojom::VRSubmitFrameClientPtr submit_client_; | 77 mojom::VRSubmitFrameClientPtr submit_client_; |
| 78 | 78 |
| 79 vr::IVRSystem* vr_system_; | 79 vr::IVRSystem* vr_system_; |
| 80 | 80 |
| 81 bool is_polling_events_; | 81 bool is_polling_events_; |
| 82 | 82 |
| 83 base::WeakPtrFactory<OpenVRDevice> weak_ptr_factory_; | 83 base::WeakPtrFactory<OpenVRDevice> weak_ptr_factory_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(OpenVRDevice); | 85 DISALLOW_COPY_AND_ASSIGN(OpenVRDevice); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace device | 88 } // namespace device |
| 89 | 89 |
| 90 #endif // DEVICE_VR_OPENVR_DEVICE_H | 90 #endif // DEVICE_VR_OPENVR_DEVICE_H |
| OLD | NEW |