Bug 1281775 - Make dib textures not rely on accessing a ShadowLayerForwarder. r=gw280

This commit is contained in:
Nicolas Silva 2016-06-29 11:18:35 +02:00
parent 93024c0a86
commit f541fa5146
5 changed files with 9 additions and 3 deletions

View File

@ -281,7 +281,7 @@ DIBTextureData*
ShmemDIBTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
ClientIPCAllocator* aAllocator)
{
MOZ_ASSERT(aAllocator->AsLayerForwarder()->GetParentPid() != base::ProcessId());
MOZ_ASSERT(aAllocator->GetParentPid() != base::ProcessId());
DWORD mapSize = aSize.width * aSize.height * BytesPerPixel(aFormat);
HANDLE fileMapping = ::CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, mapSize, NULL);
@ -343,7 +343,7 @@ ShmemDIBTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
HANDLE hostHandle = NULL;
if (!ipc::DuplicateHandle(fileMapping, aAllocator->AsLayerForwarder()->GetParentPid(),
if (!ipc::DuplicateHandle(fileMapping, aAllocator->GetParentPid(),
&hostHandle, 0, DUPLICATE_SAME_ACCESS)) {
gfxCriticalError() << "Failed to duplicate handle to parent process for surface.";
::DeleteObject(bitmap);

View File

@ -183,6 +183,8 @@ public:
virtual MessageLoop* GetMessageLoop() const override { return mMessageLoop; }
virtual base::ProcessId GetParentPid() const override { return OtherPid(); }
virtual bool AllocUnsafeShmem(size_t aSize,
mozilla::ipc::SharedMemory::SharedMemoryType aShmType,
mozilla::ipc::Shmem* aShmem) override;

View File

@ -127,6 +127,8 @@ public:
virtual ClientIPCAllocator* AsClientAllocator() override { return this; }
virtual base::ProcessId GetParentPid() const = 0;
virtual MessageLoop * GetMessageLoop() const = 0;
virtual int32_t GetMaxTextureSize() const { return gfxPrefs::MaxTextureSize(); }

View File

@ -189,6 +189,8 @@ public:
*/
virtual MessageLoop * GetMessageLoop() const override;
virtual base::ProcessId GetParentPid() const override { return OtherPid(); }
PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo,
PImageContainerChild* aChild, uint64_t* aID) override;
bool DeallocPCompositableChild(PCompositableChild* aActor) override;

View File

@ -356,7 +356,7 @@ public:
virtual void CancelWaitForRecycle(uint64_t aTextureId) override;
base::ProcessId GetParentPid() const;
virtual base::ProcessId GetParentPid() const override;
/**
* Construct a shadow of |aLayer| on the "other side", at the