Bug 1256693 - Refer to ClientIPCAllocator instead of ISurfaceAllocator where it makes sense. r=sotaro

This commit is contained in:
Nicolas Silva
2016-03-21 15:18:20 +01:00
parent 329b5544c1
commit 000ef2da39
39 changed files with 141 additions and 142 deletions

View File

@@ -73,7 +73,7 @@ struct TextureDeallocParams
{
TextureData* data;
RefPtr<TextureChild> actor;
RefPtr<ISurfaceAllocator> allocator;
RefPtr<ClientIPCAllocator> allocator;
bool clientDeallocation;
bool syncDeallocation;
bool workAroundSharedSurfaceOwnershipIssue;
@@ -144,7 +144,7 @@ public:
CompositableForwarder* GetForwarder() { return mForwarder; }
ISurfaceAllocator* GetAllocator() { return mForwarder; }
ClientIPCAllocator* GetAllocator() { return mForwarder; }
void ActorDestroy(ActorDestroyReason why) override;
@@ -189,7 +189,7 @@ private:
};
static void DestroyTextureData(TextureData* aTextureData, ISurfaceAllocator* aAllocator,
static void DestroyTextureData(TextureData* aTextureData, ClientIPCAllocator* aAllocator,
bool aDeallocate, bool aMainThreadOnly)
{
if (!aTextureData) {
@@ -197,7 +197,7 @@ static void DestroyTextureData(TextureData* aTextureData, ISurfaceAllocator* aAl
}
if (aMainThreadOnly && !NS_IsMainThread()) {
RefPtr<ISurfaceAllocator> allocatorRef = aAllocator;
RefPtr<ClientIPCAllocator> allocatorRef = aAllocator;
NS_DispatchToMainThread(NS_NewRunnableFunction([aTextureData, allocatorRef, aDeallocate]() -> void {
DestroyTextureData(aTextureData, allocatorRef, aDeallocate, true);
}));
@@ -283,7 +283,7 @@ DeallocateTextureClient(TextureDeallocParams params)
if (!ipdlMsgLoop) {
// If we don't have a message loop we can't know for sure that we are in
// the IPDL thread and use the ISurfaceAllocator.
// the IPDL thread and use the ClientIPCAllocator.
// This should ideally not happen outside of gtest, but some shutdown raciness
// could put us in this situation.
params.allocator = nullptr;
@@ -831,7 +831,7 @@ TextureClient::CreateForDrawing(CompositableForwarder* aAllocator,
// static
already_AddRefed<TextureClient>
TextureClient::CreateForRawBufferAccess(ISurfaceAllocator* aAllocator,
TextureClient::CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
gfx::SurfaceFormat aFormat,
gfx::IntSize aSize,
gfx::BackendType aMoz2DBackend,
@@ -864,7 +864,7 @@ TextureClient::CreateForRawBufferAccess(ISurfaceAllocator* aAllocator,
// static
already_AddRefed<TextureClient>
TextureClient::CreateForYCbCr(ISurfaceAllocator* aAllocator,
TextureClient::CreateForYCbCr(ClientIPCAllocator* aAllocator,
gfx::IntSize aYSize,
gfx::IntSize aCbCrSize,
StereoMode aStereoMode,
@@ -891,7 +891,7 @@ TextureClient::CreateForYCbCr(ISurfaceAllocator* aAllocator,
// static
already_AddRefed<TextureClient>
TextureClient::CreateForYCbCrWithBufferSize(ISurfaceAllocator* aAllocator,
TextureClient::CreateForYCbCrWithBufferSize(ClientIPCAllocator* aAllocator,
gfx::SurfaceFormat aFormat,
size_t aSize,
TextureFlags aTextureFlags)
@@ -912,7 +912,7 @@ TextureClient::CreateForYCbCrWithBufferSize(ISurfaceAllocator* aAllocator,
return MakeAndAddRef<TextureClient>(data, aTextureFlags, aAllocator);
}
TextureClient::TextureClient(TextureData* aData, TextureFlags aFlags, ISurfaceAllocator* aAllocator)
TextureClient::TextureClient(TextureData* aData, TextureFlags aFlags, ClientIPCAllocator* aAllocator)
: mAllocator(aAllocator)
, mActor(nullptr)
, mData(aData)
@@ -1074,7 +1074,7 @@ SyncObject::CreateSyncObject(SyncHandle aHandle)
}
already_AddRefed<TextureClient>
TextureClient::CreateWithData(TextureData* aData, TextureFlags aFlags, ISurfaceAllocator* aAllocator)
TextureClient::CreateWithData(TextureData* aData, TextureFlags aFlags, ClientIPCAllocator* aAllocator)
{
if (!aData) {
return nullptr;