Bug 759749 - Bail if fallback CreateBitmap call in SourceSurfaceD2DTarget::GetBitmap fails. r=Bas
authorJim Mathies <jmathies@mozilla.com>
Wed, 22 Jan 2014 14:12:08 -0600
changeset 164799 d86f25820d53af93aa01866aeb60ab4cbc49d3cd
parent 164798 3ea5b5cc5817d00bcf3b69c141315426e4f119d5
child 164800 aa978f40963a2662ceadee06f3f6929c4cd38fba
push id38817
push usercbook@mozilla.com
push dateThu, 23 Jan 2014 10:29:13 +0000
treeherdermozilla-inbound@7fdda1995af8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs759749
milestone29.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 759749 - Bail if fallback CreateBitmap call in SourceSurfaceD2DTarget::GetBitmap fails. r=Bas
gfx/2d/SourceSurfaceD2DTarget.cpp
--- a/gfx/2d/SourceSurfaceD2DTarget.cpp
+++ b/gfx/2d/SourceSurfaceD2DTarget.cpp
@@ -138,19 +138,24 @@ SourceSurfaceD2DTarget::GetBitmap(ID2D1R
     return nullptr;
   }
 
   D2D1_BITMAP_PROPERTIES props = D2D1::BitmapProperties(D2DPixelFormat(mFormat));
   hr = aRT->CreateSharedBitmap(IID_IDXGISurface, surf, &props, byRef(mBitmap));
 
   if (FAILED(hr)) {
     // This seems to happen for SurfaceFormat::A8 sometimes...
-    aRT->CreateBitmap(D2D1::SizeU(desc.Width, desc.Height),
-                      D2D1::BitmapProperties(D2DPixelFormat(mFormat)),
-                      byRef(mBitmap));
+    hr = aRT->CreateBitmap(D2D1::SizeU(desc.Width, desc.Height),
+                           D2D1::BitmapProperties(D2DPixelFormat(mFormat)),
+                           byRef(mBitmap));
+
+    if (FAILED(hr)) {
+      gfxWarning() << "Failed in CreateBitmap. Code: " << hr;
+      return nullptr;
+    }
 
     RefPtr<ID2D1RenderTarget> rt;
 
     if (mDrawTarget) {
       rt = mDrawTarget->mRT;
     }
 
     if (!rt) {