| 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 | 11 |
| 11 namespace gvr { | 12 namespace gvr { |
| 12 class GvrApi; | 13 class GvrApi; |
| 13 } // namespace gvr | 14 } // namespace gvr |
| 14 | 15 |
| 15 namespace device { | 16 namespace device { |
| 16 | 17 |
| 17 class DEVICE_VR_EXPORT GvrDelegateProvider { | 18 class DEVICE_VR_EXPORT GvrDelegateProvider { |
| 18 public: | 19 public: |
| 19 static void SetInstance(GvrDelegateProvider* delegate_provider); | 20 static void SetInstance(GvrDelegateProvider* delegate_provider); |
| 20 static GvrDelegateProvider* GetInstance(); | 21 static GvrDelegateProvider* GetInstance(); |
| 21 | 22 |
| 22 virtual bool RequestWebVRPresent(GvrDeviceProvider* device_provider) = 0; | 23 virtual bool RequestWebVRPresent(GvrDeviceProvider* device_provider) = 0; |
| 23 virtual void ExitWebVRPresent() = 0; | 24 virtual void ExitWebVRPresent() = 0; |
| 24 | 25 |
| 25 private: | 26 private: |
| 26 static GvrDelegateProvider* delegate_provider_; | 27 static GvrDelegateProvider* delegate_provider_; |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 class DEVICE_VR_EXPORT GvrDelegate { | 30 class DEVICE_VR_EXPORT GvrDelegate { |
| 30 public: | 31 public: |
| 31 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; | 32 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; |
| 32 virtual void SubmitWebVRFrame() = 0; | 33 virtual void SubmitWebVRFrame() = 0; |
| 33 virtual void UpdateWebVRTextureBounds(int eye, | 34 virtual void UpdateWebVRTextureBounds(int eye, |
| 34 float left, | 35 float left, |
| 35 float top, | 36 float top, |
| 36 float width, | 37 float width, |
| 37 float height) = 0; | 38 float height) = 0; |
| 38 | 39 virtual void SetGvrPoseForWebVr(const gvr::Mat4f& pose, |
| 40 uint32_t pose_index) = 0; |
| 39 virtual gvr::GvrApi* gvr_api() = 0; | 41 virtual gvr::GvrApi* gvr_api() = 0; |
| 40 }; | 42 }; |
| 41 | 43 |
| 42 } // namespace device | 44 } // namespace device |
| 43 | 45 |
| 44 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H | 46 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H |
| OLD | NEW |