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_device.h" | |
9 #include "device/vr/vr_export.h" | 10 #include "device/vr/vr_export.h" |
10 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" | 11 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" |
11 | 12 |
12 namespace gvr { | 13 namespace gvr { |
13 class GvrApi; | 14 class GvrApi; |
14 } // namespace gvr | 15 } // namespace gvr |
15 | 16 |
16 namespace device { | 17 namespace device { |
17 | 18 |
18 constexpr gvr::Sizei kInvalidRenderTargetSize = {0, 0}; | 19 constexpr gvr::Sizei kInvalidRenderTargetSize = {1, 1}; |
19 | 20 |
20 class DEVICE_VR_EXPORT GvrDelegate { | 21 class DEVICE_VR_EXPORT GvrDelegate { |
artem.bolgar
2017/02/14 03:34:28
Shouldn't this class have a virtual dtor?
| |
21 public: | 22 public: |
22 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; | 23 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; |
23 virtual void SubmitWebVRFrame() = 0; | 24 virtual void SubmitWebVRFrame(int32_t surface_handle, mojom::VRPosePtr pose) = 0; |
24 virtual void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds, | 25 virtual void UpdateWebVRTextureBounds(uint32_t for_pose_index, |
26 const gvr::Rectf& left_bounds, | |
25 const gvr::Rectf& right_bounds) = 0; | 27 const gvr::Rectf& right_bounds) = 0; |
26 | 28 |
27 virtual void SetGvrPoseForWebVr(const gvr::Mat4f& pose, | 29 virtual void SetWebVRGvrPose(const gvr::Mat4f& pose, |
28 uint32_t pose_index) = 0; | 30 uint32_t pose_index, |
29 virtual gvr::Sizei GetWebVRCompositorSurfaceSize() = 0; | 31 int64_t pose_time_nanos) = 0; |
30 virtual void SetWebVRRenderSurfaceSize(int width, int height) = 0; | 32 virtual void GetWebVRSurfaceHandle(int width, int height, const mojom::VRDispl ay::GetSurfaceHandleCallback& callback) = 0; |
31 virtual gvr::GvrApi* gvr_api() = 0; | 33 virtual gvr::GvrApi* gvr_api() = 0; |
32 }; | 34 }; |
33 | 35 |
34 class DEVICE_VR_EXPORT GvrDelegateProvider { | 36 class DEVICE_VR_EXPORT GvrDelegateProvider { |
artem.bolgar
2017/02/14 03:34:28
Shouldn't this class have a virtual dtor?
| |
35 public: | 37 public: |
36 static void SetInstance(GvrDelegateProvider* delegate_provider); | 38 static void SetInstance(GvrDelegateProvider* delegate_provider); |
37 static GvrDelegateProvider* GetInstance(); | 39 static GvrDelegateProvider* GetInstance(); |
38 | 40 |
39 virtual void SetDeviceProvider(GvrDeviceProvider* device_provider) = 0; | 41 virtual void SetDeviceProvider(GvrDeviceProvider* device_provider) = 0; |
40 virtual void RequestWebVRPresent( | 42 virtual void RequestWebVRPresent( |
41 const base::Callback<void(bool)>& callback) = 0; | 43 const base::Callback<void(bool)>& callback) = 0; |
42 virtual void ExitWebVRPresent() = 0; | 44 virtual void ExitWebVRPresent() = 0; |
43 virtual GvrDelegate* GetNonPresentingDelegate() = 0; | 45 virtual GvrDelegate* GetNonPresentingDelegate() = 0; |
44 virtual void DestroyNonPresentingDelegate() = 0; | 46 virtual void DestroyNonPresentingDelegate() = 0; |
45 virtual void SetListeningForActivate(bool listening) = 0; | 47 virtual void SetListeningForActivate(bool listening) = 0; |
46 | 48 |
47 private: | 49 private: |
48 static GvrDelegateProvider* delegate_provider_; | 50 static GvrDelegateProvider* delegate_provider_; |
49 }; | 51 }; |
50 | 52 |
51 } // namespace device | 53 } // namespace device |
52 | 54 |
53 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H | 55 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H |
OLD | NEW |