Bug 644199: Properly re-upload after clearing mTexture because of device reset. r=roc
authorBas Schouten <bschouten@mozilla.com>
Tue, 17 Jan 2012 18:32:24 +0100
changeset 84686 d0e25fc5a4dceba03ee63a4dca0e22215a2b5880
parent 84685 9ffa2b1718fb2f8d10ac5355ba6744de2d55f333
child 84687 26c821293430fe7cc0637db0fa177fca83ea0cac
push id21872
push userjdrew@mozilla.com
push dateTue, 17 Jan 2012 21:57:32 +0000
treeherdermozilla-central@f4049f65efc6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs644199
milestone12.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 644199: Properly re-upload after clearing mTexture because of device reset. r=roc
gfx/layers/d3d9/CanvasLayerD3D9.cpp
--- a/gfx/layers/d3d9/CanvasLayerD3D9.cpp
+++ b/gfx/layers/d3d9/CanvasLayerD3D9.cpp
@@ -85,24 +85,27 @@ CanvasLayerD3D9::Initialize(const Data& 
   mBounds.SetRect(0, 0, aData.mSize.width, aData.mSize.height);
 
   CreateTexture();
 }
 
 void
 CanvasLayerD3D9::UpdateSurface()
 {
-  if (!mDirty)
+  if (!mDirty && mTexture)
     return;
   mDirty = false;
 
   if (!mTexture) {
     CreateTexture();
-    NS_WARNING("CanvasLayerD3D9::Updated called but no texture present!");
-    return;
+
+    if (!mTexture) {
+      NS_WARNING("CanvasLayerD3D9::Updated called but no texture present and creation failed!");
+      return;
+    }
   }
 
   if (mGLContext) {
     // WebGL reads entire surface.
     LockTextureRectD3D9 textureLock(mTexture);
     if (!textureLock.HasLock()) {
       NS_WARNING("Failed to lock CanvasLayer texture.");
       return;