Bug 1396326 - VRDisplay.getFrameData() now returns false when orientation data is not available. r=daoshengmu, a=ritu
authorKearwood "Kip" Gilbert <kgilbert@mozilla.com>
Wed, 27 Sep 2017 13:54:58 -0700
changeset 432175 b6970100a87abc4169a66766001f9ab93d20452c
parent 432174 53c3484d629196c7ea461cca40df01ce59efa4ba
child 432176 0dd094dc6fd17e38e9bf1bfd92e7237d70b79f00
push id7896
push userryanvm@gmail.com
push dateThu, 05 Oct 2017 00:26:16 +0000
treeherdermozilla-beta@8c7645234f86 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu, ritu
bugs1396326
milestone57.0
Bug 1396326 - VRDisplay.getFrameData() now returns false when orientation data is not available. r=daoshengmu, a=ritu MozReview-Commit-ID: 9XlzeXWOy8U
dom/vr/VRDisplay.cpp
--- a/dom/vr/VRDisplay.cpp
+++ b/dom/vr/VRDisplay.cpp
@@ -435,16 +435,20 @@ VRDisplay::UpdateFrameInfo()
     mFrameInfo.Update(info, state, mDepthNear, mDepthFar);
   }
 }
 
 bool
 VRDisplay::GetFrameData(VRFrameData& aFrameData)
 {
   UpdateFrameInfo();
+  if (!(mFrameInfo.mVRState.flags & gfx::VRDisplayCapabilityFlags::Cap_Orientation)) {
+    // We must have at minimum Cap_Orientation for a valid pose.
+    return false;
+  }
   aFrameData.Update(mFrameInfo);
   return true;
 }
 
 bool
 VRDisplay::GetSubmitFrameResult(VRSubmitFrameResult& aResult)
 {
   if (!mPresentation) {