| 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 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 float desktop_screen_tilt_; | 144 float desktop_screen_tilt_; |
| 145 float desktop_height_; | 145 float desktop_height_; |
| 146 | 146 |
| 147 std::unique_ptr<UiScene> scene_; | 147 std::unique_ptr<UiScene> scene_; |
| 148 std::unique_ptr<UiInterface> html_interface_; | 148 std::unique_ptr<UiInterface> html_interface_; |
| 149 | 149 |
| 150 std::unique_ptr<gvr::GvrApi> gvr_api_; | 150 std::unique_ptr<gvr::GvrApi> gvr_api_; |
| 151 std::unique_ptr<gvr::BufferViewportList> buffer_viewport_list_; | 151 std::unique_ptr<gvr::BufferViewportList> buffer_viewport_list_; |
| 152 std::unique_ptr<gvr::BufferViewport> buffer_viewport_; | 152 std::unique_ptr<gvr::BufferViewport> buffer_viewport_; |
| 153 std::unique_ptr<gvr::BufferViewport> headlocked_left_viewport_; |
| 154 std::unique_ptr<gvr::BufferViewport> headlocked_right_viewport_; |
| 153 std::unique_ptr<gvr::SwapChain> swap_chain_; | 155 std::unique_ptr<gvr::SwapChain> swap_chain_; |
| 154 | 156 |
| 155 gvr::Sizei render_size_; | 157 gvr::Sizei render_size_; |
| 156 | 158 |
| 157 std::queue<base::Callback<void()>> task_queue_; | 159 std::queue<base::Callback<void()>> task_queue_; |
| 158 base::Lock task_queue_lock_; | 160 base::Lock task_queue_lock_; |
| 159 | 161 |
| 160 std::unique_ptr<VrCompositor> content_compositor_; | 162 std::unique_ptr<VrCompositor> content_compositor_; |
| 161 content::WebContents* main_contents_; | 163 content::WebContents* main_contents_; |
| 162 std::unique_ptr<VrCompositor> ui_compositor_; | 164 std::unique_ptr<VrCompositor> ui_compositor_; |
| 163 content::WebContents* ui_contents_; | 165 content::WebContents* ui_contents_; |
| 164 | 166 |
| 165 VrShellDelegate* delegate_ = nullptr; | 167 VrShellDelegate* delegate_ = nullptr; |
| 166 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; | 168 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; |
| 167 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; | 169 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; |
| 168 | 170 |
| 169 bool touch_pending_ = false; | 171 bool touch_pending_ = false; |
| 170 gvr::Quatf controller_quat_; | 172 gvr::Quatf controller_quat_; |
| 171 | 173 |
| 172 gvr::Vec3f target_point_; | 174 gvr::Vec3f target_point_; |
| 173 const ContentRectangle* target_element_ = nullptr; | 175 const ContentRectangle* target_element_ = nullptr; |
| 174 VrInputManager* current_input_target_ = nullptr; | 176 VrInputManager* current_input_target_ = nullptr; |
| 175 int ui_tex_width_ = 0; | 177 int ui_tex_width_ = 0; |
| 176 int ui_tex_height_ = 0; | 178 int ui_tex_height_ = 0; |
| 179 bool dom_contents_loaded_ = false; |
| 177 | 180 |
| 178 bool webvr_mode_ = false; | 181 bool webvr_mode_ = false; |
| 179 bool webvr_secure_origin_ = false; | 182 bool webvr_secure_origin_ = false; |
| 180 int64_t webvr_warning_end_nanos_ = 0; | 183 int64_t webvr_warning_end_nanos_ = 0; |
| 181 // The pose ring buffer size must be a power of two to avoid glitches when | 184 // The pose ring buffer size must be a power of two to avoid glitches when |
| 182 // the pose index wraps around. It should be large enough to handle the | 185 // the pose index wraps around. It should be large enough to handle the |
| 183 // current backlog of poses which is 2-3 frames. | 186 // current backlog of poses which is 2-3 frames. |
| 184 static constexpr int kPoseRingBufferSize = 8; | 187 static constexpr int kPoseRingBufferSize = 8; |
| 185 std::vector<gvr::Mat4f> webvr_head_pose_; | 188 std::vector<gvr::Mat4f> webvr_head_pose_; |
| 186 | 189 |
| 187 std::unique_ptr<VrController> controller_; | 190 std::unique_ptr<VrController> controller_; |
| 188 scoped_refptr<VrInputManager> content_input_manager_; | 191 scoped_refptr<VrInputManager> content_input_manager_; |
| 189 scoped_refptr<VrInputManager> ui_input_manager_; | 192 scoped_refptr<VrInputManager> ui_input_manager_; |
| 190 | 193 |
| 191 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 194 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 192 | 195 |
| 193 DISALLOW_COPY_AND_ASSIGN(VrShell); | 196 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 194 }; | 197 }; |
| 195 | 198 |
| 196 bool RegisterVrShell(JNIEnv* env); | 199 bool RegisterVrShell(JNIEnv* env); |
| 197 | 200 |
| 198 } // namespace vr_shell | 201 } // namespace vr_shell |
| 199 | 202 |
| 200 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 203 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |