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 | 24 |
25 // VRDevice | 25 // VRDevice |
26 void GetVRDevice( | 26 void GetVRDevice( |
27 const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) override; | 27 const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) override; |
28 void ResetPose() override; | 28 void ResetPose() override; |
29 | 29 |
30 void RequestPresent(mojom::VRSubmitFrameClientPtr submit_client, | 30 void RequestPresent(const base::Callback<void(bool)>& callback) override; |
31 const base::Callback<void(bool)>& callback) override; | |
32 void SetSecureOrigin(bool secure_origin) override; | 31 void SetSecureOrigin(bool secure_origin) override; |
33 void ExitPresent() override; | 32 void ExitPresent() override; |
34 void SubmitFrame(int16_t frame_index, | 33 void SubmitFrame(mojom::VRPosePtr pose) override; |
35 const gpu::MailboxHolder& mailbox) override; | |
36 void UpdateLayerBounds(int16_t frame_index, | 34 void UpdateLayerBounds(int16_t frame_index, |
37 mojom::VRLayerBoundsPtr leftBounds, | 35 mojom::VRLayerBoundsPtr leftBounds, |
38 mojom::VRLayerBoundsPtr rightBounds, | 36 mojom::VRLayerBoundsPtr rightBounds) override; |
39 int16_t source_width, | |
40 int16_t source_height) override; | |
41 void GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) override; | 37 void GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) override; |
42 | 38 |
43 private: | 39 private: |
44 mojom::VREyeParametersPtr InitEye(float fov, float offset, uint32_t size); | 40 mojom::VREyeParametersPtr InitEye(float fov, float offset, uint32_t size); |
45 | 41 |
46 mojom::VRDisplayInfoPtr device_; | 42 mojom::VRDisplayInfoPtr device_; |
47 | 43 |
48 DISALLOW_COPY_AND_ASSIGN(FakeVRDevice); | 44 DISALLOW_COPY_AND_ASSIGN(FakeVRDevice); |
49 }; | 45 }; |
50 | 46 |
51 } // namespace device | 47 } // namespace device |
52 | 48 |
53 #endif // DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ | 49 #endif // DEVICE_VR_TEST_FAKE_VR_DEVICE_H_ |
OLD | NEW |