Bug 1042946 - Discard back buffer on error in ClientTiledLayerBuffer::ValidateTile() r=nical
authorSotaro Ikeda <sikeda@mozilla.com>
Thu, 24 Jul 2014 06:40:17 -0700
changeset 195874 707fe2b64a854d82d65c5913376260cd1d38d881
parent 195873 b83bb45e90101226622f920f32b50673739fc979
child 195875 8d3c184b592dcdc16ce700a30386c9506eecad85
push id46718
push usersikeda@mozilla.com
push dateThu, 24 Jul 2014 13:40:27 +0000
treeherdermozilla-inbound@707fe2b64a85 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1042946
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 1042946 - Discard back buffer on error in ClientTiledLayerBuffer::ValidateTile() r=nical
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -909,19 +909,20 @@ ClientTiledLayerBuffer::ValidateTile(Til
   offsetScaledDirtyRegion.ScaleRoundOut(mResolution, mResolution);
 
   bool usingSinglePaintBuffer = !!mSinglePaintDrawTarget;
   RefPtr<TextureClient> backBuffer =
     aTile.GetBackBuffer(offsetScaledDirtyRegion,
                         mManager->GetTexturePool(gfxPlatform::GetPlatform()->Optimal2DFormatForContent(GetContentType())),
                         &createdTextureClient, !usingSinglePaintBuffer);
 
-  if (!backBuffer->Lock(OpenMode::OPEN_READ_WRITE)) {
+  if (!backBuffer || !backBuffer->Lock(OpenMode::OPEN_READ_WRITE)) {
     NS_WARNING("Failed to lock tile TextureClient for updating.");
     aTile.DiscardFrontBuffer();
+    aTile.DiscardBackBuffer();
     return aTile;
   }
 
   // We must not keep a reference to the DrawTarget after it has been unlocked,
   // make sure these are null'd before unlocking as destruction of the context
   // may cause the target to be flushed.
   RefPtr<DrawTarget> drawTarget = backBuffer->BorrowDrawTarget();
   drawTarget->SetTransform(Matrix());