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 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 UiScene* GetScene(); | 66 UiScene* GetScene(); |
67 void OnDomContentsLoaded(); | 67 void OnDomContentsLoaded(); |
68 void SetUiTextureSize(int width, int height); | 68 void SetUiTextureSize(int width, int height); |
69 | 69 |
70 // device::GvrDelegate implementation | 70 // device::GvrDelegate implementation |
71 void SetWebVRSecureOrigin(bool secure_origin) override; | 71 void SetWebVRSecureOrigin(bool secure_origin) override; |
72 void SubmitWebVRFrame() override; | 72 void SubmitWebVRFrame() override; |
73 void UpdateWebVRTextureBounds( | 73 void UpdateWebVRTextureBounds( |
74 int eye, float left, float top, float width, float height) override; | 74 int eye, float left, float top, float width, float height) override; |
75 gvr::GvrApi* gvr_api() override; | 75 gvr::GvrApi* gvr_api() override; |
| 76 void SetGvrPoseForWebVr(gvr::Mat4f pose, int32_t frameNumStarted) override; |
76 | 77 |
77 void ContentSurfaceChanged( | 78 void ContentSurfaceChanged( |
78 JNIEnv* env, | 79 JNIEnv* env, |
79 const base::android::JavaParamRef<jobject>& object, | 80 const base::android::JavaParamRef<jobject>& object, |
80 jint width, | 81 jint width, |
81 jint height, | 82 jint height, |
82 const base::android::JavaParamRef<jobject>& surface); | 83 const base::android::JavaParamRef<jobject>& surface); |
83 void UiSurfaceChanged( | 84 void UiSurfaceChanged( |
84 JNIEnv* env, | 85 JNIEnv* env, |
85 const base::android::JavaParamRef<jobject>& object, | 86 const base::android::JavaParamRef<jobject>& object, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 bool controller_active_ = false; | 151 bool controller_active_ = false; |
151 | 152 |
152 gvr::Vec3f target_point_; | 153 gvr::Vec3f target_point_; |
153 const ContentRectangle* target_element_ = nullptr; | 154 const ContentRectangle* target_element_ = nullptr; |
154 int ui_tex_width_ = 0; | 155 int ui_tex_width_ = 0; |
155 int ui_tex_height_ = 0; | 156 int ui_tex_height_ = 0; |
156 | 157 |
157 bool webvr_mode_ = false; | 158 bool webvr_mode_ = false; |
158 bool webvr_secure_origin_ = false; | 159 bool webvr_secure_origin_ = false; |
159 int64_t webvr_warning_end_nanos_ = 0; | 160 int64_t webvr_warning_end_nanos_ = 0; |
| 161 static constexpr int POSE_QUEUE_SIZE = 8; |
| 162 gvr::Mat4f webvr_head_pose_[POSE_QUEUE_SIZE]; |
| 163 int32_t webvr_newest_pose_num_ = 0; |
160 | 164 |
161 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 165 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
162 | 166 |
163 DISALLOW_COPY_AND_ASSIGN(VrShell); | 167 DISALLOW_COPY_AND_ASSIGN(VrShell); |
164 }; | 168 }; |
165 | 169 |
166 bool RegisterVrShell(JNIEnv* env); | 170 bool RegisterVrShell(JNIEnv* env); |
167 | 171 |
168 } // namespace vr_shell | 172 } // namespace vr_shell |
169 | 173 |
170 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 174 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
OLD | NEW |