1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 include LayersSurfaces;
9 include protocol PVRLayer;
10 include LayersMessages;
11 include GamepadEventTypes;
13 include "VRMessageUtils.h";
14 include "VRManagerParent.h";
15 include "VRManagerChild.h";
17 using struct mozilla::gfx::VRFieldOfView from "gfxVR.h";
18 using struct mozilla::gfx::VRDisplayInfo from "gfxVR.h";
19 using struct mozilla::gfx::VRSensorUpdate from "gfxVR.h";
20 using struct mozilla::gfx::VRHMDSensorState from "gfxVR.h";
21 using struct mozilla::gfx::VRControllerInfo from "gfxVR.h";
22 using struct mozilla::gfx::VRSubmitFrameResultInfo from "gfxVR.h";
23 using mozilla::gfx::VRDisplayCapabilityFlags from "moz_external_vr.h";
24 using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
25 using mozilla::layers::TextureFlags from "mozilla/layers/CompositorTypes.h";
26 using mozilla::dom::GamepadHandle from "mozilla/dom/GamepadHandle.h";
33 * The PVRManager protocol is used to enable communication of VR display
34 * enumeration and sensor state between the compositor thread and
35 * content threads/processes.
37 [NeedsOtherPid, ChildImpl="VRManagerChild", ParentImpl="VRManagerParent", ParentProc=compositor, ChildProc=anydom]
38 sync protocol PVRManager
43 async PVRLayer(uint32_t aDisplayID, uint32_t aGroup);
45 // Detect runtime capabilities. This will return the presense of VR and/or AR
46 // runtime software, without enumerating or activating any hardware devices.
47 async DetectRuntimes();
49 // (Re)Enumerate VR Displays. An updated list of VR displays will be returned
50 // asynchronously to children via UpdateDisplayInfo.
51 async RefreshDisplays();
53 async SetGroupMask(uint32_t aDisplayID, uint32_t aGroupMask);
54 async SetHaveEventListener(bool aHaveEventListener);
56 async ControllerListenerAdded();
57 async ControllerListenerRemoved();
58 async VibrateHaptic(GamepadHandle aGamepadHandle, uint32_t aHapticIndex,
59 double aIntensity, double aDuration, uint32_t aPromiseID);
60 async StopVibrateHaptic(GamepadHandle aGamepadHandle);
61 async StartVRNavigation(uint32_t aDeviceID);
62 async StopVRNavigation(uint32_t aDeviceID, TimeDuration aDuration);
63 async StartActivity();
66 async RunPuppet(uint64_t[] buffer);
70 // Notify children of updated VR display enumeration and details. This will
71 // be sent to all children when the parent receives RefreshDisplays, even
72 // if no changes have been detected. This ensures that Promises exposed
73 // through DOM calls are always resolved.
74 async UpdateDisplayInfo(VRDisplayInfo aDisplayInfo);
76 async UpdateRuntimeCapabilities(VRDisplayCapabilityFlags aCapabilities);
78 async ReplyGamepadVibrateHaptic(uint32_t aPromiseID);
79 async NotifyPuppetCommandBufferCompleted(bool aSuccess);
80 async NotifyPuppetResetComplete();