Bug 624088: Recreate our device agressively on device losses. r=jrmuizel a=joedrew
authorBas Schouten <bschouten@mozilla.com>
Mon, 17 Jan 2011 21:28:24 +0000
changeset 60711 16d3af58499c1fe9a08653508df425568eef902d
parent 60710 ea0d32edf11b2d9ff2d0ba4e71964d8466fb73d3
child 60712 d41e933f589aaefcc6543228effd6f7eaaf3cd7b
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel, joedrew
bugs624088
milestone2.0b10pre
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 624088: Recreate our device agressively on device losses. r=jrmuizel a=joedrew
gfx/layers/d3d9/DeviceManagerD3D9.cpp
--- a/gfx/layers/d3d9/DeviceManagerD3D9.cpp
+++ b/gfx/layers/d3d9/DeviceManagerD3D9.cpp
@@ -520,39 +520,21 @@ bool
 DeviceManagerD3D9::VerifyReadyForRendering()
 {
   HRESULT hr = mDevice->TestCooperativeLevel();
 
   if (SUCCEEDED(hr)) {
     if (IsD3D9Ex()) {
       hr = mDeviceEx->CheckDeviceState(mFocusWnd);
 
-      if (hr == D3DERR_DEVICEREMOVED) {
+      if (FAILED(hr)) {
         mDeviceWasRemoved = true;
         LayerManagerD3D9::OnDeviceManagerDestroy(this);
         return false;
       }
-
-      if (FAILED(hr)) {
-        D3DPRESENT_PARAMETERS pp;
-        memset(&pp, 0, sizeof(D3DPRESENT_PARAMETERS));
-
-        pp.BackBufferWidth = 1;
-        pp.BackBufferHeight = 1;
-        pp.BackBufferFormat = D3DFMT_A8R8G8B8;
-        pp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-        pp.Windowed = TRUE;
-        pp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
-        pp.hDeviceWindow = mFocusWnd;
-        
-        hr = mDeviceEx->ResetEx(&pp, NULL);
-        if (FAILED(hr)) {
-          return false;
-        }
-      }
     }
     return true;
   }
 
   for(unsigned int i = 0; i < mLayersWithResources.Length(); i++) {
     mLayersWithResources[i]->CleanResources();
   }
   for(unsigned int i = 0; i < mSwapChains.Length(); i++) {