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

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

Issue 2309523003: Plumbing through more WebVR presentation code (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_VR_ANDROID_GVR_DELEGATE_H
6 #define DEVICE_VR_ANDROID_GVR_DELEGATE_H
7
8 #include "device/vr/vr_export.h"
9
10 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr.h"
11
12 namespace device {
13
14 class DEVICE_VR_EXPORT GvrDelegate {
15 public:
16 virtual void RequestWebVRPresent() = 0;
17 virtual void ExitWebVRPresent() = 0;
18
19 virtual void SubmitWebVRFrame() = 0;
20 virtual void UpdateWebVRTextureBounds(int eye,
21 float left,
22 float top,
23 float width,
24 float height) = 0;
25
26 virtual gvr::GvrApi* gvr_api() = 0;
27 };
28
29 class DEVICE_VR_EXPORT GvrDelegateClient {
30 public:
31 virtual void OnDelegateInitialized(GvrDelegate* delegate) = 0;
32 virtual void OnDelegateShutdown() = 0;
33 };
34
35 class DEVICE_VR_EXPORT GvrDelegateManager {
36 public:
37 static GvrDelegateManager* GetInstance();
38
39 void AddClient(GvrDelegateClient* client);
40 void RemoveClient(GvrDelegateClient* client);
41
42 void Initialize(GvrDelegate* delegate);
43 void Shutdown();
44
45 GvrDelegate* delegate() { return delegate_; }
46
47 private:
48 GvrDelegateManager();
49 ~GvrDelegateManager();
50
51 GvrDelegate* delegate_;
52
53 using ClientList = std::vector<GvrDelegateClient*>;
54 ClientList clients_;
55 };
56
57 } // namespace device
58
59 #endif // DEVICE_VR_ANDROID_GVR_DELEGATE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698