Bug 1483772 - Never have mAsyncTask be non-null when we cannot paint. r=nical
authorRyan Hunt <rhunt@eqrion.net>
Thu, 16 Aug 2018 10:33:14 -0500
changeset 487788 4841b3ddbacbb80dfd48c5c0b9737d6c33c7bcaa
parent 487787 9b2e26f618a443989ab88e724ecc52d160bd093d
child 487789 3c5aa35fa3d2674821a481ee46e67805b2e6b057
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1483772, 1482415
milestone63.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 1483772 - Never have mAsyncTask be non-null when we cannot paint. r=nical In bug 1482415 a special check was added for the case where we fail to allocate a buffer and started an async task. This papered over one crash for another as ClientPaintedLayer also assumes that if there is an async task there is a capture. It'd be best to just null out mAsyncTask and keep those checks as is. Differential Revision: https://phabricator.services.mozilla.com/D3520
gfx/layers/client/ContentClient.cpp
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -232,22 +232,24 @@ ContentClient::BeginPaint(PaintedLayer* 
     if (!newBuffer) {
       if (Factory::ReasonableSurfaceSize(IntSize(dest.mBufferRect.Width(), dest.mBufferRect.Height()))) {
         gfxCriticalNote << "Failed buffer for "
                         << dest.mBufferRect.X() << ", "
                         << dest.mBufferRect.Y() << ", "
                         << dest.mBufferRect.Width() << ", "
                         << dest.mBufferRect.Height();
       }
+      result.mAsyncTask = nullptr;
       Clear();
       return result;
     }
 
     if (!newBuffer->Lock(writeMode)) {
       gfxCriticalNote << "Failed to lock new back buffer.";
+      result.mAsyncTask = nullptr;
       Clear();
       return result;
     }
 
     if (result.mAsyncPaint) {
       newBuffer->BeginCapture();
     }
 
@@ -290,17 +292,17 @@ ContentClient::BeginPaint(PaintedLayer* 
   result.mMode = dest.mBufferMode;
 
   return result;
 }
 
 void
 ContentClient::EndPaint(PaintState& aPaintState, nsTArray<ReadbackProcessor::Update>* aReadbackUpdates)
 {
-  if (aPaintState.mAsyncTask && mBuffer) {
+  if (aPaintState.mAsyncTask) {
     aPaintState.mAsyncTask->mCapture = mBuffer->EndCapture();
   }
 }
 
 nsIntRegion
 ExpandDrawRegion(ContentClient::PaintState& aPaintState,
                  RotatedBuffer::DrawIterator* aIter,
                  BackendType aBackendType)