Bug 992218 - Don't flag texture clients for reuse if they're actually still being used. r=nical
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 25 Apr 2014 09:39:20 -0400
changeset 199709 a0fb78183db0df06d7c1354f307ae96506d0c761
parent 199708 949b53bb379cb3dc62c4858327ec0874fb4867e4
child 199710 bc6ddc5dc31af1f5b0aeb56bb39030611f7a3767
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs992218
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 992218 - Don't flag texture clients for reuse if they're actually still being used. r=nical
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -480,17 +480,24 @@ TileClient::DiscardFrontBuffer()
   }
 }
 
 void
 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;
   }
 }
 
 TextureClient*
 TileClient::GetBackBuffer(const nsIntRegion& aDirtyRegion, TextureClientPool *aPool, bool *aCreatedTextureClient, bool aCanRerasterizeValidRegion)