Handle an unknown error when exiting fullscreen on Windows 8.


Change-Id: I6d3e843a8ae06f1bbd5313ed95e338cb0b74fef3
Reviewed-on: https://chromium-review.googlesource.com/194128
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: John Bauman <jbauman@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
(cherry picked from commit 74697cf2064c0a2c0d7e1b1b28db439286766a05)
Reviewed-on: https://chromium-review.googlesource.com/195160
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
diff --git a/src/libGLESv2/renderer/d3d9/SwapChain9.cpp b/src/libGLESv2/renderer/d3d9/SwapChain9.cpp
index dd8895d..b7cf4d1 100644
--- a/src/libGLESv2/renderer/d3d9/SwapChain9.cpp
+++ b/src/libGLESv2/renderer/d3d9/SwapChain9.cpp
@@ -356,6 +356,14 @@
         return EGL_BAD_ALLOC;
+    // On Windows 8 systems, IDirect3DSwapChain9::Present sometimes returns 0x88760873 when the windows is
+    // in the process of entering/exiting fullscreen. This code doesn't seem to have any documentation.  The
+    // device appears to be ok after emitting this error so simply return a failure to swap.
+    if (result == 0x88760873)
+    {
+        return EGL_BAD_NATIVE_WINDOW;
+    }
     // http://crbug.com/313210
     // If our swap failed, trigger a device lost event. Resetting will work around an AMD-specific
     // device removed bug with lost contexts when reinstalling drivers.