| 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> |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void UiSurfaceChanged( | 81 void UiSurfaceChanged( |
| 82 JNIEnv* env, | 82 JNIEnv* env, |
| 83 const base::android::JavaParamRef<jobject>& object, | 83 const base::android::JavaParamRef<jobject>& object, |
| 84 jint width, | 84 jint width, |
| 85 jint height, | 85 jint height, |
| 86 const base::android::JavaParamRef<jobject>& surface); | 86 const base::android::JavaParamRef<jobject>& surface); |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 virtual ~VrShell(); | 89 virtual ~VrShell(); |
| 90 void LoadUIContent(); | 90 void LoadUIContent(); |
| 91 bool IsUiTextureReady(); |
| 92 Rectf MakeUiPixelCopyRect(Recti pixel_rect); |
| 91 void DrawVrShell(int64_t time); | 93 void DrawVrShell(int64_t time); |
| 92 void DrawEye(const gvr::Mat4f& view_matrix, | 94 void DrawEye(const gvr::Mat4f& view_matrix, |
| 93 const gvr::BufferViewport& params); | 95 const gvr::BufferViewport& params); |
| 94 void DrawContentRect(); | |
| 95 void DrawWebVr(); | |
| 96 void DrawUI(); | 96 void DrawUI(); |
| 97 void DrawCursor(); | 97 void DrawCursor(); |
| 98 void DrawWebVr(); |
| 99 void DrawWebVrOverlay(int64_t present_time_nanos); |
| 100 void DrawWebVrEye(const gvr::Mat4f& view_matrix, |
| 101 const gvr::BufferViewport& params, |
| 102 int64_t present_time_nanos); |
| 98 | 103 |
| 99 void UpdateController(); | 104 void UpdateController(); |
| 100 | 105 |
| 101 // samplerExternalOES texture data for UI content image. | 106 // samplerExternalOES texture data for UI content image. |
| 102 jint ui_texture_id_ = 0; | 107 jint ui_texture_id_ = 0; |
| 103 // samplerExternalOES texture data for main content image. | 108 // samplerExternalOES texture data for main content image. |
| 104 jint content_texture_id_ = 0; | 109 jint content_texture_id_ = 0; |
| 105 | 110 |
| 106 float desktop_screen_tilt_; | 111 float desktop_screen_tilt_; |
| 107 float desktop_height_; | 112 float desktop_height_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 134 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; | 139 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; |
| 135 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; | 140 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; |
| 136 | 141 |
| 137 gvr::Quatf controller_quat_; | 142 gvr::Quatf controller_quat_; |
| 138 bool controller_active_ = false; | 143 bool controller_active_ = false; |
| 139 gvr::Vec3f look_at_vector_; | 144 gvr::Vec3f look_at_vector_; |
| 140 int ui_tex_width_ = 0; | 145 int ui_tex_width_ = 0; |
| 141 int ui_tex_height_ = 0; | 146 int ui_tex_height_ = 0; |
| 142 | 147 |
| 143 bool webvr_mode_ = false; | 148 bool webvr_mode_ = false; |
| 144 bool webvr_secure_origin_; | 149 bool webvr_secure_origin_ = false; |
| 150 int64_t webvr_warning_end_nanos_ = 0; |
| 145 | 151 |
| 146 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 152 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 147 | 153 |
| 148 DISALLOW_COPY_AND_ASSIGN(VrShell); | 154 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 149 }; | 155 }; |
| 150 | 156 |
| 151 bool RegisterVrShell(JNIEnv* env); | 157 bool RegisterVrShell(JNIEnv* env); |
| 152 | 158 |
| 153 } // namespace vr_shell | 159 } // namespace vr_shell |
| 154 | 160 |
| 155 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 161 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |