Backed out changeset be88a56c4856 (bug 1197534) for test_BufferingWait.html crashes CLOSED TREE

This commit is contained in:
Wes Kocher 2015-09-14 14:43:52 -07:00
parent 85630f2326
commit 430363411d

View File

@ -53,24 +53,6 @@ TextureClientRecycleAllocator::SetMaxPoolSize(uint32_t aMax)
mMaxPooledSize = aMax;
}
class TextureClientRecycleTask : public Task
{
public:
explicit TextureClientRecycleTask(TextureClient* aClient, TextureFlags aFlags)
: mTextureClient(aClient)
, mFlags(aFlags)
{}
virtual void Run() override
{
mTextureClient->RecycleTexture(mFlags);
}
private:
mozilla::RefPtr<TextureClient> mTextureClient;
TextureFlags mFlags;
};
already_AddRefed<TextureClient>
TextureClientRecycleAllocator::CreateOrRecycle(gfx::SurfaceFormat aFormat,
gfx::IntSize aSize,
@ -92,18 +74,17 @@ TextureClientRecycleAllocator::CreateOrRecycle(gfx::SurfaceFormat aFormat,
if (!mPooledClients.empty()) {
textureHolder = mPooledClients.top();
mPooledClients.pop();
Task* task = nullptr;
// If a pooled TextureClient is not compatible, release it.
if (textureHolder->GetTextureClient()->GetFormat() != aFormat ||
textureHolder->GetTextureClient()->GetSize() != aSize) {
// Release TextureClient.
task = new TextureClientReleaseTask(textureHolder->GetTextureClient());
TextureClientReleaseTask* task = new TextureClientReleaseTask(textureHolder->GetTextureClient());
textureHolder->ClearTextureClient();
textureHolder = nullptr;
// Release TextureClient.
mSurfaceAllocator->GetMessageLoop()->PostTask(FROM_HERE, task);
} else {
task = new TextureClientRecycleTask(textureHolder->GetTextureClient(), aTextureFlags);
textureHolder->GetTextureClient()->RecycleTexture(aTextureFlags);
}
mSurfaceAllocator->GetMessageLoop()->PostTask(FROM_HERE, task);
}
}