mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1400407 - Part 1: Cleanup WebVR dead code,r=daoshengmu,r=jgilbert
- VRManagerChild no longer needs to be a TextureForwarder - VRManagerParent no longer descends from HostIPCAllocator or ShmemAllocator - PVRManager no longer manages PTexture's - VRLayerParent::mSize was not used and has been removed MozReview-Commit-ID: 3bNN5FR5j7M --HG-- extra : rebase_source : 634277825c00057bca6f8c77cdc942de61d61e9c
This commit is contained in:
parent
2755938ad8
commit
07bf2f8968
@ -323,12 +323,7 @@ SurfaceFactory::NewTexClient(const gfx::IntSize& size, const layers::LayersIPCCh
|
||||
mRecycleFreePool.pop();
|
||||
|
||||
if (cur->Surf()->mSize == size){
|
||||
// In the general case, textureClients transit textures through
|
||||
// CompositorForwarder. But, the textureClient created by VRManagerChild
|
||||
// has a different LayerIPCChannel, PVRManager. Therefore, textureClients
|
||||
// need to be separated into different cases.
|
||||
if ((aLayersChannel && aLayersChannel == cur->GetAllocator()) ||
|
||||
(cur->GetAllocator() != gfx::VRManagerChild::Get())) {
|
||||
if (aLayersChannel && aLayersChannel == cur->GetAllocator()) {
|
||||
cur->Surf()->WaitForBufferOwnership();
|
||||
return cur.forget();
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ include LayersSurfaces;
|
||||
include protocol PLayerTransaction;
|
||||
include protocol PCompositorBridge;
|
||||
include protocol PImageBridge;
|
||||
include protocol PVRManager;
|
||||
include protocol PVideoBridge;
|
||||
include "mozilla/GfxMessageUtils.h";
|
||||
include "mozilla/layers/LayersMessageUtils.h";
|
||||
@ -24,7 +23,7 @@ namespace layers {
|
||||
* PTexture is the IPDL glue between a TextureClient and a TextureHost.
|
||||
*/
|
||||
sync protocol PTexture {
|
||||
manager PImageBridge or PCompositorBridge or PVRManager or PVideoBridge;
|
||||
manager PImageBridge or PCompositorBridge or PVideoBridge;
|
||||
|
||||
child:
|
||||
async __delete__();
|
||||
|
@ -6,7 +6,6 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
include LayersSurfaces;
|
||||
include protocol PTexture;
|
||||
include protocol PVRLayer;
|
||||
include LayersMessages;
|
||||
include GamepadEventTypes;
|
||||
@ -33,13 +32,9 @@ namespace gfx {
|
||||
*/
|
||||
sync protocol PVRManager
|
||||
{
|
||||
manages PTexture;
|
||||
manages PVRLayer;
|
||||
|
||||
parent:
|
||||
async PTexture(SurfaceDescriptor aSharedData, LayersBackend aBackend,
|
||||
TextureFlags aTextureFlags, uint64_t aSerial);
|
||||
|
||||
async PVRLayer(uint32_t aDisplayID, uint32_t aGroup);
|
||||
|
||||
// (Re)Enumerate VR Displays. An updated list of VR displays will be returned
|
||||
|
@ -36,7 +36,6 @@ protected:
|
||||
bool mIPCOpen;
|
||||
|
||||
uint32_t mVRDisplayID;
|
||||
gfx::IntSize mSize;
|
||||
gfx::Rect mLeftEyeRect;
|
||||
gfx::Rect mRightEyeRect;
|
||||
uint32_t mGroup;
|
||||
|
@ -39,8 +39,7 @@ void ReleaseVRManagerParentSingleton() {
|
||||
}
|
||||
|
||||
VRManagerChild::VRManagerChild()
|
||||
: TextureForwarder()
|
||||
, mDisplaysInitialized(false)
|
||||
: mDisplaysInitialized(false)
|
||||
, mMessageLoop(MessageLoop::current())
|
||||
, mFrameRequestCallbackCounter(0)
|
||||
, mBackend(layers::LayersBackend::LAYERS_NONE)
|
||||
@ -167,21 +166,6 @@ VRManagerChild::Destroy()
|
||||
NewRunnableFunction(DeferredDestroy, selfRef));
|
||||
}
|
||||
|
||||
layers::PTextureChild*
|
||||
VRManagerChild::AllocPTextureChild(const SurfaceDescriptor&,
|
||||
const LayersBackend&,
|
||||
const TextureFlags&,
|
||||
const uint64_t&)
|
||||
{
|
||||
return TextureClient::CreateIPDLActor();
|
||||
}
|
||||
|
||||
bool
|
||||
VRManagerChild::DeallocPTextureChild(PTextureChild* actor)
|
||||
{
|
||||
return TextureClient::DestroyIPDLActor(actor);
|
||||
}
|
||||
|
||||
PVRLayerChild*
|
||||
VRManagerChild::AllocPVRLayerChild(const uint32_t& aDisplayID,
|
||||
const uint32_t& aGroup)
|
||||
@ -334,27 +318,6 @@ VRManagerChild::RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageData>
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
PTextureChild*
|
||||
VRManagerChild::CreateTexture(const SurfaceDescriptor& aSharedData,
|
||||
LayersBackend aLayersBackend,
|
||||
TextureFlags aFlags,
|
||||
uint64_t aSerial,
|
||||
wr::MaybeExternalImageId& aExternalImageId,
|
||||
nsIEventTarget* aTarget)
|
||||
{
|
||||
return SendPTextureConstructor(aSharedData, aLayersBackend, aFlags, aSerial);
|
||||
}
|
||||
|
||||
void
|
||||
VRManagerChild::CancelWaitForRecycle(uint64_t aTextureId)
|
||||
{
|
||||
RefPtr<TextureClient> client = mTexturesWaitingRecycled.Get(aTextureId);
|
||||
if (!client) {
|
||||
return;
|
||||
}
|
||||
mTexturesWaitingRecycled.Remove(aTextureId);
|
||||
}
|
||||
|
||||
void
|
||||
VRManagerChild::NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId)
|
||||
{
|
||||
@ -365,28 +328,6 @@ VRManagerChild::NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId)
|
||||
mTexturesWaitingRecycled.Remove(aTextureId);
|
||||
}
|
||||
|
||||
bool
|
||||
VRManagerChild::AllocShmem(size_t aSize,
|
||||
ipc::SharedMemory::SharedMemoryType aType,
|
||||
ipc::Shmem* aShmem)
|
||||
{
|
||||
return PVRManagerChild::AllocShmem(aSize, aType, aShmem);
|
||||
}
|
||||
|
||||
bool
|
||||
VRManagerChild::AllocUnsafeShmem(size_t aSize,
|
||||
ipc::SharedMemory::SharedMemoryType aType,
|
||||
ipc::Shmem* aShmem)
|
||||
{
|
||||
return PVRManagerChild::AllocUnsafeShmem(aSize, aType, aShmem);
|
||||
}
|
||||
|
||||
bool
|
||||
VRManagerChild::DeallocShmem(ipc::Shmem& aShmem)
|
||||
{
|
||||
return PVRManagerChild::DeallocShmem(aShmem);
|
||||
}
|
||||
|
||||
PVRLayerChild*
|
||||
VRManagerChild::CreateVRLayer(uint32_t aDisplayID,
|
||||
nsIEventTarget* aTarget,
|
||||
|
@ -33,14 +33,9 @@ class VRLayerChild;
|
||||
class VRDisplayClient;
|
||||
|
||||
class VRManagerChild : public PVRManagerChild
|
||||
, public layers::TextureForwarder
|
||||
, public layers::KnowsCompositor
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VRManagerChild, override);
|
||||
|
||||
TextureForwarder* GetTextureForwarder() override { return this; }
|
||||
LayersIPCActor* GetLayersIPCActor() override { return this; }
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VRManagerChild);
|
||||
|
||||
static VRManagerChild* Get();
|
||||
|
||||
@ -64,15 +59,6 @@ public:
|
||||
|
||||
static bool IsCreated();
|
||||
|
||||
virtual PTextureChild* CreateTexture(
|
||||
const SurfaceDescriptor& aSharedData,
|
||||
layers::LayersBackend aLayersBackend,
|
||||
TextureFlags aFlags,
|
||||
uint64_t aSerial,
|
||||
wr::MaybeExternalImageId& aExternalImageId,
|
||||
nsIEventTarget* aTarget = nullptr) override;
|
||||
virtual void CancelWaitForRecycle(uint64_t aTextureId) override;
|
||||
|
||||
PVRLayerChild* CreateVRLayer(uint32_t aDisplayID,
|
||||
nsIEventTarget* aTarget,
|
||||
uint32_t aGroup);
|
||||
@ -81,9 +67,6 @@ public:
|
||||
layers::LayersBackend GetBackendType() const;
|
||||
layers::SyncObjectClient* GetSyncObject() { return mSyncObject; }
|
||||
|
||||
virtual MessageLoop* GetMessageLoop() const override { return mMessageLoop; }
|
||||
virtual base::ProcessId GetParentPid() const override { return OtherPid(); }
|
||||
|
||||
nsresult ScheduleFrameRequestCallback(mozilla::dom::FrameRequestCallback& aCallback,
|
||||
int32_t *aHandle);
|
||||
void CancelFrameRequestCallback(int32_t aHandle);
|
||||
@ -104,12 +87,6 @@ protected:
|
||||
void Destroy();
|
||||
static void DeferredDestroy(RefPtr<VRManagerChild> aVRManagerChild);
|
||||
|
||||
virtual PTextureChild* AllocPTextureChild(const SurfaceDescriptor& aSharedData,
|
||||
const layers::LayersBackend& aLayersBackend,
|
||||
const TextureFlags& aFlags,
|
||||
const uint64_t& aSerial) override;
|
||||
virtual bool DeallocPTextureChild(PTextureChild* actor) override;
|
||||
|
||||
virtual PVRLayerChild* AllocPVRLayerChild(const uint32_t& aDisplayID,
|
||||
const uint32_t& aGroup) override;
|
||||
virtual bool DeallocPVRLayerChild(PVRLayerChild* actor) override;
|
||||
@ -128,26 +105,10 @@ protected:
|
||||
virtual mozilla::ipc::IPCResult RecvReplyCreateVRServiceTestController(const nsCString& aID,
|
||||
const uint32_t& aPromiseID,
|
||||
const uint32_t& aDeviceID) override;
|
||||
|
||||
// ShmemAllocator
|
||||
|
||||
virtual bool AllocShmem(size_t aSize,
|
||||
ipc::SharedMemory::SharedMemoryType aType,
|
||||
ipc::Shmem* aShmem) override;
|
||||
|
||||
virtual bool AllocUnsafeShmem(size_t aSize,
|
||||
ipc::SharedMemory::SharedMemoryType aType,
|
||||
ipc::Shmem* aShmem) override;
|
||||
|
||||
virtual bool DeallocShmem(ipc::Shmem& aShmem) override;
|
||||
|
||||
virtual bool IsSameProcess() const override
|
||||
bool IsSameProcess() const
|
||||
{
|
||||
return OtherPid() == base::GetCurrentProcId();
|
||||
}
|
||||
|
||||
friend class layers::CompositorBridgeChild;
|
||||
|
||||
private:
|
||||
|
||||
void FireDOMVRDisplayMountedEventInternal(uint32_t aDisplayID);
|
||||
|
@ -21,8 +21,7 @@ using namespace layers;
|
||||
namespace gfx {
|
||||
|
||||
VRManagerParent::VRManagerParent(ProcessId aChildProcessId, bool aIsContentChild)
|
||||
: HostIPCAllocator()
|
||||
, mDisplayTestID(0)
|
||||
: mDisplayTestID(0)
|
||||
, mControllerTestID(0)
|
||||
, mHaveEventListener(false)
|
||||
, mHaveControllerListener(false)
|
||||
@ -41,21 +40,6 @@ VRManagerParent::~VRManagerParent()
|
||||
MOZ_COUNT_DTOR(VRManagerParent);
|
||||
}
|
||||
|
||||
PTextureParent*
|
||||
VRManagerParent::AllocPTextureParent(const SurfaceDescriptor& aSharedData,
|
||||
const LayersBackend& aLayersBackend,
|
||||
const TextureFlags& aFlags,
|
||||
const uint64_t& aSerial)
|
||||
{
|
||||
return layers::TextureHost::CreateIPDLActor(this, aSharedData, aLayersBackend, aFlags, aSerial, Nothing());
|
||||
}
|
||||
|
||||
bool
|
||||
VRManagerParent::DeallocPTextureParent(PTextureParent* actor)
|
||||
{
|
||||
return layers::TextureHost::DestroyIPDLActor(actor);
|
||||
}
|
||||
|
||||
PVRLayerParent*
|
||||
VRManagerParent::AllocPVRLayerParent(const uint32_t& aDisplayID,
|
||||
const uint32_t& aGroup)
|
||||
@ -78,52 +62,12 @@ VRManagerParent::DeallocPVRLayerParent(PVRLayerParent* actor)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
VRManagerParent::AllocShmem(size_t aSize,
|
||||
ipc::SharedMemory::SharedMemoryType aType,
|
||||
ipc::Shmem* aShmem)
|
||||
{
|
||||
return PVRManagerParent::AllocShmem(aSize, aType, aShmem);
|
||||
}
|
||||
|
||||
bool
|
||||
VRManagerParent::AllocUnsafeShmem(size_t aSize,
|
||||
ipc::SharedMemory::SharedMemoryType aType,
|
||||
ipc::Shmem* aShmem)
|
||||
{
|
||||
return PVRManagerParent::AllocUnsafeShmem(aSize, aType, aShmem);
|
||||
}
|
||||
|
||||
void
|
||||
VRManagerParent::DeallocShmem(ipc::Shmem& aShmem)
|
||||
{
|
||||
PVRManagerParent::DeallocShmem(aShmem);
|
||||
}
|
||||
|
||||
bool
|
||||
VRManagerParent::IsSameProcess() const
|
||||
{
|
||||
return OtherPid() == base::GetCurrentProcId();
|
||||
}
|
||||
|
||||
void
|
||||
VRManagerParent::NotifyNotUsed(PTextureParent* aTexture, uint64_t aTransactionId)
|
||||
{
|
||||
MOZ_ASSERT_UNREACHABLE("unexpected to be called");
|
||||
}
|
||||
|
||||
void
|
||||
VRManagerParent::SendAsyncMessage(const InfallibleTArray<AsyncParentMessageData>& aMessage)
|
||||
{
|
||||
MOZ_ASSERT_UNREACHABLE("unexpected to be called");
|
||||
}
|
||||
|
||||
base::ProcessId
|
||||
VRManagerParent::GetChildProcessId()
|
||||
{
|
||||
return OtherPid();
|
||||
}
|
||||
|
||||
void
|
||||
VRManagerParent::RegisterWithManager()
|
||||
{
|
||||
|
@ -28,9 +28,8 @@ class VRControllerPuppet;
|
||||
} // namespace impl
|
||||
|
||||
class VRManagerParent final : public PVRManagerParent
|
||||
, public HostIPCAllocator
|
||||
, public ShmemAllocator
|
||||
{
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VRManagerParent);
|
||||
public:
|
||||
explicit VRManagerParent(ProcessId aChildProcessId, bool aIsContentChild);
|
||||
|
||||
@ -38,40 +37,15 @@ public:
|
||||
static bool CreateForGPUProcess(Endpoint<PVRManagerParent>&& aEndpoint);
|
||||
static bool CreateForContent(Endpoint<PVRManagerParent>&& aEndpoint);
|
||||
|
||||
virtual base::ProcessId GetChildProcessId() override;
|
||||
|
||||
// ShmemAllocator
|
||||
|
||||
virtual ShmemAllocator* AsShmemAllocator() override { return this; }
|
||||
|
||||
virtual bool AllocShmem(size_t aSize,
|
||||
ipc::SharedMemory::SharedMemoryType aType,
|
||||
ipc::Shmem* aShmem) override;
|
||||
|
||||
virtual bool AllocUnsafeShmem(size_t aSize,
|
||||
ipc::SharedMemory::SharedMemoryType aType,
|
||||
ipc::Shmem* aShmem) override;
|
||||
|
||||
virtual void DeallocShmem(ipc::Shmem& aShmem) override;
|
||||
|
||||
virtual bool IsSameProcess() const override;
|
||||
bool IsSameProcess() const;
|
||||
bool HaveEventListener();
|
||||
bool HaveControllerListener();
|
||||
|
||||
virtual void NotifyNotUsed(PTextureParent* aTexture, uint64_t aTransactionId) override;
|
||||
virtual void SendAsyncMessage(const InfallibleTArray<AsyncParentMessageData>& aMessage) override;
|
||||
bool SendGamepadUpdate(const GamepadChangeEvent& aGamepadEvent);
|
||||
bool SendReplyGamepadVibrateHaptic(const uint32_t& aPromiseID);
|
||||
|
||||
protected:
|
||||
~VRManagerParent();
|
||||
|
||||
virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData,
|
||||
const LayersBackend& aLayersBackend,
|
||||
const TextureFlags& aFlags,
|
||||
const uint64_t& aSerial) override;
|
||||
virtual bool DeallocPTextureParent(PTextureParent* actor) override;
|
||||
|
||||
virtual PVRLayerParent* AllocPVRLayerParent(const uint32_t& aDisplayID,
|
||||
const uint32_t& aGroup) override;
|
||||
virtual bool DeallocPVRLayerParent(PVRLayerParent* actor) override;
|
||||
|
Loading…
Reference in New Issue
Block a user