Bug 1373937 - Add gfxCriticalNote() to get error information. r=dvander
authorvincentliu <vliu@mozilla.com>
Fri, 30 Jun 2017 09:42:48 -0700
changeset 367062 8323cbf507dd642cb062eed398e0f26b4edcaceb
parent 367061 394dd98ad36281583f3e63125fe8f046a0686669
child 367063 303373841d0dab7684dfad1e6aaa4d1c4e24eef1
push id32117
push userphilringnalda@gmail.com
push dateSun, 02 Jul 2017 00:39:30 +0000
treeherdermozilla-central@4d3de12dcdc5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1373937
milestone56.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 1373937 - Add gfxCriticalNote() to get error information. r=dvander
gfx/layers/d3d11/TextureD3D11.cpp
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -455,35 +455,36 @@ D3D11TextureData::Create(IntSize aSize, 
     uploadData.SysMemSlicePitch = 0; // unused
 
     uploadDataPtr = &uploadData;
   }
 
   RefPtr<ID3D11Texture2D> texture11;
   HRESULT hr = device->CreateTexture2D(&newDesc, uploadDataPtr, getter_AddRefs(texture11));
 
+  if (FAILED(hr) || !texture11) {
+    gfxCriticalNote << "[D3D11] 2 CreateTexture2D failure Size: " << aSize
+      << "texture11: " << texture11 << " Code: " << gfx::hexa(hr);
+    return nullptr;
+  }
+
   if (srcSurf && DeviceManagerDx::Get()->HasCrashyInitData()) {
     D3D11_BOX box;
     box.front = box.top = box.left = 0;
     box.back = 1;
     box.right = aSize.width;
     box.bottom = aSize.height;
     RefPtr<ID3D11DeviceContext> ctx;
     device->GetImmediateContext(getter_AddRefs(ctx));
     ctx->UpdateSubresource(texture11, 0, &box, sourceMap.mData, sourceMap.mStride, 0);
   }
 
   if (srcSurf) {
     srcSurf->Unmap();
   }
-  if (FAILED(hr)) {
-    gfxCriticalError(CriticalLog::DefaultOptions(Factory::ReasonableSurfaceSize(aSize)))
-      << "[D3D11] 2 CreateTexture2D failure " << aSize << " Code: " << gfx::hexa(hr);
-    return nullptr;
-  }
 
   // If we created the texture with a keyed mutex, then we expect all operations
   // on it to be synchronized using it. If we did an initial upload using aSurface
   // then bizarely this isn't covered, so we insert a manual lock/unlock pair
   // to force this.
   if (aSurface && newDesc.MiscFlags == D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX) {
     if (!LockD3DTexture(texture11.get())) {
       return nullptr;