Bug 1402749 - Part 2: Only allow updating VR controller amount at Vsync time; r=kip

MozReview-Commit-ID: EwXpyGnTYTD

--HG--
extra : rebase_source : b969991e31dcb612e81dd47129168a535427ce0a
This commit is contained in:
dmu@mozilla.com 2017-09-29 06:53:27 +00:00
Родитель 92a1d766b1
Коммит e2a5d6b175
3 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,4 @@
# Please confirm there is no other VR display connected. Otherwise, VRPuppetDisplay can't be attached.
[DEFAULT]
support-files =
VRSimulationDriver.js

Просмотреть файл

@ -1,4 +1,5 @@
# WebVR Reftests
# Please confirm there is no other VR display connected. Otherwise, VRPuppetDisplay can't be attached.
default-preferences pref(dom.vr.puppet.enabled,true) pref(dom.vr.test.enabled,true) pref(dom.vr.require-gesture,false) pref(dom.vr.puppet.submitframe,1)
# VR SubmitFrame is only implemented for D3D11.1 and MacOSX now.

Просмотреть файл

@ -279,18 +279,19 @@ VRManagerParent::RecvSetHaveEventListener(const bool& aHaveEventListener)
mozilla::ipc::IPCResult
VRManagerParent::RecvControllerListenerAdded()
{
// Force update the available controllers for GamepadManager,
// remove the existing controllers and sync them by NotifyVsync().
VRManager* vm = VRManager::Get();
vm->RemoveControllers();
mHaveControllerListener = true;
// Ask the connected gamepads to be added to GamepadManager
vm->ScanForControllers();
return IPC_OK();
}
mozilla::ipc::IPCResult
VRManagerParent::RecvControllerListenerRemoved()
{
VRManager* vm = VRManager::Get();
mHaveControllerListener = false;
VRManager* vm = VRManager::Get();
vm->RemoveControllers();
return IPC_OK();
}