From 627c745c53e83f65393dd9f369d15fa127b3b6a1 Mon Sep 17 00:00:00 2001 From: kearwood Date: Fri, 2 Sep 2016 14:45:54 -0700 Subject: [PATCH] Bug 1288193 - Ensure that the content process receives the presentation status of a VRDisplay immediately after adding or removing layers r=gw280 - Corrects issues with the onvrdisplaypresentationchange events being delayed by up to 5 seconds. - Caused a delay to enter or exit WebVR presentation on many sites. MozReview-Commit-ID: 2LACZNwKIxW --HG-- extra : rebase_source : ec689cd68422a8487a85e70d9e2dbb13b3a1c36c --- gfx/vr/VRDisplayHost.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gfx/vr/VRDisplayHost.cpp b/gfx/vr/VRDisplayHost.cpp index 38504fdd2932..68746e4e413b 100644 --- a/gfx/vr/VRDisplayHost.cpp +++ b/gfx/vr/VRDisplayHost.cpp @@ -45,6 +45,10 @@ VRDisplayHost::AddLayer(VRLayerParent *aLayer) StartPresentation(); } mDisplayInfo.mIsPresenting = mLayers.Length() > 0; + + // Ensure that the content process receives the change immediately + VRManager* vm = VRManager::Get(); + vm->RefreshVRDisplays(); } void @@ -55,6 +59,10 @@ VRDisplayHost::RemoveLayer(VRLayerParent *aLayer) StopPresentation(); } mDisplayInfo.mIsPresenting = mLayers.Length() > 0; + + // Ensure that the content process receives the change immediately + VRManager* vm = VRManager::Get(); + vm->RefreshVRDisplays(); } #if defined(XP_WIN)