зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset c1559b3712f2 (bug 1309988) for causing merge conflicts with m-c/autoland
--HG-- extra : rebase_source : e747785b847c7016340f17eccea36eaa43b1aa84
This commit is contained in:
Родитель
5fa2daa9c4
Коммит
9187572fe4
|
@ -68,7 +68,7 @@ VRDisplayHost::RemoveLayer(VRLayerParent *aLayer)
|
|||
#if defined(XP_WIN)
|
||||
|
||||
void
|
||||
VRDisplayHost::SubmitFrame(VRLayerParent* aLayer, const uint32_t& aInputFrameID,
|
||||
VRDisplayHost::SubmitFrame(VRLayerParent* aLayer, const int32_t& aInputFrameID,
|
||||
PTextureParent* aTexture, const gfx::Rect& aLeftEyeRect,
|
||||
const gfx::Rect& aRightEyeRect)
|
||||
{
|
||||
|
@ -78,10 +78,15 @@ VRDisplayHost::SubmitFrame(VRLayerParent* aLayer, const uint32_t& aInputFrameID,
|
|||
// us to build browser UX that remains responsive even when content does
|
||||
// not consistently submit frames.
|
||||
|
||||
uint32_t inputFrameID = aInputFrameID;
|
||||
int32_t inputFrameID = aInputFrameID;
|
||||
if (inputFrameID == 0) {
|
||||
inputFrameID = mInputFrameID;
|
||||
}
|
||||
if (inputFrameID < 0) {
|
||||
// Sanity check to prevent invalid memory access on builds with assertions
|
||||
// disabled.
|
||||
inputFrameID = 0;
|
||||
}
|
||||
|
||||
VRHMDSensorState sensorState = mLastSensorState[inputFrameID % kMaxLatencyFrames];
|
||||
// It is possible to get a cache miss on mLastSensorState if latency is
|
||||
|
@ -121,7 +126,7 @@ VRDisplayHost::SubmitFrame(VRLayerParent* aLayer, const uint32_t& aInputFrameID,
|
|||
#else
|
||||
|
||||
void
|
||||
VRDisplayHost::SubmitFrame(VRLayerParent* aLayer, const uint32_t& aInputFrameID,
|
||||
VRDisplayHost::SubmitFrame(VRLayerParent* aLayer, const int32_t& aInputFrameID,
|
||||
PTextureParent* aTexture, const gfx::Rect& aLeftEyeRect,
|
||||
const gfx::Rect& aRightEyeRect)
|
||||
{
|
||||
|
@ -150,4 +155,4 @@ VRControllerHost::VRControllerHost(VRDeviceType aType)
|
|||
VRControllerHost::~VRControllerHost()
|
||||
{
|
||||
MOZ_COUNT_DTOR(VRControllerHost);
|
||||
}
|
||||
}
|
|
@ -44,7 +44,7 @@ public:
|
|||
virtual void NotifyVSync() { };
|
||||
|
||||
void SubmitFrame(VRLayerParent* aLayer,
|
||||
const uint32_t& aInputFrameID,
|
||||
const int32_t& aInputFrameID,
|
||||
mozilla::layers::PTextureParent* aTexture,
|
||||
const gfx::Rect& aLeftEyeRect,
|
||||
const gfx::Rect& aRightEyeRect);
|
||||
|
@ -77,7 +77,7 @@ protected:
|
|||
// conservative value.
|
||||
static const int kMaxLatencyFrames = 100;
|
||||
VRHMDSensorState mLastSensorState[kMaxLatencyFrames];
|
||||
uint32_t mInputFrameID;
|
||||
int32_t mInputFrameID;
|
||||
|
||||
private:
|
||||
VRDisplayInfo mLastUpdateDisplayInfo;
|
||||
|
|
|
@ -178,7 +178,7 @@ struct VRDisplayInfo
|
|||
|
||||
struct VRHMDSensorState {
|
||||
double timestamp;
|
||||
uint32_t inputFrameID;
|
||||
int32_t inputFrameID;
|
||||
VRDisplayCapabilityFlags flags;
|
||||
float orientation[4];
|
||||
float position[3];
|
||||
|
|
|
@ -40,7 +40,7 @@ VRManagerChild::VRManagerChild()
|
|||
: TextureForwarder()
|
||||
, mDisplaysInitialized(false)
|
||||
, mGamepadManager(nullptr)
|
||||
, mInputFrameID(0)
|
||||
, mInputFrameID(-1)
|
||||
, mMessageLoop(MessageLoop::current())
|
||||
, mFrameRequestCallbackCounter(0)
|
||||
, mBackend(layers::LayersBackend::LAYERS_NONE)
|
||||
|
@ -306,7 +306,7 @@ VRManagerChild::RefreshVRDisplaysWithCallback(dom::Navigator* aNavigator)
|
|||
return success;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
int
|
||||
VRManagerChild::GetInputFrameID()
|
||||
{
|
||||
return mInputFrameID;
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
// Indicate that an observer should no longer receive VR events.
|
||||
void RemoveListener(dom::VREventObserver* aObserver);
|
||||
|
||||
uint32_t GetInputFrameID();
|
||||
int GetInputFrameID();
|
||||
bool GetVRDisplays(nsTArray<RefPtr<VRDisplayClient> >& aDisplays);
|
||||
bool RefreshVRDisplaysWithCallback(dom::Navigator* aNavigator);
|
||||
|
||||
|
@ -157,7 +157,7 @@ private:
|
|||
nsTArray<dom::Navigator*> mNavigatorCallbacks;
|
||||
dom::GamepadManager* mGamepadManager;
|
||||
|
||||
uint32_t mInputFrameID;
|
||||
int32_t mInputFrameID;
|
||||
|
||||
MessageLoop* mMessageLoop;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче