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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.h

Issue 2384593002: Encode frame number in pixel data for pose sync (Closed)
Patch Set: bajones #10: restoreStateFromContext, skip pixel read for non-async mode 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/vr_shell.h
diff --git a/chrome/browser/android/vr_shell/vr_shell.h b/chrome/browser/android/vr_shell/vr_shell.h
index 56b69dd659f377e3a73299d88845912b6b0aa24c..f8f935410a58e7e89541512b0f9413375f82bdae 100644
--- a/chrome/browser/android/vr_shell/vr_shell.h
+++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -73,6 +73,7 @@ class VrShell : public device::GvrDelegate {
void UpdateWebVRTextureBounds(
int eye, float left, float top, float width, float height) override;
gvr::GvrApi* gvr_api() override;
+ void SetGvrPoseForWebVr(gvr::Mat4f pose, uint32_t pose_num) override;
mthiesse 2016/10/04 21:19:16 This function name feels wrong... How about SetPo
klausw 2016/10/04 23:56:42 I think it does need "GvrPose" in the name since t
void ContentSurfaceChanged(
JNIEnv* env,
@@ -156,6 +157,12 @@ class VrShell : public device::GvrDelegate {
bool webvr_mode_ = false;
bool webvr_secure_origin_ = false;
int64_t webvr_warning_end_nanos_ = 0;
+ // The pose queue size must be a power of two to avoid glitches when
+ // the pose counter wraps around. Should be large enough to handle
+ // the current backlog of poses which is 2-3 frames.
+ static constexpr int POSE_QUEUE_SIZE = 8;
dcheng 2016/10/04 23:17:53 Nit: Chromium-style naming for constants is kPoseQ
klausw 2016/10/04 23:56:42 Done, using kPoseRingBufferSize since it's not act
+ gvr::Mat4f webvr_head_pose_[POSE_QUEUE_SIZE];
mthiesse 2016/10/04 21:19:16 Mild preference for std::array, or std::vector ove
dcheng 2016/10/04 23:17:53 It looks like this isn't explicitly initialized, s
klausw 2016/10/04 23:56:42 Done, using std::vector.
klausw 2016/10/04 23:56:42 Good point, added explicit initialization to ident
+ int32_t webvr_newest_pose_num_ = 0;
mthiesse 2016/10/04 21:19:16 Remove unused variable.
klausw 2016/10/04 23:56:42 Done.
base::WeakPtrFactory<VrShell> weak_ptr_factory_;
« 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