| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TEST_FAKE_VR_DEVICE_H_ | 5 #ifndef DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ |
| 6 #define DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ | 6 #define DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "device/vr/vr_device.h" | 10 #include "device/vr/vr_device.h" |
| 11 #include "device/vr/vr_device_provider.h" | 11 #include "device/vr/vr_device_provider.h" |
| 12 #include "device/vr/vr_service_impl.h" | 12 #include "device/vr/vr_service_impl.h" |
| 13 | 13 |
| 14 namespace device { | 14 namespace device { |
| 15 | 15 |
| 16 class FakeVRDevice : public VRDevice { | 16 class FakeVRDevice : public VRDevice { |
| 17 public: | 17 public: |
| 18 explicit FakeVRDevice(); | 18 explicit FakeVRDevice(); |
| 19 ~FakeVRDevice() override; | 19 ~FakeVRDevice() override; |
| 20 | 20 |
| 21 void InitBasicDevice(); | 21 void InitBasicDevice(); |
| 22 | 22 |
| 23 void SetVRDevice(const mojom::VRDisplayInfoPtr& device); | 23 void SetVRDevice(const mojom::VRDisplayInfoPtr& device); |
| 24 void SetPose(const mojom::VRPosePtr& state); | |
| 25 | 24 |
| 26 mojom::VRDisplayInfoPtr GetVRDevice() override; | 25 mojom::VRDisplayInfoPtr GetVRDevice() override; |
| 27 mojom::VRPosePtr GetPose() override; | |
| 28 void ResetPose() override; | 26 void ResetPose() override; |
| 29 | 27 |
| 30 void RequestPresent(const base::Callback<void(bool)>& callback) override; | 28 void RequestPresent(const base::Callback<void(bool)>& callback) override; |
| 31 void SetSecureOrigin(bool secure_origin) override; | 29 void SetSecureOrigin(bool secure_origin) override; |
| 32 void ExitPresent() override; | 30 void ExitPresent() override; |
| 33 void SubmitFrame(mojom::VRPosePtr pose) override; | 31 void SubmitFrame(mojom::VRPosePtr pose) override; |
| 34 void UpdateLayerBounds(mojom::VRLayerBoundsPtr leftBounds, | 32 void UpdateLayerBounds(mojom::VRLayerBoundsPtr leftBounds, |
| 35 mojom::VRLayerBoundsPtr rightBounds) override; | 33 mojom::VRLayerBoundsPtr rightBounds) override; |
| 34 void GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) override; |
| 36 | 35 |
| 37 private: | 36 private: |
| 38 mojom::VREyeParametersPtr InitEye(float fov, float offset, uint32_t size); | 37 mojom::VREyeParametersPtr InitEye(float fov, float offset, uint32_t size); |
| 39 | 38 |
| 40 mojom::VRDisplayInfoPtr device_; | 39 mojom::VRDisplayInfoPtr device_; |
| 41 mojom::VRPosePtr pose_; | |
| 42 | 40 |
| 43 DISALLOW_COPY_AND_ASSIGN(FakeVRDevice); | 41 DISALLOW_COPY_AND_ASSIGN(FakeVRDevice); |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 } // namespace device | 44 } // namespace device |
| 47 | 45 |
| 48 #endif // DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ | 46 #endif // DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ |
| OLD | NEW |