Commit bcd45085 authored by Kearwood "Kip" Gilbert's avatar Kearwood "Kip" Gilbert
Browse files

Bug 1394561 - Ensure WebVR content can catch up when IPC messages are delayed r=daoshengmu,kanru

MozReview-Commit-ID: F4NKtyaNwEo

--HG--
extra : rebase_source : fb7b2fc51de6b9cf94e6d6bb1837464ec7ea528b
parent c7eb7901
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ VRDisplayHost::NotifyVSync()

void
VRDisplayHost::SubmitFrame(VRLayerParent* aLayer, PTextureParent* aTexture,
                           uint64_t aFrameId,
                           const gfx::Rect& aLeftEyeRect,
                           const gfx::Rect& aRightEyeRect)
{
@@ -173,7 +174,7 @@ VRDisplayHost::SubmitFrame(VRLayerParent* aLayer, PTextureParent* aTexture,
  }

  // Ensure that we only accept the first SubmitFrame call per RAF cycle.
  if (!mFrameStarted) {
  if (!mFrameStarted || aFrameId != mDisplayInfo.mFrameId) {
    return;
  }
  mFrameStarted = false;
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public:
  void StartFrame();
  void SubmitFrame(VRLayerParent* aLayer,
                   mozilla::layers::PTextureParent* aTexture,
                   uint64_t aFrameId,
                   const gfx::Rect& aLeftEyeRect,
                   const gfx::Rect& aRightEyeRect);

+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ VRDisplayPresentation::~VRDisplayPresentation()
void VRDisplayPresentation::SubmitFrame()
{
  for (VRLayerChild *layer : mLayers) {
    layer->SubmitFrame();
    layer->SubmitFrame(mDisplayClient->GetDisplayInfo().GetFrameId());
    break; // Currently only one layer supported, submit only the first
  }
}
+2 −1
Original line number Diff line number Diff line
@@ -345,6 +345,7 @@ VRManager::GetDisplay(const uint32_t& aDisplayID)

void
VRManager::SubmitFrame(VRLayerParent* aLayer, layers::PTextureParent* aTexture,
                       uint64_t aFrameId,
                       const gfx::Rect& aLeftEyeRect,
                       const gfx::Rect& aRightEyeRect)
{
@@ -352,7 +353,7 @@ VRManager::SubmitFrame(VRLayerParent* aLayer, layers::PTextureParent* aTexture,
  mLastFrame = th;
  RefPtr<VRDisplayHost> display = GetDisplay(aLayer->GetDisplayID());
  if (display) {
    display->SubmitFrame(aLayer, aTexture, aLeftEyeRect, aRightEyeRect);
    display->SubmitFrame(aLayer, aTexture, aFrameId, aLeftEyeRect, aRightEyeRect);
  }
}

+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public:
  void GetVRDisplayInfo(nsTArray<VRDisplayInfo>& aDisplayInfo);

  void SubmitFrame(VRLayerParent* aLayer, layers::PTextureParent* aTexture,
                   uint64_t aFrameId,
                   const gfx::Rect& aLeftEyeRect,
                   const gfx::Rect& aRightEyeRect);
  RefPtr<gfx::VRControllerHost> GetController(const uint32_t& aControllerID);
Loading