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

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

Issue 2252103002: Introduce ChromeVR to Chrome on Android (behind a build flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment as suggested by Daniel Created 4 years, 4 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
« no previous file with comments | « chrome/browser/android/vr_shell/DEPS ('k') | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..4fcff02aca8e683e1b218bd9d2cd14a4118cbffa
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -0,0 +1,77 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
+#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
+
+#include <jni.h>
+#include <memory>
+
+#include "base/android/jni_weak_ref.h"
+#include "base/macros.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"
+
+namespace vr_shell {
+
+class VrShellRenderer;
+
+class ContentRect {
+ public:
+ ContentRect();
+ ~ContentRect();
+ void SetIdentity();
+ void Translate(float x, float y, float z);
+ gvr::Mat4f transfrom_to_world;
+ int content_texture_handle;
+};
+
+class VrShell {
+ public:
+ VrShell(JNIEnv* env, jobject obj);
+
+ void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
+
+ void GvrInit(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jlong native_gvr_api);
+ void InitializeGl(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jint texture_data_handle);
+ void DrawFrame(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
+ void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
+ void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
+
+ private:
+ ~VrShell();
+
+ void DrawEye(const gvr::Mat4f& view_matrix,
+ const gvr::BufferViewport& params);
+ void DrawContentRect();
+
+ std::unique_ptr<ContentRect> content_rect_;
+ std::unique_ptr<gvr::GvrApi> gvr_api_;
+ std::unique_ptr<gvr::BufferViewportList> buffer_viewport_list_;
+ std::unique_ptr<gvr::BufferViewport> buffer_viewport_;
+ std::unique_ptr<gvr::SwapChain> swap_chain_;
+
+ gvr::Mat4f view_matrix_;
+ gvr::Mat4f projection_matrix_;
+
+ gvr::Mat4f head_pose_;
+
+ gvr::Sizei render_size_;
+
+ std::unique_ptr<VrShellRenderer> vr_shell_renderer_;
+
+ base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_;
+
+ DISALLOW_COPY_AND_ASSIGN(VrShell);
+};
+
+bool RegisterVrShell(JNIEnv* env);
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
« no previous file with comments | « chrome/browser/android/vr_shell/DEPS ('k') | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698