Bug 944703 - Part 3: make TextureHost hold a strong reference to its ISurfaceAllocator - r=nical

This commit is contained in:
Benoit Jacob 2013-12-03 13:44:38 -05:00
parent 9a9e188f86
commit 5139f05917
2 changed files with 10 additions and 13 deletions

View File

@ -261,11 +261,13 @@ DeprecatedTextureHost::PrintInfo(nsACString& aTo, const char* aPrefix)
AppendToString(aTo, mFlags, " [flags=", "]");
}
void
DeprecatedTextureHost::SetBuffer(SurfaceDescriptor* aBuffer, ISurfaceAllocator* aAllocator)
{
MOZ_ASSERT(!mBuffer || mBuffer == aBuffer, "Will leak the old mBuffer");
mBuffer = aBuffer;
mDeAllocator = aAllocator;
}
BufferTextureHost::BufferTextureHost(uint64_t aID,
gfx::SurfaceFormat aFormat,

View File

@ -488,7 +488,7 @@ public:
protected:
mozilla::ipc::Shmem* mShmem;
ISurfaceAllocator* mDeallocator;
RefPtr<ISurfaceAllocator> mDeallocator;
};
/**
@ -705,12 +705,7 @@ public:
*/
// only made virtual to allow overriding in GrallocDeprecatedTextureHostOGL, for hacky fix in gecko 23 for bug 862324.
// see bug 865908 about fixing this.
virtual void SetBuffer(SurfaceDescriptor* aBuffer, ISurfaceAllocator* aAllocator)
{
MOZ_ASSERT(!mBuffer || mBuffer == aBuffer, "Will leak the old mBuffer");
mBuffer = aBuffer;
mDeAllocator = aAllocator;
}
virtual void SetBuffer(SurfaceDescriptor* aBuffer, ISurfaceAllocator* aAllocator);
// used only for hacky fix in gecko 23 for bug 862324
// see bug 865908 about fixing this.
@ -762,7 +757,7 @@ protected:
// which can go away under our feet at any time. This is the cause
// of bug 862324 among others. Our current understanding is that
// this will be gone in Gecko 24. See bug 858914.
ISurfaceAllocator* mDeAllocator;
RefPtr<ISurfaceAllocator> mDeAllocator;
gfx::SurfaceFormat mFormat;
};