Bug 1071045: Report error codes and size/format information to D2D error reporting. r=nical default tip
authorBas Schouten <bschouten@mozilla.com>
Mon, 22 Sep 2014 19:33:04 +0000
changeset 734 46e20d96e909ad0ede287a587bb48d152a16b12b
parent 733 d0d0ba810490c12a4dd7911428515fabf3fa1b28
push id274
push userbschouten@mozilla.com
push dateTue, 23 Sep 2014 16:10:56 +0000
reviewersnical
bugs1071045
Bug 1071045: Report error codes and size/format information to D2D error reporting. r=nical
DrawTargetD2D.cpp
--- a/DrawTargetD2D.cpp
+++ b/DrawTargetD2D.cpp
@@ -1964,17 +1964,17 @@ DrawTargetD2D::CreateRTForTexture(ID3D10
   HRESULT hr;
 
   RefPtr<IDXGISurface> surface;
   RefPtr<ID2D1RenderTarget> rt;
 
   hr = aTexture->QueryInterface((IDXGISurface**)byRef(surface));
 
   if (FAILED(hr)) {
-    gfxCriticalError() << "Failed to QI texture to surface.";
+    gfxCriticalError() << "Failed to QI texture to surface. Code: " << hr;
     return nullptr;
   }
 
   D3D10_TEXTURE2D_DESC desc;
   aTexture->GetDesc(&desc);
 
   D2D1_ALPHA_MODE alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
 
@@ -1982,17 +1982,17 @@ DrawTargetD2D::CreateRTForTexture(ID3D10
     alphaMode = D2D1_ALPHA_MODE_IGNORE;
   }
 
   D2D1_RENDER_TARGET_PROPERTIES props =
     D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(desc.Format, alphaMode));
   hr = factory()->CreateDxgiSurfaceRenderTarget(surface, props, byRef(rt));
 
   if (FAILED(hr)) {
-    gfxCriticalError() << "Failed to create D2D render target for texture.";
+    gfxCriticalError() << "Failed to create D2D render target for texture. Code:" << hr << " " << mSize << " Format: " << uint32_t(aFormat);
     return nullptr;
   }
 
   return rt.forget();
 }
 
 void
 DrawTargetD2D::EnsureViews()