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

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

Issue 2541023003: WebVR: Add sanity checks for decoded pose index values (Closed)
Patch Set: Add longer wait, 10 frames was not sufficient. Less verbose vlog. Created 4 years 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 819208f3a6a69719ffa68de93d0b3ab7ba85c498..7c01defe9071803c8dd6de65efdd0fdb2b49925f 100644
--- a/chrome/browser/android/vr_shell/vr_shell.h
+++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -133,6 +133,7 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver {
const std::vector<const ContentRectangle*>& elements);
void DrawCursor(const gvr::Mat4f& render_matrix);
void DrawWebVr();
+ bool WebVrPoseByteIsValid(int pose_index_byte);
void UpdateController(const gvr::Vec3f& forward_vector);
void SendEventsToTarget(VrInputManager* input_target,
@@ -205,6 +206,12 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver {
// current backlog of poses which is 2-3 frames.
static constexpr int kPoseRingBufferSize = 8;
std::vector<gvr::Mat4f> webvr_head_pose_;
+ std::vector<bool> webvr_head_pose_valid_;
+ // Wait for a few seconds of valid poses before reprojecting, see
+ // crbug.com/667327. During this time, content is being drawn, just
+ // without reprojection.
+ static constexpr int webvr_min_valid_poses_ = 60;
mthiesse 2016/12/01 21:53:15 I don't think we should land this min_valid_poses_
klausw 2016/12/01 22:36:04 I've removed it, it's unclear. Got a black screen
+ int webvr_valid_poses_seen_ = 0;
jint webvr_texture_id_ = 0;
std::unique_ptr<VrController> controller_;
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | third_party/WebKit/Source/modules/vr/VRDisplay.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698