gecko-dev/gfx/vr/ipc/VRManagerChild.h
kearwood d2f423667c Bug 1237689 - Enable Oculus hardware latency tester r=daoshengmu
- Generate and pass sequential frame indexes into the ovr_GetTrackingState call and the corresponding call to ovr_SubmitFrame

MozReview-Commit-ID: 5tJl5YJt7Eo

--HG--
extra : rebase_source : 5dbb35ea1451a9f378e28d81a8704b63b1b72b4d
2016-01-08 18:50:10 -08:00

62 lines
1.7 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=8 et :
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_GFX_VR_VRMANAGERCHILD_H
#define MOZILLA_GFX_VR_VRMANAGERCHILD_H
#include "mozilla/gfx/PVRManagerChild.h"
#include "ThreadSafeRefcountingWithMainThreadDestruction.h"
namespace mozilla {
namespace dom {
class Navigator;
class VRDevice;
} // namespace dom
namespace gfx {
class VRDeviceProxy;
class VRManagerChild : public PVRManagerChild
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(VRManagerChild)
int GetInputFrameID();
bool GetVRDevices(nsTArray<RefPtr<VRDeviceProxy> >& aDevices);
bool RefreshVRDevicesWithCallback(dom::Navigator* aNavigator);
static VRManagerChild* StartUpInChildProcess(Transport* aTransport,
ProcessId aOtherProcess);
static void StartUpSameProcess();
static void ShutDown();
static VRManagerChild* Get();
protected:
explicit VRManagerChild();
~VRManagerChild();
void Destroy();
static void DeferredDestroy(RefPtr<VRManagerChild> aVRManagerChild);
virtual bool RecvUpdateDeviceInfo(nsTArray<VRDeviceUpdate>&& aDeviceUpdates) override;
virtual bool RecvUpdateDeviceSensors(nsTArray<VRSensorUpdate>&& aDeviceSensorUpdates) override;
friend class layers::CompositorChild;
private:
nsTArray<RefPtr<VRDeviceProxy> > mDevices;
nsTArray<dom::Navigator*> mNavigatorCallbacks;
int32_t mInputFrameID;
};
} // namespace mozilla
} // namespace gfx
#endif // MOZILLA_GFX_VR_VRMANAGERCHILD_H