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 "device/vr/vr_service.mojom.h" | 10 #include "device/vr/vr_service.mojom.h" |
11 #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" |
12 | 12 |
13 namespace gvr { | 13 namespace gvr { |
14 class GvrApi; | 14 class GvrApi; |
15 } // namespace gvr | 15 } // namespace gvr |
16 | 16 |
17 namespace device { | 17 namespace device { |
18 | 18 |
19 constexpr gvr::Sizei kInvalidRenderTargetSize = {0, 0}; | 19 constexpr gvr::Sizei kInvalidRenderTargetSize = {0, 0}; |
20 | 20 |
21 class DEVICE_VR_EXPORT GvrDelegate { | 21 class DEVICE_VR_EXPORT GvrDelegate { |
22 public: | 22 public: |
23 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; | 23 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; |
24 virtual void SubmitWebVRFrame() = 0; | 24 virtual void SubmitWebVRFrame() = 0; |
25 virtual void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds, | 25 virtual void UpdateWebVRTextureBounds(int16_t frame_index, |
| 26 const gvr::Rectf& left_bounds, |
26 const gvr::Rectf& right_bounds) = 0; | 27 const gvr::Rectf& right_bounds) = 0; |
27 virtual gvr::Sizei GetWebVRCompositorSurfaceSize() = 0; | 28 virtual gvr::Sizei GetWebVRCompositorSurfaceSize() = 0; |
28 virtual void SetWebVRRenderSurfaceSize(int width, int height) = 0; | 29 virtual void SetWebVRRenderSurfaceSize(int width, int height) = 0; |
29 // TODO(mthiesse): This function is not threadsafe. crbug.com/674594 | 30 // TODO(mthiesse): This function is not threadsafe. crbug.com/674594 |
30 virtual gvr::GvrApi* gvr_api() = 0; | 31 virtual gvr::GvrApi* gvr_api() = 0; |
31 virtual void OnVRVsyncProviderRequest( | 32 virtual void OnVRVsyncProviderRequest( |
32 mojom::VRVSyncProviderRequest request) = 0; | 33 mojom::VRVSyncProviderRequest request) = 0; |
33 virtual void UpdateVSyncInterval(long timebase_nanos, | 34 virtual void UpdateVSyncInterval(long timebase_nanos, |
34 double interval_seconds) = 0; | 35 double interval_seconds) = 0; |
35 | 36 |
(...skipping 17 matching lines...) Expand all Loading... |
53 protected: | 54 protected: |
54 virtual ~GvrDelegateProvider() {} | 55 virtual ~GvrDelegateProvider() {} |
55 | 56 |
56 private: | 57 private: |
57 static GvrDelegateProvider* delegate_provider_; | 58 static GvrDelegateProvider* delegate_provider_; |
58 }; | 59 }; |
59 | 60 |
60 } // namespace device | 61 } // namespace device |
61 | 62 |
62 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H | 63 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H |
OLD | NEW |