mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 04:35:33 +00:00
eb3becc0b0
- Added new chrome-only webidl methods to be used by browser UI and WebExtensions - Implemented bitmasked group visibility for VR sessions to enable switching between chrome and regular content presentations. - Implemented throttling mechanism to avoid runaway, unthrottled render loops for VR sessions that are hidden by group visibility bitmasks or due to lower level platform VR events, such as during the Oculus "Health and Safety Warning". - Simplified the PVRManager IPC protocol while extending it to support VR session groups and later WebVR content performance profiling API's. - Removed the last WebVR related sync IPC call. MozReview-Commit-ID: BMEIPyYeEbq --HG-- extra : rebase_source : 47d3682cad3d913504175b7d4c3e9d992236f097
60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
* 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/. */
|
|
|
|
|
|
#include "VRLayerParent.h"
|
|
#include "mozilla/Unused.h"
|
|
|
|
namespace mozilla {
|
|
namespace gfx {
|
|
|
|
VRLayerParent::VRLayerParent(uint32_t aVRDisplayID, const Rect& aLeftEyeRect, const Rect& aRightEyeRect, const uint32_t aGroup)
|
|
: mIPCOpen(true)
|
|
, mVRDisplayID(aVRDisplayID)
|
|
, mLeftEyeRect(aLeftEyeRect)
|
|
, mRightEyeRect(aRightEyeRect)
|
|
, mGroup(aGroup)
|
|
{
|
|
}
|
|
|
|
VRLayerParent::~VRLayerParent()
|
|
{
|
|
MOZ_COUNT_DTOR(VRLayerParent);
|
|
}
|
|
|
|
mozilla::ipc::IPCResult
|
|
VRLayerParent::RecvDestroy()
|
|
{
|
|
Destroy();
|
|
return IPC_OK();
|
|
}
|
|
|
|
void
|
|
VRLayerParent::ActorDestroy(ActorDestroyReason aWhy)
|
|
{
|
|
mIPCOpen = false;
|
|
}
|
|
|
|
void
|
|
VRLayerParent::Destroy()
|
|
{
|
|
if (mIPCOpen) {
|
|
Unused << PVRLayerParent::Send__delete__(this);
|
|
}
|
|
}
|
|
|
|
mozilla::ipc::IPCResult
|
|
VRLayerParent::RecvSubmitFrame(PTextureParent* texture)
|
|
{
|
|
VRManager* vm = VRManager::Get();
|
|
vm->SubmitFrame(this, texture, mLeftEyeRect, mRightEyeRect);
|
|
|
|
return IPC_OK();
|
|
}
|
|
|
|
|
|
} // namespace gfx
|
|
} // namespace mozilla
|