| 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" |
| 11 #include "mojo/public/cpp/bindings/binding.h" | 11 #include "mojo/public/cpp/bindings/binding.h" |
| 12 | 12 |
| 13 namespace vr { | 13 namespace vr { |
| 14 class IVRSystem; | 14 class IVRSystem; |
| 15 } // namespace vr | 15 } // namespace vr |
| 16 | 16 |
| 17 namespace device { | 17 namespace device { |
| 18 | 18 |
| 19 class OpenVRDevice : public VRDevice { | 19 class OpenVRDevice : public VRDevice { |
| 20 public: | 20 public: |
| 21 OpenVRDevice(); | 21 OpenVRDevice(vr::IVRSystem* vr); |
| 22 ~OpenVRDevice() override; | 22 ~OpenVRDevice() override; |
| 23 | 23 |
| 24 // VRDevice | 24 // VRDevice |
| 25 void CreateVRDisplayInfo( | 25 void CreateVRDisplayInfo( |
| 26 const base::Callback<void(mojom::VRDisplayInfoPtr)>& on_created) override; | 26 const base::Callback<void(mojom::VRDisplayInfoPtr)>& on_created) override; |
| 27 | 27 |
| 28 void RequestPresent(mojom::VRSubmitFrameClientPtr submit_client, | 28 void RequestPresent(mojom::VRSubmitFrameClientPtr submit_client, |
| 29 const base::Callback<void(bool)>& callback) override; | 29 const base::Callback<void(bool)>& callback) override; |
| 30 void SetSecureOrigin(bool secure_origin) override; | 30 void SetSecureOrigin(bool secure_origin) override; |
| 31 void ExitPresent() override; | 31 void ExitPresent() override; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 std::unique_ptr<OpenVRRenderLoop> | 63 std::unique_ptr<OpenVRRenderLoop> |
| 64 render_loop_; // TODO (BillOrr): This should not be a unique_ptr because | 64 render_loop_; // TODO (BillOrr): This should not be a unique_ptr because |
| 65 // the render_loop_ binds to VRVSyncProvider requests, | 65 // the render_loop_ binds to VRVSyncProvider requests, |
| 66 // so its lifetime should be tied to the lifetime of that | 66 // so its lifetime should be tied to the lifetime of that |
| 67 // binding. | 67 // binding. |
| 68 | 68 |
| 69 mojom::VRSubmitFrameClientPtr submit_client_; | 69 mojom::VRSubmitFrameClientPtr submit_client_; |
| 70 | 70 |
| 71 vr::IVRSystem* vr_system_; |
| 72 |
| 71 DISALLOW_COPY_AND_ASSIGN(OpenVRDevice); | 73 DISALLOW_COPY_AND_ASSIGN(OpenVRDevice); |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 } // namespace device | 76 } // namespace device |
| 75 | 77 |
| 76 #endif // DEVICE_VR_OPENVR_DEVICE_H | 78 #endif // DEVICE_VR_OPENVR_DEVICE_H |
| OLD | NEW |