Bug 1016538 - Fix unbalanced locking logic in tiling. r=Bas
authorNicolas Silva <nsilva@mozilla.com>
Wed, 27 Aug 2014 16:50:25 +0200
changeset 223611 68b5f7d262d59c2950a8ae16bbab6a2440c86053
parent 223610 9a12ddb46882bb90823ddd2b854fca5f05eff5ef
child 223612 679ea61dc21601cdbd56b46fde96f745216b2b81
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs1016538
milestone34.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 1016538 - Fix unbalanced locking logic in tiling. r=Bas
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -344,16 +344,17 @@ ClientTiledLayerBuffer::GetContentType(S
 gfxMemorySharedReadLock::gfxMemorySharedReadLock()
   : mReadCount(1)
 {
   MOZ_COUNT_CTOR(gfxMemorySharedReadLock);
 }
 
 gfxMemorySharedReadLock::~gfxMemorySharedReadLock()
 {
+  MOZ_ASSERT(mReadCount == 0);
   MOZ_COUNT_DTOR(gfxMemorySharedReadLock);
 }
 
 int32_t
 gfxMemorySharedReadLock::ReadLock()
 {
   NS_ASSERT_OWNINGTHREAD(gfxMemorySharedReadLock);
 
@@ -756,16 +757,21 @@ TileClient::GetBackBuffer(const nsIntReg
       if (mBackBufferOnWhite) {
         pool->ReportClientLost();
       }
     }
     mBackBuffer.Set(this, pool->GetTextureClient());
     if (aMode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
       mBackBufferOnWhite = pool->GetTextureClient();
     }
+
+    if (mBackLock) {
+      // Before we Replacing the lock by another one we need to unlock it!
+      mBackLock->ReadUnlock();
+    }
     // Create a lock for our newly created back-buffer.
     if (mManager->AsShadowForwarder()->IsSameProcess()) {
       // If our compositor is in the same process, we can save some cycles by not
       // using shared memory.
       mBackLock = new gfxMemorySharedReadLock();
     } else {
       mBackLock = new gfxShmSharedReadLock(mManager->AsShadowForwarder());
     }