Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: device/vr/android/gvr/gvr_delegate.h

Issue 2624633002: Remove Sync GetPose VRService call, implement VRVSyncProvider (Closed)
Patch Set: oops Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/vr/BUILD.gn ('k') | device/vr/android/gvr/gvr_device.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "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 = {0, 0};
19 20
20 class DEVICE_VR_EXPORT GvrDelegate { 21 class DEVICE_VR_EXPORT GvrDelegate {
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() = 0;
24 virtual void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds, 25 virtual void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds,
25 const gvr::Rectf& right_bounds) = 0; 26 const gvr::Rectf& right_bounds) = 0;
26
27 virtual void SetGvrPoseForWebVr(const gvr::Mat4f& pose,
28 uint32_t pose_index) = 0;
29 virtual gvr::Sizei GetWebVRCompositorSurfaceSize() = 0; 27 virtual gvr::Sizei GetWebVRCompositorSurfaceSize() = 0;
30 virtual void SetWebVRRenderSurfaceSize(int width, int height) = 0; 28 virtual void SetWebVRRenderSurfaceSize(int width, int height) = 0;
29 // TODO(mthiesse): This function is not threadsafe. crbug.com/674594
31 virtual gvr::GvrApi* gvr_api() = 0; 30 virtual gvr::GvrApi* gvr_api() = 0;
31 virtual void OnVRVsyncProviderRequest(
32 mojom::VRVSyncProviderRequest request) = 0;
33 virtual void UpdateVSyncInterval(long timebase_nanos,
34 double interval_seconds) = 0;
35
36 protected:
37 virtual ~GvrDelegate() {}
32 }; 38 };
33 39
34 class DEVICE_VR_EXPORT GvrDelegateProvider { 40 class DEVICE_VR_EXPORT GvrDelegateProvider {
35 public: 41 public:
36 static void SetInstance(GvrDelegateProvider* delegate_provider); 42 static void SetInstance(GvrDelegateProvider* delegate_provider);
37 static GvrDelegateProvider* GetInstance(); 43 static GvrDelegateProvider* GetInstance();
38 44
39 virtual void SetDeviceProvider(GvrDeviceProvider* device_provider) = 0; 45 virtual void SetDeviceProvider(GvrDeviceProvider* device_provider) = 0;
40 virtual void RequestWebVRPresent( 46 virtual void RequestWebVRPresent(
41 const base::Callback<void(bool)>& callback) = 0; 47 const base::Callback<void(bool)>& callback) = 0;
42 virtual void ExitWebVRPresent() = 0; 48 virtual void ExitWebVRPresent() = 0;
43 virtual GvrDelegate* GetNonPresentingDelegate() = 0; 49 virtual GvrDelegate* GetNonPresentingDelegate() = 0;
44 virtual void DestroyNonPresentingDelegate() = 0; 50 virtual void DestroyNonPresentingDelegate() = 0;
45 virtual void SetListeningForActivate(bool listening) = 0; 51 virtual void SetListeningForActivate(bool listening) = 0;
46 52
53 protected:
54 virtual ~GvrDelegateProvider() {}
55
47 private: 56 private:
48 static GvrDelegateProvider* delegate_provider_; 57 static GvrDelegateProvider* delegate_provider_;
49 }; 58 };
50 59
51 } // namespace device 60 } // namespace device
52 61
53 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H 62 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H
OLDNEW
« no previous file with comments | « device/vr/BUILD.gn ('k') | device/vr/android/gvr/gvr_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698