Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell.h

Issue 2384593002: Encode frame number in pixel data for pose sync (Closed)
Patch Set: dcheng #19/20, mthiesse #17: use vector + init pose ring buffer, cleanups Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(const gvr::Mat4f& pose, uint32_t pose_num) 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 bool controller_active_ = false; 150 bool controller_active_ = false;
150 151
151 gvr::Vec3f target_point_; 152 gvr::Vec3f target_point_;
152 const ContentRectangle* target_element_ = nullptr; 153 const ContentRectangle* target_element_ = nullptr;
153 int ui_tex_width_ = 0; 154 int ui_tex_width_ = 0;
154 int ui_tex_height_ = 0; 155 int ui_tex_height_ = 0;
155 156
156 bool webvr_mode_ = false; 157 bool webvr_mode_ = false;
157 bool webvr_secure_origin_ = false; 158 bool webvr_secure_origin_ = false;
158 int64_t webvr_warning_end_nanos_ = 0; 159 int64_t webvr_warning_end_nanos_ = 0;
160 // The pose ring buffer size must be a power of two to avoid glitches when
161 // the pose index wraps around. It should be large enough to handle the
162 // current backlog of poses which is 2-3 frames.
163 static constexpr int kPoseRingBufferSize = 8;
164 std::vector<gvr::Mat4f> webvr_head_pose_;
159 165
160 base::WeakPtrFactory<VrShell> weak_ptr_factory_; 166 base::WeakPtrFactory<VrShell> weak_ptr_factory_;
161 167
162 DISALLOW_COPY_AND_ASSIGN(VrShell); 168 DISALLOW_COPY_AND_ASSIGN(VrShell);
163 }; 169 };
164 170
165 bool RegisterVrShell(JNIEnv* env); 171 bool RegisterVrShell(JNIEnv* env);
166 172
167 } // namespace vr_shell 173 } // namespace vr_shell
168 174
169 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 175 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | chrome/browser/android/vr_shell/vr_shell.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698