mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 897452 - Part 5 - Fix a TextureClient gtest crash - r=BenWa
This commit is contained in:
parent
bffd72633e
commit
067ae770a6
@ -368,8 +368,8 @@ MemoryTextureClient::MemoryTextureClient(CompositableClient* aCompositable,
|
||||
MemoryTextureClient::~MemoryTextureClient()
|
||||
{
|
||||
MOZ_COUNT_DTOR(MemoryTextureClient);
|
||||
if (ShouldDeallocateInDestructor() && mBuffer) {
|
||||
// if the buffer has never been shared we must deallocate it or ir would
|
||||
if (mBuffer && ShouldDeallocateInDestructor()) {
|
||||
// if the buffer has never been shared we must deallocate it or it would
|
||||
// leak.
|
||||
GfxMemoryImageReporter::WillFree(mBuffer);
|
||||
delete mBuffer;
|
||||
|
@ -142,9 +142,6 @@ void TestTextureClientSurface(TextureClient* texture, gfxImageSurface* surface)
|
||||
hostDataSurface->Stride(),
|
||||
SurfaceFormatToImageFormat(hostDataSurface->GetFormat()));
|
||||
AssertSurfacesEqual(surface, hostSurface.get());
|
||||
|
||||
// host deallocation
|
||||
host->DeallocateSharedData();
|
||||
}
|
||||
|
||||
// Same as above, for YCbCr surfaces
|
||||
@ -207,9 +204,6 @@ void TestTextureClientYCbCr(TextureClient* client, PlanarYCbCrData& ycbcrData) {
|
||||
|
||||
AssertYCbCrSurfacesEqual(&ycbcrData, &data);
|
||||
host->Unlock();
|
||||
|
||||
// host deallocation
|
||||
host->DeallocateSharedData();
|
||||
}
|
||||
|
||||
TEST(Layers, TextureSerialization) {
|
||||
@ -228,7 +222,7 @@ TEST(Layers, TextureSerialization) {
|
||||
RefPtr<TextureClient> client
|
||||
= new MemoryTextureClient(nullptr,
|
||||
mozilla::gfx::ImageFormatToSurfaceFormat(surface->Format()),
|
||||
TEXTURE_FLAGS_DEFAULT);
|
||||
TEXTURE_DEALLOCATE_CLIENT);
|
||||
|
||||
TestTextureClientSurface(client, surface);
|
||||
|
||||
@ -264,7 +258,7 @@ TEST(Layers, TextureYCbCrSerialization) {
|
||||
RefPtr<TextureClient> client
|
||||
= new MemoryTextureClient(nullptr,
|
||||
mozilla::gfx::FORMAT_YUV,
|
||||
TEXTURE_FLAGS_DEFAULT);
|
||||
TEXTURE_DEALLOCATE_CLIENT);
|
||||
|
||||
TestTextureClientYCbCr(client, clientData);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user