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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // html/js UI hooks. | 85 // html/js UI hooks. |
86 static base::WeakPtr<VrShell> GetWeakPtr( | 86 static base::WeakPtr<VrShell> GetWeakPtr( |
87 const content::WebContents* web_contents); | 87 const content::WebContents* web_contents); |
88 UiScene* GetScene(); | 88 UiScene* GetScene(); |
89 UiInterface* GetUiInterface(); | 89 UiInterface* GetUiInterface(); |
90 void OnDomContentsLoaded(); | 90 void OnDomContentsLoaded(); |
91 | 91 |
92 // device::GvrDelegate implementation | 92 // device::GvrDelegate implementation |
93 void SetWebVRSecureOrigin(bool secure_origin) override; | 93 void SetWebVRSecureOrigin(bool secure_origin) override; |
94 void SubmitWebVRFrame() override; | 94 void SubmitWebVRFrame() override; |
95 void UpdateWebVRTextureBounds( | 95 void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds, |
96 int eye, float left, float top, float width, float height) override; | 96 const gvr::Rectf& right_bounds) override; |
97 gvr::GvrApi* gvr_api() override; | 97 gvr::GvrApi* gvr_api() override; |
98 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num) override; | 98 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num) override; |
99 | 99 |
100 void ContentSurfaceChanged( | 100 void ContentSurfaceChanged( |
101 JNIEnv* env, | 101 JNIEnv* env, |
102 const base::android::JavaParamRef<jobject>& object, | 102 const base::android::JavaParamRef<jobject>& object, |
103 jint width, | 103 jint width, |
104 jint height, | 104 jint height, |
105 const base::android::JavaParamRef<jobject>& surface); | 105 const base::android::JavaParamRef<jobject>& surface); |
106 void UiSurfaceChanged( | 106 void UiSurfaceChanged( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 jint content_texture_id_ = 0; | 146 jint content_texture_id_ = 0; |
147 | 147 |
148 std::unique_ptr<UiScene> scene_; | 148 std::unique_ptr<UiScene> scene_; |
149 std::unique_ptr<UiInterface> html_interface_; | 149 std::unique_ptr<UiInterface> html_interface_; |
150 | 150 |
151 std::unique_ptr<gvr::GvrApi> gvr_api_; | 151 std::unique_ptr<gvr::GvrApi> gvr_api_; |
152 std::unique_ptr<gvr::BufferViewportList> buffer_viewport_list_; | 152 std::unique_ptr<gvr::BufferViewportList> buffer_viewport_list_; |
153 std::unique_ptr<gvr::BufferViewport> buffer_viewport_; | 153 std::unique_ptr<gvr::BufferViewport> buffer_viewport_; |
154 std::unique_ptr<gvr::BufferViewport> headlocked_left_viewport_; | 154 std::unique_ptr<gvr::BufferViewport> headlocked_left_viewport_; |
155 std::unique_ptr<gvr::BufferViewport> headlocked_right_viewport_; | 155 std::unique_ptr<gvr::BufferViewport> headlocked_right_viewport_; |
| 156 std::unique_ptr<gvr::BufferViewport> webvr_left_viewport_; |
| 157 std::unique_ptr<gvr::BufferViewport> webvr_right_viewport_; |
156 std::unique_ptr<gvr::SwapChain> swap_chain_; | 158 std::unique_ptr<gvr::SwapChain> swap_chain_; |
157 | 159 |
158 gvr::Sizei render_size_; | 160 gvr::Sizei render_size_; |
159 | 161 |
160 std::queue<base::Callback<void()>> task_queue_; | 162 std::queue<base::Callback<void()>> task_queue_; |
161 base::Lock task_queue_lock_; | 163 base::Lock task_queue_lock_; |
162 base::Lock gvr_init_lock_; | 164 base::Lock gvr_init_lock_; |
163 | 165 |
164 std::unique_ptr<VrCompositor> content_compositor_; | 166 std::unique_ptr<VrCompositor> content_compositor_; |
165 content::WebContents* main_contents_; | 167 content::WebContents* main_contents_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 201 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
200 | 202 |
201 DISALLOW_COPY_AND_ASSIGN(VrShell); | 203 DISALLOW_COPY_AND_ASSIGN(VrShell); |
202 }; | 204 }; |
203 | 205 |
204 bool RegisterVrShell(JNIEnv* env); | 206 bool RegisterVrShell(JNIEnv* env); |
205 | 207 |
206 } // namespace vr_shell | 208 } // namespace vr_shell |
207 | 209 |
208 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 210 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
OLD | NEW |