mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset be88a56c4856 (bug 1197534) for test_BufferingWait.html crashes CLOSED TREE
This commit is contained in:
parent
85630f2326
commit
430363411d
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user