Move the call to notify device lost to the Renderer.

TRAC #22411

Signed-off-by: Geoff Lang
Signed-off-by: Shannon Woods
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1855 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer9.cpp b/src/libGLESv2/renderer/Renderer9.cpp
index 2e7d3ec..930a15d 100644
--- a/src/libGLESv2/renderer/Renderer9.cpp
+++ b/src/libGLESv2/renderer/Renderer9.cpp
@@ -636,7 +636,7 @@
 
     if (d3d9::isDeviceLostError(result))
     {
-        mDisplay->notifyDeviceLost();
+        notifyDeviceLost();
     }
 }
 
@@ -2016,9 +2016,10 @@
 }
 
 
-void Renderer9::markDeviceLost()
+void Renderer9::notifyDeviceLost()
 {
     mDeviceLost = true;
+    mDisplay->notifyDeviceLost();
 }
 
 bool Renderer9::isDeviceLost()
@@ -2047,14 +2048,12 @@
     if (isLost)
     {
         // ensure we note the device loss --
-        // we'll probably get this done again by markDeviceLost
-        // but best to remember it!
         // Note that we don't want to clear the device loss status here
         // -- this needs to be done by resetDevice
         mDeviceLost = true;
         if (notify)
         {
-            mDisplay->notifyDeviceLost();
+            notifyDeviceLost();
         }
     }
 
@@ -2705,8 +2704,11 @@
 
         // It turns out that D3D will sometimes produce more error
         // codes than those documented.
-        if (d3d9::checkDeviceLost(result))
+        if (d3d9::isDeviceLostError(result))
+        {
+            notifyDeviceLost();
             return error(GL_OUT_OF_MEMORY);
+        }
         else
         {
             UNREACHABLE();