Bug 876721 - Allow for failing during creation of ANGLE ShSurf. r=bas, a=akeybl
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 06 Jun 2013 13:56:15 -0700
changeset 142878 f157e8898517d1e5b0ca4be5b5d1d56ab1bb7db4
parent 142877 8fb828aae198ee807a074d76362a0693da28decb
child 142879 c7512a9df9d361d4a64df171d105d0e726f10c77
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, akeybl
bugs876721
milestone23.0a2
Bug 876721 - Allow for failing during creation of ANGLE ShSurf. r=bas, a=akeybl
gfx/gl/SharedSurfaceANGLE.cpp
--- a/gfx/gl/SharedSurfaceANGLE.cpp
+++ b/gfx/gl/SharedSurfaceANGLE.cpp
@@ -227,32 +227,35 @@ SharedSurface_ANGLEShareHandle::Create(G
     {
         NS_ERROR("Failed to grab ShareHandle for PBuffer!");
         goto CleanUpIfFailed;
     }
 
     // Ok, we have a valid PBuffer with ShareHandle.
     // Let's attach it to D3D.
     hr = d3d->OpenSharedResource(shareHandle,
-                                         __uuidof(ID3D10Texture2D),
-                                         getter_AddRefs(texture));
-    if (FAILED(hr))
+                                 __uuidof(ID3D10Texture2D),
+                                 getter_AddRefs(texture));
+    if (FAILED(hr)) {
+        NS_ERROR("Failed to open shared resource!");
         goto CleanUpIfFailed;
+    }
 
     hr = d3d->CreateShaderResourceView(texture, nullptr, getter_AddRefs(srv));
-    if (FAILED(hr))
+    if (FAILED(hr)) {
+        NS_ERROR("Failed to create SRV!");
         goto CleanUpIfFailed;
+    }
 
     failed = false;
 
 CleanUpIfFailed:
     if (failed) {
         NS_WARNING("CleanUpIfFailed");
         egl->fDestroySurface(egl->Display(), pbuffer);
-        MOZ_CRASH();
         return nullptr;
     }
 
     return new SharedSurface_ANGLEShareHandle(gl, egl,
                                               size, hasAlpha,
                                               context, pbuffer,
                                               texture, srv);
 }