Implemented reset status.

TRAC #18607
Signed-off-by: Daniel Koch
Authors: Shannon Woods, Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@847 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libEGL/Display.cpp b/src/libEGL/Display.cpp
index a87f48f..f1e1e91 100644
--- a/src/libEGL/Display.cpp
+++ b/src/libEGL/Display.cpp
@@ -813,7 +813,7 @@
     {
         return FAILED(mDeviceEx->CheckDeviceState(NULL));
     }
-    else if(mDevice)
+    else if (mDevice)
     {
         return FAILED(mDevice->TestCooperativeLevel());
     }
@@ -821,6 +821,29 @@
     return false;   // No device yet, so no reset required
 }
 
+bool Display::testDeviceResettable()
+{
+    HRESULT status = D3D_OK;
+
+    if (mDeviceEx)
+    {
+        status = mDeviceEx->CheckDeviceState(NULL);
+    }
+    else if (mDevice)
+    {
+        status = mDevice->TestCooperativeLevel();
+    }
+
+    switch (status)
+    {
+      case D3DERR_DEVICENOTRESET:
+      case D3DERR_DEVICEHUNG:
+        return true;
+      default:
+        return false;
+    }
+}
+
 void Display::getMultiSampleSupport(D3DFORMAT format, bool *multiSampleArray)
 {
     for (int multiSampleIndex = 0; multiSampleIndex <= D3DMULTISAMPLE_16_SAMPLES; multiSampleIndex++)