Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/android/jni_weak_ref.h" | 12 #include "base/android/jni_weak_ref.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "chrome/browser/android/vr_shell/simple_compositor_view.h" | |
| 14 #include "chrome/browser/android/vr_shell/ui_elements.h" | 15 #include "chrome/browser/android/vr_shell/ui_elements.h" |
| 15 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr.h" | 16 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr.h" |
| 16 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr_types.h" | 17 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr_types.h" |
| 17 | 18 |
| 19 namespace content { | |
| 20 class ContentViewCore; | |
| 21 } | |
| 22 | |
| 23 namespace ui { | |
| 24 class WindowAndroid; | |
| 25 } | |
| 18 | 26 |
| 19 namespace vr_shell { | 27 namespace vr_shell { |
| 20 | 28 |
| 21 class VrShellRenderer; | 29 class VrShellRenderer; |
| 22 | 30 |
| 23 class VrShell { | 31 class VrShell { |
| 24 public: | 32 public: |
| 25 VrShell(JNIEnv* env, jobject obj); | 33 VrShell(JNIEnv* env, jobject obj, |
| 34 content::ContentViewCore* content_core, | |
|
bshe
2016/09/12 16:39:56
nit:s/content_core/content_view_core
mthiesse
2016/09/12 21:46:04
Done.
| |
| 35 ui::WindowAndroid* content_window); | |
| 26 | 36 |
| 37 void UpdateCompositorLayers(JNIEnv* env, | |
| 38 const base::android::JavaParamRef<jobject>& obj); | |
| 27 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 39 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 28 void GvrInit(JNIEnv* env, | 40 void GvrInit(JNIEnv* env, |
| 29 const base::android::JavaParamRef<jobject>& obj, | 41 const base::android::JavaParamRef<jobject>& obj, |
| 30 jlong native_gvr_api); | 42 jlong native_gvr_api); |
| 31 void InitializeGl(JNIEnv* env, | 43 void InitializeGl(JNIEnv* env, |
| 32 const base::android::JavaParamRef<jobject>& obj, | 44 const base::android::JavaParamRef<jobject>& obj, |
| 33 jint texture_data_handle); | 45 jint texture_data_handle); |
| 34 void DrawFrame(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 46 void DrawFrame(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 35 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 47 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 36 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 48 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 37 | 49 |
| 50 void ContentSurfaceDestroyed( | |
| 51 JNIEnv* env, | |
| 52 const base::android::JavaParamRef<jobject>& object); | |
| 53 void ContentSurfaceChanged( | |
| 54 JNIEnv* env, | |
| 55 const base::android::JavaParamRef<jobject>& object, | |
| 56 jint width, | |
| 57 jint height, | |
| 58 const base::android::JavaParamRef<jobject>& surface); | |
| 59 | |
| 38 private: | 60 private: |
| 39 ~VrShell(); | 61 ~VrShell(); |
| 40 void DrawEye(const gvr::Mat4f& view_matrix, | 62 void DrawEye(const gvr::Mat4f& view_matrix, |
| 41 const gvr::BufferViewport& params); | 63 const gvr::BufferViewport& params); |
| 42 void DrawUI(); | 64 void DrawUI(); |
| 43 | 65 |
| 44 void UpdateTransforms(float screen_width_meters, | 66 void UpdateTransforms(float screen_width_meters, |
| 45 float screen_height_meters, | 67 float screen_height_meters, |
| 46 float scree_tilt); | 68 float scree_tilt); |
| 47 | 69 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 61 std::unique_ptr<gvr::BufferViewport> buffer_viewport_; | 83 std::unique_ptr<gvr::BufferViewport> buffer_viewport_; |
| 62 std::unique_ptr<gvr::SwapChain> swap_chain_; | 84 std::unique_ptr<gvr::SwapChain> swap_chain_; |
| 63 | 85 |
| 64 gvr::Mat4f view_matrix_; | 86 gvr::Mat4f view_matrix_; |
| 65 gvr::Mat4f projection_matrix_; | 87 gvr::Mat4f projection_matrix_; |
| 66 | 88 |
| 67 gvr::Mat4f head_pose_; | 89 gvr::Mat4f head_pose_; |
| 68 | 90 |
| 69 gvr::Sizei render_size_; | 91 gvr::Sizei render_size_; |
| 70 | 92 |
| 93 std::unique_ptr<SimpleCompositorView> content_compositor_view_; | |
| 94 content::ContentViewCore* content_core_; | |
|
bshe
2016/09/12 16:39:56
nit:s/content_core_/content_view_core_
mthiesse
2016/09/12 21:46:04
Done.
| |
| 95 | |
| 71 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; | 96 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; |
| 72 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; | 97 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; |
| 73 | 98 |
| 74 DISALLOW_COPY_AND_ASSIGN(VrShell); | 99 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 75 }; | 100 }; |
| 76 | 101 |
| 77 bool RegisterVrShell(JNIEnv* env); | 102 bool RegisterVrShell(JNIEnv* env); |
| 78 | 103 |
| 79 } // namespace vr_shell | 104 } // namespace vr_shell |
| 80 | 105 |
| 81 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 106 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |