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; |
} |