Bug 876721 - Allow for failing during creation of ANGLE ShSurf. - r=bjbas
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 06 Jun 2013 13:56:15 -0700
changeset 145794 1b9cbc30e0855aaf330dcf33d6173f170c00cb88
parent 145793 068b67ace29ccff4490ce093432640e1bf19e0c8
child 145795 263154173cc8741b702be3f2cf1226444e867190
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjbas
bugs876721
milestone24.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 876721 - Allow for failing during creation of ANGLE ShSurf. - r=bjbas
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);
 }