Disable automatic device resets when using reset notification.

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

git-svn-id: https://angleproject.googlecode.com/svn/trunk@849 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libEGL/Display.cpp b/src/libEGL/Display.cpp
index d8fac2e..360c695 100644
--- a/src/libEGL/Display.cpp
+++ b/src/libEGL/Display.cpp
@@ -537,7 +537,8 @@
         return error(EGL_BAD_ALLOC, EGL_NO_SURFACE);
     }
 
-    if (testDeviceLost()) {
+    if (testDeviceLost()) 
+    {
         if (!restoreLostDevice())
             return EGL_NO_SURFACE;
     }
@@ -649,7 +650,8 @@
         return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
     }
 
-    if (testDeviceLost()) {
+    if (testDeviceLost()) 
+    {
         if (!restoreLostDevice())
             return EGL_NO_SURFACE;
     }
@@ -693,6 +695,12 @@
 
 bool Display::restoreLostDevice()
 {
+    for (ContextSet::iterator ctx = mContextSet.begin(); ctx != mContextSet.end(); ctx++)
+    {
+        if ((*ctx)->isResetNotificationEnabled())
+            return false;   // If reset notifications have been requested, application must delete all contexts first
+    }
+ 
     // Release surface resources to make the Reset() succeed
     for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
     {