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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.h

Issue 2308683004: Added WebVR Render path to VrShell (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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/vr_shell.h
diff --git a/chrome/browser/android/vr_shell/vr_shell.h b/chrome/browser/android/vr_shell/vr_shell.h
index 4fcff02aca8e683e1b218bd9d2cd14a4118cbffa..53d8a83f5d5deef5063929bc856867fa388b6297 100644
--- a/chrome/browser/android/vr_shell/vr_shell.h
+++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -10,6 +10,7 @@
#include "base/android/jni_weak_ref.h"
#include "base/macros.h"
+#include "device/vr/android/gvr/gvr_delegate.h"
#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr.h"
#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_types.h"
@@ -27,7 +28,7 @@ class ContentRect {
int content_texture_handle;
};
-class VrShell {
+class VrShell : public device::GvrDelegate {
public:
VrShell(JNIEnv* env, jobject obj);
@@ -43,12 +44,21 @@ class VrShell {
void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
+ // GvrDelegate
+ void RequestWebVRPresent() override;
+ void ExitWebVRPresent() override;
+ void SubmitWebVRFrame() override;
+ void UpdateWebVRTextureBounds(
+ int eye, float left, float top, float width, float height) override;
+ gvr::GvrApi* gvr_api() override;
+
private:
- ~VrShell();
+ virtual ~VrShell();
void DrawEye(const gvr::Mat4f& view_matrix,
const gvr::BufferViewport& params);
void DrawContentRect();
+ void DrawWebVR();
std::unique_ptr<ContentRect> content_rect_;
std::unique_ptr<gvr::GvrApi> gvr_api_;
@@ -67,6 +77,8 @@ class VrShell {
base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_;
+ bool webvr_mode_;
+
DISALLOW_COPY_AND_ASSIGN(VrShell);
};

Powered by Google App Engine
This is Rietveld 408576698