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