Bug 1069592: Annotate several more Direct2D errors. r=jrmuizel
authorBas Schouten <bschouten@mozilla.com>
Fri, 19 Sep 2014 00:01:25 +0200
changeset 206114 446fb70a00f47f2fcd2d5d61bf07c68f0c2f0dd5
parent 206113 ee202b6cebad26410b39f530c19768cdaf452504
child 206115 9a4f85820092e7186bb8b3c7d901522ca8c84977
push id27513
push usercbook@mozilla.com
push dateFri, 19 Sep 2014 12:15:35 +0000
treeherdermozilla-central@dadafedc0760 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1069592
milestone35.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 1069592: Annotate several more Direct2D errors. r=jrmuizel
gfx/2d/DrawTargetD2D.cpp
--- a/gfx/2d/DrawTargetD2D.cpp
+++ b/gfx/2d/DrawTargetD2D.cpp
@@ -1343,31 +1343,31 @@ bool
 DrawTargetD2D::Init(const IntSize &aSize, SurfaceFormat aFormat)
 {
   HRESULT hr;
 
   mSize = aSize;
   mFormat = aFormat;
 
   if (!Factory::GetDirect3D10Device()) {
-    gfxDebug() << "Failed to Init Direct2D DrawTarget (No D3D10 Device set.)";
+    gfxCriticalError() << "Failed to Init Direct2D DrawTarget (No D3D10 Device set.)";
     return false;
   }
   mDevice = Factory::GetDirect3D10Device();
 
   CD3D10_TEXTURE2D_DESC desc(DXGIFormat(aFormat),
                              mSize.width,
                              mSize.height,
                              1, 1);
   desc.BindFlags = D3D10_BIND_RENDER_TARGET | D3D10_BIND_SHADER_RESOURCE;
 
   hr = mDevice->CreateTexture2D(&desc, nullptr, byRef(mTexture));
 
   if (FAILED(hr)) {
-    gfxDebug() << "Failed to init Direct2D DrawTarget. Size: " << mSize << " Code: " << hr;
+    gfxCriticalError() << "Failed to init Direct2D DrawTarget. Size: " << mSize << " Code: " << hr;
     return false;
   }
 
   if (!InitD2DRenderTarget()) {
     return false;
   }
 
   mRT->Clear(D2D1::ColorF(0, 0));
@@ -1388,17 +1388,17 @@ DrawTargetD2D::Init(ID3D10Texture2D *aTe
   }
 
   RefPtr<ID3D10Device> device;
   mTexture->GetDevice(byRef(device));
 
   hr = device->QueryInterface((ID3D10Device1**)byRef(mDevice));
 
   if (FAILED(hr)) {
-    gfxWarning() << "Failed to get D3D10 device from texture.";
+    gfxCriticalError() << "Failed to get D3D10 device from texture.";
     return false;
   }
 
   D3D10_TEXTURE2D_DESC desc;
   mTexture->GetDesc(&desc);
   mSize.width = desc.Width;
   mSize.height = desc.Height;
 
@@ -1507,16 +1507,17 @@ DrawTargetD2D::PopCachedLayer(ID2D1Rende
   aRT->PopLayer();
   mCurrentCachedLayer--;
 }
 
 bool
 DrawTargetD2D::InitD2DRenderTarget()
 {
   if (!factory()) {
+    gfxCriticalError() << "No valid D2D factory available.";
     return false;
   }
 
   mRT = CreateRTForTexture(mTexture, mFormat);
 
   if (!mRT) {
     return false;
   }
@@ -1955,17 +1956,17 @@ DrawTargetD2D::CreateRTForTexture(ID3D10
   HRESULT hr;
 
   RefPtr<IDXGISurface> surface;
   RefPtr<ID2D1RenderTarget> rt;
 
   hr = aTexture->QueryInterface((IDXGISurface**)byRef(surface));
 
   if (FAILED(hr)) {
-    gfxWarning() << "Failed to QI texture to surface.";
+    gfxCriticalError() << "Failed to QI texture to surface.";
     return nullptr;
   }
 
   D3D10_TEXTURE2D_DESC desc;
   aTexture->GetDesc(&desc);
 
   D2D1_ALPHA_MODE alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
 
@@ -1973,17 +1974,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)) {
-    gfxWarning() << "Failed to create D2D render target for texture.";
+    gfxCriticalError() << "Failed to create D2D render target for texture.";
     return nullptr;
   }
 
   return rt.forget();
 }
 
 void
 DrawTargetD2D::EnsureViews()