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

Unified Diff: device/vr/android/gvr/gvr_device.cc

Issue 2384593002: Encode frame number in pixel data for pose sync (Closed)
Patch Set: Frame pose sync: fix oscillating off-by-one Created 4 years, 3 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: device/vr/android/gvr/gvr_device.cc
diff --git a/device/vr/android/gvr/gvr_device.cc b/device/vr/android/gvr/gvr_device.cc
index 787dc0cba70c83f04670e74725a79cc109eef8c9..36ebdc73921a76b89109ab023386636611f8173f 100644
--- a/device/vr/android/gvr/gvr_device.cc
+++ b/device/vr/android/gvr/gvr_device.cc
@@ -130,6 +130,11 @@ VRDisplayPtr GvrDevice::GetVRDevice() {
VRPosePtr GvrDevice::GetPose() {
TRACE_EVENT0("input", "GvrDevice::GetSensorState");
+ // Increment pose frame counter always, even if it's a faked pose.
+ // This must stay in sync with the m_poseNum counter in
+ // third_party/WebKit/Source/modules/vr/VRDisplay.cpp.
+ ++frameNumStarted_;
+
VRPosePtr pose = VRPose::New();
pose->timestamp = base::Time::Now().ToJsTime();
@@ -176,6 +181,9 @@ VRPosePtr GvrDevice::GetPose() {
pose->position[2] = decomposed_transform.translate[2];
}
+ // LOG << "klausw:GvrDevice::GetPose " << frameNumStarted_;
+ delegate_->SetGvrPoseForWebVr(head_mat, frameNumStarted_);
+
return pose;
}

Powered by Google App Engine
This is Rietveld 408576698