Bug 992218 - Don't flag texture clients for reuse if they're actually still being used. r=nical

This commit is contained in:
Kartikaya Gupta 2014-04-25 09:39:20 -04:00
parent e6781c8c31
commit 8907ae425f

View File

@ -485,7 +485,14 @@ TileClient::DiscardBackBuffer()
{
if (mBackBuffer) {
MOZ_ASSERT(mBackLock);
mManager->GetTexturePool(mBackBuffer->GetFormat())->ReturnTextureClient(mBackBuffer);
if (!mBackBuffer->ImplementsLocking() && mBackLock->GetReadCount() > 1) {
// Our current back-buffer is still locked by the compositor. This can occur
// when the client is producing faster than the compositor can consume. In
// this case we just want to drop it and not return it to the pool.
mManager->GetTexturePool(mBackBuffer->GetFormat())->ReportClientLost();
} else {
mManager->GetTexturePool(mBackBuffer->GetFormat())->ReturnTextureClient(mBackBuffer);
}
mBackLock->ReadUnlock();
mBackBuffer = nullptr;
mBackLock = nullptr;