Bug 992874 - Don't try to texture from bad D3D10 texture. - r=bas
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 16 Apr 2014 11:05:48 -0700
changeset 179241 1e163918ea051d3a94623f69da155071494713c2
parent 179240 746ce8a34f0f677e9ffc93fb7cc914c4a189a1d5
child 179242 b394e883b80644b49c5636b92cff1f41a9f00d28
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersbas
bugs992874
milestone31.0a1
Bug 992874 - Don't try to texture from bad D3D10 texture. - r=bas
gfx/layers/d3d10/CanvasLayerD3D10.cpp
--- a/gfx/layers/d3d10/CanvasLayerD3D10.cpp
+++ b/gfx/layers/d3d10/CanvasLayerD3D10.cpp
@@ -112,20 +112,25 @@ CanvasLayerD3D10::UpdateSurface()
   Painted();
 
   if (mDrawTarget) {
     mDrawTarget->Flush();
   } else if (mIsD2DTexture) {
     return;
   }
 
+  if (!mTexture) {
+    return;
+  }
+
   if (mGLContext) {
     SharedSurface_GL* surf = mGLContext->RequestFrame();
-    if (!surf)
-        return;
+    if (!surf) {
+      return;
+    }
 
     switch (surf->Type()) {
       case SharedSurfaceType::EGLSurfaceANGLE: {
         SharedSurface_ANGLEShareHandle* shareSurf = SharedSurface_ANGLEShareHandle::Cast(surf);
 
         mSRView = shareSurf->GetSRV();
         return;
       }