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

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

Issue 2384593002: Encode frame number in pixel data for pose sync (Closed)
Patch Set: bajones #40: add sanity check + pointer zeroing 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
« no previous file with comments | « device/vr/android/gvr/gvr_device.h ('k') | device/vr/android/gvr/gvr_device_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9238409817038e7f9ada4174f54f00923ae0bab6 100644
--- a/device/vr/android/gvr/gvr_device.cc
+++ b/device/vr/android/gvr/gvr_device.cc
@@ -134,6 +134,9 @@ VRPosePtr GvrDevice::GetPose() {
pose->timestamp = base::Time::Now().ToJsTime();
+ // Increment pose frame counter always, even if it's a faked pose.
+ pose->poseIndex = ++pose_index_;
+
pose->orientation = mojo::Array<float>::New(4);
gvr::GvrApi* gvr_api = GetGvrApi();
@@ -176,6 +179,10 @@ VRPosePtr GvrDevice::GetPose() {
pose->position[2] = decomposed_transform.translate[2];
}
+ // Save the underlying GVR pose for use by rendering. It can't use a
+ // VRPosePtr since that's a different data type.
+ delegate_->SetGvrPoseForWebVr(head_mat, pose_index_);
+
return pose;
}
« no previous file with comments | « device/vr/android/gvr/gvr_device.h ('k') | device/vr/android/gvr/gvr_device_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698