Fix failure to recover from device hang.

Sometimes IDirect3DDevice9Ex::CheckDeviceState returns S_PRESENT_MODE_CHANGED when the GPU has hung. It's not consistent, maybe one time out of two when I hang the GPU while running WebGL Aquarium.

This unfortunately means that changes to display mode will cause ANGLE to report context lost. Other ideas appreciated.
Review URL: https://codereview.appspot.com/7305093

git-svn-id: http://angleproject.googlecode.com/svn/trunk@1829 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/common/version.h b/src/common/version.h
index c446225..cb7170b 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -1,7 +1,7 @@
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 1828
+#define BUILD_REVISION 1829
 
 #define STRINGIFY(x) #x
 #define MACRO_STRINGIFY(x) STRINGIFY(x)
diff --git a/src/libEGL/Display.cpp b/src/libEGL/Display.cpp
index 0d40ad7..248af6f 100644
--- a/src/libEGL/Display.cpp
+++ b/src/libEGL/Display.cpp
@@ -910,7 +910,9 @@
 {
     if (mDeviceEx)
     {
-        return FAILED(mDeviceEx->CheckDeviceState(NULL));
+        // Sometimes CheckDeviceState returns S_PRESENT_MODE_CHANGED when the GPU has hung.
+        HRESULT result = mDeviceEx->CheckDeviceState(NULL);
+        return FAILED(result) || result == S_PRESENT_MODE_CHANGED;
     }
     else if (mDevice)
     {