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 #ifndef DEVICE_VR_ANDROID_GVR_DELEGATE_H | 5 #ifndef DEVICE_VR_ANDROID_GVR_DELEGATE_H |
6 #define DEVICE_VR_ANDROID_GVR_DELEGATE_H | 6 #define DEVICE_VR_ANDROID_GVR_DELEGATE_H |
7 | 7 |
8 #include "device/vr/android/gvr/gvr_device_provider.h" | 8 #include "device/vr/android/gvr/gvr_device_provider.h" |
9 #include "device/vr/vr_export.h" | 9 #include "device/vr/vr_export.h" |
10 #include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr_ty
pes.h" | 10 #include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr_ty
pes.h" |
11 | 11 |
12 namespace gvr { | 12 namespace gvr { |
13 class GvrApi; | 13 class GvrApi; |
14 } // namespace gvr | 14 } // namespace gvr |
15 | 15 |
16 namespace device { | 16 namespace device { |
17 | 17 |
18 class DEVICE_VR_EXPORT GvrDelegateProvider { | |
19 public: | |
20 static void SetInstance(GvrDelegateProvider* delegate_provider); | |
21 static GvrDelegateProvider* GetInstance(); | |
22 | |
23 virtual bool RequestWebVRPresent(GvrDeviceProvider* device_provider) = 0; | |
24 virtual void ExitWebVRPresent() = 0; | |
25 | |
26 private: | |
27 static GvrDelegateProvider* delegate_provider_; | |
28 }; | |
29 | |
30 class DEVICE_VR_EXPORT GvrDelegate { | 18 class DEVICE_VR_EXPORT GvrDelegate { |
31 public: | 19 public: |
32 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; | 20 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; |
33 virtual void SubmitWebVRFrame() = 0; | 21 virtual void SubmitWebVRFrame() = 0; |
34 virtual void UpdateWebVRTextureBounds(int eye, | 22 virtual void UpdateWebVRTextureBounds(int eye, |
35 float left, | 23 float left, |
36 float top, | 24 float top, |
37 float width, | 25 float width, |
38 float height) = 0; | 26 float height) = 0; |
39 virtual void SetGvrPoseForWebVr(const gvr::Mat4f& pose, | 27 virtual void SetGvrPoseForWebVr(const gvr::Mat4f& pose, |
40 uint32_t pose_index) = 0; | 28 uint32_t pose_index) = 0; |
41 virtual gvr::GvrApi* gvr_api() = 0; | 29 virtual gvr::GvrApi* gvr_api() = 0; |
42 }; | 30 }; |
43 | 31 |
| 32 class DEVICE_VR_EXPORT GvrDelegateProvider { |
| 33 public: |
| 34 static void SetInstance(GvrDelegateProvider* delegate_provider); |
| 35 static GvrDelegateProvider* GetInstance(); |
| 36 |
| 37 virtual bool RequestWebVRPresent(GvrDeviceProvider* device_provider) = 0; |
| 38 virtual void ExitWebVRPresent() = 0; |
| 39 virtual GvrDelegate* GetNonPresentingDelegate() = 0; |
| 40 virtual void DestroyNonPresentingDelegate() = 0; |
| 41 |
| 42 private: |
| 43 static GvrDelegateProvider* delegate_provider_; |
| 44 }; |
| 45 |
44 } // namespace device | 46 } // namespace device |
45 | 47 |
46 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H | 48 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H |
OLD | NEW |