Bug 1130195: Don't immediately crash if we can't allocate image. Carry r=bas
authorMilan Sreckovic <milan@mozilla.com>
Tue, 11 Aug 2015 14:07:49 -0700
changeset 289980 b4f66a22aba60a1c80cd5aba34ffe4a167daaaf0
parent 289979 a369646b9ca5fa8ee90eb09122138149cbe9ed2f
child 289981 24ee4a5af7e872c908d287e50b6c878bedf8beea
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs1130195
milestone43.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 1130195: Don't immediately crash if we can't allocate image. Carry r=bas
gfx/2d/DrawTargetD2D1.cpp
--- a/gfx/2d/DrawTargetD2D1.cpp
+++ b/gfx/2d/DrawTargetD2D1.cpp
@@ -1111,19 +1111,17 @@ DrawTargetD2D1::FinalizeDrawing(Composit
         return;
       }
     }
 
     RefPtr<ID2D1Bitmap> tmpBitmap;
     HRESULT hr = mDC->CreateBitmap(D2DIntSize(mSize), D2D1::BitmapProperties(D2DPixelFormat(mFormat)), byRef(tmpBitmap));
     if (FAILED(hr)) {
       gfxCriticalError(CriticalLog::DefaultOptions(Factory::ReasonableSurfaceSize(mSize))) << "[D2D1.1] 5CreateBitmap failure " << mSize << " Code: " << hexa(hr) << " format " << (int)mFormat;
-      // For now, crash in this scenario; this should happen because tmpBitmap is
-      // null and CopyFromBitmap call below dereferences it.
-      // return;
+      return;
     }
 
     // This flush is important since the copy method will not know about the context drawing to the surface.
     // We also need to pop all the clips to make sure any drawn content will have made it to the final bitmap.
     mDC->Flush();
 
     // We need to use a copy here because affects don't accept a surface on
     // both their in- and outputs.