Handle failed SendPTexture. (bug 1313770 part 5, r=mattwoodrow)
authorDavid Anderson <danderson@mozilla.com>
Fri, 28 Oct 2016 15:48:35 -0700
changeset 320097 b555a8f33edb7ac95555ab341d5b8281ae5b234f
parent 320096 d2f30ab32eceb03b2e2d55aed36711c94f894c58
child 320098 c109df706fa422b3d4fe5656e20e8c1e3cc21060
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1313770
milestone52.0a1
Handle failed SendPTexture. (bug 1313770 part 5, r=mattwoodrow)
gfx/layers/client/TextureClient.cpp
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -874,27 +874,30 @@ TextureClient::InitIPDLActor(Compositabl
   }
   MOZ_ASSERT(!mActor || mActor->mDestroyed, "Cannot use a texture on several IPC channels.");
 
   SurfaceDescriptor desc;
   if (!ToSurfaceDescriptor(desc)) {
     return false;
   }
 
-  mActor = static_cast<TextureChild*>(aForwarder->GetTextureForwarder()->CreateTexture(desc,
-                                                                                      aForwarder->GetCompositorBackendType(),
-                                                                                      GetFlags(),
-                                                                                      mSerial));
-  if (!mActor) {
-    gfxCriticalError() << static_cast<int32_t>(desc.type()) << ", "
-                       << static_cast<int32_t>(aForwarder->GetCompositorBackendType()) << ", "
-                       << static_cast<uint32_t>(GetFlags())
-                       << ", " << mSerial;
-    MOZ_CRASH("GFX: Invalid actor");
+  PTextureChild* actor = aForwarder->GetTextureForwarder()->CreateTexture(
+    desc,
+    aForwarder->GetCompositorBackendType(),
+    GetFlags(),
+    mSerial);
+  if (!actor) {
+    gfxCriticalNote << static_cast<int32_t>(desc.type()) << ", "
+                    << static_cast<int32_t>(aForwarder->GetCompositorBackendType()) << ", "
+                    << static_cast<uint32_t>(GetFlags())
+                    << ", " << mSerial;
+    return false;
   }
+
+  mActor = static_cast<TextureChild*>(actor);
   mActor->mCompositableForwarder = aForwarder;
   mActor->mTextureForwarder = aForwarder->GetTextureForwarder();
   mActor->mTextureClient = this;
   mActor->mMainThreadOnly = !!(mFlags & TextureFlags::DEALLOCATE_MAIN_THREAD);
 
   // If the TextureClient is already locked, we have to lock TextureChild's mutex
   // since it will be unlocked in TextureClient::Unlock.
   if (mIsLocked) {