Bug 1142975 - Check for Present()-caused context loss. - r=kamidphish
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 18 Mar 2015 19:55:44 -0700
changeset 234389 cc2ae042cf01e22ae7f60658ed5ebde4e2a45816
parent 234388 af1e88d6b173cdb0621a127adfce52d9f6653aa9
child 234390 a907e799d8d4fc2a66ec366361308bc14313fa10
push id28443
push usercbook@mozilla.com
push dateThu, 19 Mar 2015 12:46:23 +0000
treeherdermozilla-central@0a11b73c77b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish
bugs1142975
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1142975 - Check for Present()-caused context loss. - r=kamidphish
dom/canvas/WebGLContext.cpp
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -816,16 +816,21 @@ WebGLContext::SetDimensions(int32_t sign
         if (IsContextLost())
             return NS_OK;
 
         MakeContextCurrent();
 
         // If we've already drawn, we should commit the current buffer.
         PresentScreenBuffer();
 
+        if (IsContextLost()) {
+            GenerateWarning("WebGL context was lost due to swap failure.");
+            return NS_OK;
+        }
+
         // ResizeOffscreen scraps the current prod buffer before making a new one.
         if (!ResizeBackbuffer(width, height)) {
             GenerateWarning("WebGL context failed to resize.");
             ForceLoseContext();
             return NS_OK;
         }
 
         // everything's good, we're done here