Bug 1127289 - Add missing synchronization in TiledContentClient with DrawTargetTiled. r=sotaro
authorNicolas Silva <nsilva@mozilla.com>
Fri, 06 Feb 2015 16:05:05 -0500
changeset 245419 7d87dc37c707e896242a5420e29ff19acd0a0a18
parent 245418 3c88c70e1e643dbef30f2b1dfb4f412e4d1be1aa
child 245420 f8ce4cf2e71dfe4094cc893868dccc5c4a055fe0
child 245425 e7468e7abe805091b4eca74287ee3bb0e39ca6e5
push id7677
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 18:11:24 +0000
treeherdermozilla-aurora@f531d838c055 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1127289
milestone38.0a1
Bug 1127289 - Add missing synchronization in TiledContentClient with DrawTargetTiled. r=sotaro CLOSED TREE
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -1086,19 +1086,21 @@ ClientTiledLayerBuffer::PostValidate(con
 }
 
 void
 ClientTiledLayerBuffer::UnlockTile(TileClient aTile)
 {
   // We locked the back buffer, and flipped so we now need to unlock the front
   if (aTile.mFrontBuffer && aTile.mFrontBuffer->IsLocked()) {
     aTile.mFrontBuffer->Unlock();
+    aTile.mFrontBuffer->SyncWithObject(mCompositableClient->GetForwarder()->GetSyncObject());
   }
   if (aTile.mFrontBufferOnWhite && aTile.mFrontBufferOnWhite->IsLocked()) {
     aTile.mFrontBufferOnWhite->Unlock();
+    aTile.mFrontBufferOnWhite->SyncWithObject(mCompositableClient->GetForwarder()->GetSyncObject());
   }
   if (aTile.mBackBuffer && aTile.mBackBuffer->IsLocked()) {
     aTile.mBackBuffer->Unlock();
   }
   if (aTile.mBackBufferOnWhite && aTile.mBackBufferOnWhite->IsLocked()) {
     aTile.mBackBufferOnWhite->Unlock();
   }
 }
@@ -1288,18 +1290,16 @@ ClientTiledLayerBuffer::ValidateTile(Til
   nsIntRegion tileRegion =
     nsIntRect(aTileOrigin.x, aTileOrigin.y,
               GetScaledTileSize().width, GetScaledTileSize().height);
   // Intersect this area with the portion that's invalid.
   tileRegion.SubOut(GetValidRegion());
   tileRegion.SubOut(aDirtyRegion); // Has now been validated
 
   backBuffer->SetWaste(tileRegion.Area() * mResolution * mResolution);
-  backBuffer->Unlock();
-  backBuffer->SyncWithObject(mCompositableClient->GetForwarder()->GetSyncObject());
 
   if (createdTextureClient) {
     if (!mCompositableClient->AddTextureClient(backBuffer)) {
       NS_WARNING("Failed to add tile TextureClient.");
       aTile.DiscardFrontBuffer();
       aTile.DiscardBackBuffer();
       return aTile;
     }