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

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

Issue 2739973002: Revert of WebVR compositor bypass via BrowserMain context + mailbox (Closed)
Patch Set: Created 3 years, 9 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/DEPS ('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 "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 device { 13 namespace device {
14 14
15 constexpr gvr::Sizei kInvalidRenderTargetSize = {0, 0}; 15 constexpr gvr::Sizei kInvalidRenderTargetSize = {0, 0};
16 16
17 class DEVICE_VR_EXPORT GvrDelegate { 17 class DEVICE_VR_EXPORT GvrDelegate {
18 public: 18 public:
19 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0; 19 virtual void SetWebVRSecureOrigin(bool secure_origin) = 0;
20 virtual void SubmitWebVRFrame(int16_t frame_index, 20 virtual void SubmitWebVRFrame() = 0;
21 const gpu::MailboxHolder& mailbox) = 0;
22 virtual void UpdateWebVRTextureBounds(int16_t frame_index, 21 virtual void UpdateWebVRTextureBounds(int16_t frame_index,
23 const gvr::Rectf& left_bounds, 22 const gvr::Rectf& left_bounds,
24 const gvr::Rectf& right_bounds, 23 const gvr::Rectf& right_bounds) = 0;
25 const gvr::Sizei& source_size) = 0;
26 virtual void OnVRVsyncProviderRequest( 24 virtual void OnVRVsyncProviderRequest(
27 mojom::VRVSyncProviderRequest request) = 0; 25 mojom::VRVSyncProviderRequest request) = 0;
28 virtual void UpdateVSyncInterval(int64_t timebase_nanos, 26 virtual void UpdateVSyncInterval(int64_t timebase_nanos,
29 double interval_seconds) = 0; 27 double interval_seconds) = 0;
30 virtual bool SupportsPresentation() = 0; 28 virtual bool SupportsPresentation() = 0;
31 virtual void ResetPose() = 0; 29 virtual void ResetPose() = 0;
32 virtual void CreateVRDisplayInfo( 30 virtual void CreateVRDisplayInfo(
33 const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback, 31 const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback,
34 uint32_t device_id) = 0; 32 uint32_t device_id) = 0;
35 33
36 protected: 34 protected:
37 virtual ~GvrDelegate() {} 35 virtual ~GvrDelegate() {}
38 }; 36 };
39 37
40 class DEVICE_VR_EXPORT GvrDelegateProvider { 38 class DEVICE_VR_EXPORT GvrDelegateProvider {
41 public: 39 public:
42 static void SetInstance( 40 static void SetInstance(
43 const base::Callback<GvrDelegateProvider*()>& provider_callback); 41 const base::Callback<GvrDelegateProvider*()>& provider_callback);
44 static GvrDelegateProvider* GetInstance(); 42 static GvrDelegateProvider* GetInstance();
45 43
46 virtual void SetDeviceProvider(GvrDeviceProvider* device_provider) = 0; 44 virtual void SetDeviceProvider(GvrDeviceProvider* device_provider) = 0;
47 virtual void ClearDeviceProvider() = 0; 45 virtual void ClearDeviceProvider() = 0;
48 virtual void RequestWebVRPresent( 46 virtual void RequestWebVRPresent(
49 mojom::VRSubmitFrameClientPtr submit_client,
50 const base::Callback<void(bool)>& callback) = 0; 47 const base::Callback<void(bool)>& callback) = 0;
51 virtual void ExitWebVRPresent() = 0; 48 virtual void ExitWebVRPresent() = 0;
52 virtual GvrDelegate* GetDelegate() = 0; 49 virtual GvrDelegate* GetDelegate() = 0;
53 virtual void SetListeningForActivate(bool listening) = 0; 50 virtual void SetListeningForActivate(bool listening) = 0;
54 51
55 protected: 52 protected:
56 virtual ~GvrDelegateProvider() {} 53 virtual ~GvrDelegateProvider() {}
57 54
58 private: 55 private:
59 static base::Callback<GvrDelegateProvider*()> delegate_provider_; 56 static base::Callback<GvrDelegateProvider*()> delegate_provider_;
60 }; 57 };
61 58
62 } // namespace device 59 } // namespace device
63 60
64 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H 61 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H
OLDNEW
« no previous file with comments | « device/vr/DEPS ('k') | device/vr/android/gvr/gvr_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698