| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 void ForceExitVr(); | 176 void ForceExitVr(); |
| 177 | 177 |
| 178 void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); | 178 void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); |
| 179 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); | 179 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); |
| 180 | 180 |
| 181 // device::GvrGamepadDataProvider implementation. | 181 // device::GvrGamepadDataProvider implementation. |
| 182 void UpdateGamepadData(device::GvrGamepadData) override; | 182 void UpdateGamepadData(device::GvrGamepadData) override; |
| 183 void RegisterGamepadDataFetcher(device::GvrGamepadDataFetcher*) override; | 183 void RegisterGamepadDataFetcher(device::GvrGamepadDataFetcher*) override; |
| 184 | 184 |
| 185 // TODO(mthiesse): Find a better place for these functions to live. | 185 // TODO(mthiesse): Find a better place for these functions to live. They are |
| 186 static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat); | 186 // called from both vr_shell_gl and non_presenting_gvr_delegate. |
| 187 |
| 188 // Creates a WebVR pose from a GVR pose, including filling in an angular |
| 189 // velocity estimate based on the change between two predicted poses. |
| 190 static device::mojom::VRPosePtr VRPosePtrFromGvrPose( |
| 191 gvr::Mat4f head_matrix_predicted, |
| 192 gvr::Mat4f head_matrix_for_angular_velocity, |
| 193 int64_t epsilon_nanos); |
| 194 |
| 195 // Provides a recommended render resolution for WebVR, this is passed on to |
| 196 // the application as renderWidth/Height |
| 187 static gvr::Sizei GetRecommendedWebVrSize(gvr::GvrApi* gvr_api); | 197 static gvr::Sizei GetRecommendedWebVrSize(gvr::GvrApi* gvr_api); |
| 198 |
| 199 // Fill in the VRDisplayInfo based on recommended size and other headset |
| 200 // parameters. |
| 188 static device::mojom::VRDisplayInfoPtr CreateVRDisplayInfo( | 201 static device::mojom::VRDisplayInfoPtr CreateVRDisplayInfo( |
| 189 gvr::GvrApi* gvr_api, | 202 gvr::GvrApi* gvr_api, |
| 190 gvr::Sizei recommended_size, | 203 gvr::Sizei recommended_size, |
| 191 uint32_t device_id); | 204 uint32_t device_id); |
| 192 | 205 |
| 193 private: | 206 private: |
| 194 ~VrShell() override; | 207 ~VrShell() override; |
| 195 void PostToGlThreadWhenReady(const base::Closure& task); | 208 void PostToGlThreadWhenReady(const base::Closure& task); |
| 196 void SetContentPaused(bool paused); | 209 void SetContentPaused(bool paused); |
| 197 void SetUiState(); | 210 void SetUiState(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 277 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 265 | 278 |
| 266 DISALLOW_COPY_AND_ASSIGN(VrShell); | 279 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 267 }; | 280 }; |
| 268 | 281 |
| 269 bool RegisterVrShell(JNIEnv* env); | 282 bool RegisterVrShell(JNIEnv* env); |
| 270 | 283 |
| 271 } // namespace vr_shell | 284 } // namespace vr_shell |
| 272 | 285 |
| 273 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 286 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |