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 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 namespace blink { | 27 namespace blink { |
28 class WebInputEvent; | 28 class WebInputEvent; |
29 } | 29 } |
30 | 30 |
31 namespace content { | 31 namespace content { |
32 class WebContents; | 32 class WebContents; |
33 } | 33 } |
34 | 34 |
| 35 namespace gpu { |
| 36 struct MailboxHolder; |
| 37 } |
| 38 |
35 namespace ui { | 39 namespace ui { |
36 class WindowAndroid; | 40 class WindowAndroid; |
37 } | 41 } |
38 | 42 |
39 namespace vr_shell { | 43 namespace vr_shell { |
40 | 44 |
41 class AndroidUiGestureTarget; | 45 class AndroidUiGestureTarget; |
42 class UiInterface; | 46 class UiInterface; |
43 class VrCompositor; | 47 class VrCompositor; |
44 class VrGLThread; | 48 class VrGLThread; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 168 |
165 void ContentFrameWasResized(bool width_changed); | 169 void ContentFrameWasResized(bool width_changed); |
166 | 170 |
167 void ForceExitVr(); | 171 void ForceExitVr(); |
168 | 172 |
169 void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); | 173 void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); |
170 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); | 174 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); |
171 | 175 |
172 // TODO(mthiesse): Find a better place for these functions to live. | 176 // TODO(mthiesse): Find a better place for these functions to live. |
173 static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat); | 177 static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat); |
| 178 static gvr::Sizei GetRecommendedWebVrSize(gvr::GvrApi* gvr_api); |
174 static device::mojom::VRDisplayInfoPtr CreateVRDisplayInfo( | 179 static device::mojom::VRDisplayInfoPtr CreateVRDisplayInfo( |
175 gvr::GvrApi* gvr_api, | 180 gvr::GvrApi* gvr_api, |
176 gvr::Sizei compositor_size, | 181 gvr::Sizei recommended_size, |
177 uint32_t device_id); | 182 uint32_t device_id); |
178 | 183 |
179 private: | 184 private: |
180 ~VrShell() override; | 185 ~VrShell() override; |
181 void PostToGlThreadWhenReady(const base::Closure& task); | 186 void PostToGlThreadWhenReady(const base::Closure& task); |
182 void SetContentPaused(bool paused); | 187 void SetContentPaused(bool paused); |
183 void SetUiState(); | 188 void SetUiState(); |
184 | 189 |
185 // content::WebContentsObserver implementation. | 190 // content::WebContentsObserver implementation. |
186 void RenderViewHostChanged(content::RenderViewHost* old_host, | 191 void RenderViewHostChanged(content::RenderViewHost* old_host, |
187 content::RenderViewHost* new_host) override; | 192 content::RenderViewHost* new_host) override; |
188 void MainFrameWasResized(bool width_changed) override; | 193 void MainFrameWasResized(bool width_changed) override; |
189 void WebContentsDestroyed() override; | 194 void WebContentsDestroyed() override; |
190 | 195 |
191 // device::GvrDelegate implementation | 196 // device::GvrDelegate implementation |
192 void SetWebVRSecureOrigin(bool secure_origin) override; | 197 void SetWebVRSecureOrigin(bool secure_origin) override; |
193 void SubmitWebVRFrame() override; | 198 void SubmitWebVRFrame(int16_t frame_index, |
| 199 const gpu::MailboxHolder& mailbox) override; |
194 void UpdateWebVRTextureBounds(int16_t frame_index, | 200 void UpdateWebVRTextureBounds(int16_t frame_index, |
195 const gvr::Rectf& left_bounds, | 201 const gvr::Rectf& left_bounds, |
196 const gvr::Rectf& right_bounds) override; | 202 const gvr::Rectf& right_bounds, |
| 203 const gvr::Sizei& source_size) override; |
197 void OnVRVsyncProviderRequest( | 204 void OnVRVsyncProviderRequest( |
198 device::mojom::VRVSyncProviderRequest request) override; | 205 device::mojom::VRVSyncProviderRequest request) override; |
199 void UpdateVSyncInterval(int64_t timebase_nanos, | 206 void UpdateVSyncInterval(int64_t timebase_nanos, |
200 double interval_seconds) override; | 207 double interval_seconds) override; |
201 bool SupportsPresentation() override; | 208 bool SupportsPresentation() override; |
202 void ResetPose() override; | 209 void ResetPose() override; |
203 void CreateVRDisplayInfo( | 210 void CreateVRDisplayInfo( |
204 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, | 211 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, |
205 uint32_t device_id) override; | 212 uint32_t device_id) override; |
206 | 213 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 249 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
243 | 250 |
244 DISALLOW_COPY_AND_ASSIGN(VrShell); | 251 DISALLOW_COPY_AND_ASSIGN(VrShell); |
245 }; | 252 }; |
246 | 253 |
247 bool RegisterVrShell(JNIEnv* env); | 254 bool RegisterVrShell(JNIEnv* env); |
248 | 255 |
249 } // namespace vr_shell | 256 } // namespace vr_shell |
250 | 257 |
251 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 258 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
OLD | NEW |