| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 166 |
| 163 void ForceExitVr(); | 167 void ForceExitVr(); |
| 164 | 168 |
| 165 void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); | 169 void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); |
| 166 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); | 170 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); |
| 167 | 171 |
| 168 // TODO(mthiesse): Find a better place for these functions to live. | 172 // TODO(mthiesse): Find a better place for these functions to live. |
| 169 static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat); | 173 static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat); |
| 170 static device::mojom::VRDisplayInfoPtr CreateVRDisplayInfo( | 174 static device::mojom::VRDisplayInfoPtr CreateVRDisplayInfo( |
| 171 gvr::GvrApi* gvr_api, | 175 gvr::GvrApi* gvr_api, |
| 172 gvr::Sizei compositor_size, | 176 gvr::Sizei recommended_size, |
| 173 uint32_t device_id); | 177 uint32_t device_id); |
| 174 | 178 |
| 175 private: | 179 private: |
| 176 ~VrShell() override; | 180 ~VrShell() override; |
| 177 void PostToGlThreadWhenReady(const base::Closure& task); | 181 void PostToGlThreadWhenReady(const base::Closure& task); |
| 178 void SetContentPaused(bool paused); | 182 void SetContentPaused(bool paused); |
| 179 void SetUiState(); | 183 void SetUiState(); |
| 180 | 184 |
| 181 // content::WebContentsObserver implementation. | 185 // content::WebContentsObserver implementation. |
| 182 void RenderViewHostChanged(content::RenderViewHost* old_host, | 186 void RenderViewHostChanged(content::RenderViewHost* old_host, |
| 183 content::RenderViewHost* new_host) override; | 187 content::RenderViewHost* new_host) override; |
| 184 void MainFrameWasResized(bool width_changed) override; | 188 void MainFrameWasResized(bool width_changed) override; |
| 185 void WebContentsDestroyed() override; | 189 void WebContentsDestroyed() override; |
| 186 | 190 |
| 187 // device::GvrDelegate implementation | 191 // device::GvrDelegate implementation |
| 188 void SetWebVRSecureOrigin(bool secure_origin) override; | 192 void SetWebVRSecureOrigin(bool secure_origin) override; |
| 189 void SubmitWebVRFrame() override; | 193 void SubmitWebVRFrame(int16_t frame_index, |
| 194 const gpu::MailboxHolder& mailbox) override; |
| 190 void UpdateWebVRTextureBounds(int16_t frame_index, | 195 void UpdateWebVRTextureBounds(int16_t frame_index, |
| 191 const gvr::Rectf& left_bounds, | 196 const gvr::Rectf& left_bounds, |
| 192 const gvr::Rectf& right_bounds) override; | 197 const gvr::Rectf& right_bounds, |
| 198 const gvr::Sizei& source_size) override; |
| 193 void OnVRVsyncProviderRequest( | 199 void OnVRVsyncProviderRequest( |
| 194 device::mojom::VRVSyncProviderRequest request) override; | 200 device::mojom::VRVSyncProviderRequest request) override; |
| 195 void UpdateVSyncInterval(int64_t timebase_nanos, | 201 void UpdateVSyncInterval(int64_t timebase_nanos, |
| 196 double interval_seconds) override; | 202 double interval_seconds) override; |
| 197 bool SupportsPresentation() override; | 203 bool SupportsPresentation() override; |
| 198 void ResetPose() override; | 204 void ResetPose() override; |
| 199 void CreateVRDisplayInfo( | 205 void CreateVRDisplayInfo( |
| 200 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, | 206 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, |
| 201 uint32_t device_id) override; | 207 uint32_t device_id) override; |
| 202 | 208 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 244 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 239 | 245 |
| 240 DISALLOW_COPY_AND_ASSIGN(VrShell); | 246 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 241 }; | 247 }; |
| 242 | 248 |
| 243 bool RegisterVrShell(JNIEnv* env); | 249 bool RegisterVrShell(JNIEnv* env); |
| 244 | 250 |
| 245 } // namespace vr_shell | 251 } // namespace vr_shell |
| 246 | 252 |
| 247 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 253 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |