Title: [190477] branches/safari-601.1.46-branch/Source/WebCore
Revision
190477
Author
[email protected]
Date
2015-10-02 01:14:45 -0700 (Fri, 02 Oct 2015)

Log Message

Merged r190380.  rdar://problem/22888927

Modified Paths

Diff

Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (190476 => 190477)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-10-02 08:13:50 UTC (rev 190476)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-10-02 08:14:45 UTC (rev 190477)
@@ -1,5 +1,36 @@
 2015-10-02  Babak Shafiei  <[email protected]>
 
+        Merge r190380.
+
+    2015-09-30  Dean Jackson  <[email protected]>
+
+            Crash in gleLookupHashObject when context is lost
+            https://bugs.webkit.org/show_bug.cgi?id=149690
+            <rdar://problem/22751585>
+            <rdar://problem/22465495>
+
+            Reviewed by Simon Fraser.
+
+            When we received notification that the GPU has reset,
+            we were nulling out and deleting our OpenGL contexts
+            and then trying to do it all over again. The fix was
+            to flip the order of operations.
+
+            While there I added some logging, and changed the
+            way we check GPU status to make sure we do a check
+            after the first draw call.
+
+            Unfortunately we can't test automatically because it
+            involves resetting the GPU which can possibly cause
+            concurrent tests to fail.
+
+            * platform/graphics/mac/GraphicsContext3DMac.mm:
+            (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Move forceContextLost()
+            to be the first thing we do after we've realised we need to
+            bail.
+
+2015-10-02  Babak Shafiei  <[email protected]>
+
         Merge r190375.
 
     2015-09-30  Myles C. Maxfield  <[email protected]>

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (190476 => 190477)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm	2015-10-02 08:13:50 UTC (rev 190476)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm	2015-10-02 08:14:45 UTC (rev 190477)
@@ -40,6 +40,7 @@
 #include "GraphicsContext.h"
 #include "HTMLCanvasElement.h"
 #include "ImageBuffer.h"
+#include "Logging.h"
 #if PLATFORM(IOS)
 #import "OpenGLESSPI.h"
 #import <OpenGLES/ES2/glext.h>
@@ -373,25 +374,27 @@
 void GraphicsContext3D::checkGPUStatusIfNecessary()
 {
 #if USE_GPU_STATUS_CHECK
+    bool needsCheck = !GPUCheckCounter;
     GPUCheckCounter = (GPUCheckCounter + 1) % GPUStatusCheckThreshold;
-    if (GPUCheckCounter)
+
+    if (!needsCheck)
         return;
+
+    GLint restartStatus = 0;
 #if PLATFORM(MAC)
-    GLint restartStatus = 0;
     CGLGetParameter(platformGraphicsContext3D(), kCGLCPGPURestartStatus, &restartStatus);
     if (restartStatus == kCGLCPGPURestartStatusCaused || restartStatus == kCGLCPGPURestartStatusBlacklisted) {
+        LOG(WebGL, "The GPU has either reset or blacklisted us. Lose the context.");
+        forceContextLost();
         CGLSetCurrentContext(0);
-        CGLDestroyContext(platformGraphicsContext3D());
-        forceContextLost();
     }
 #elif PLATFORM(IOS)
-    GLint restartStatus = 0;
     EAGLContext* currentContext = static_cast<EAGLContext*>(PlatformGraphicsContext3D());
     [currentContext getParameter:kEAGLCPGPURestartStatus to:&restartStatus];
     if (restartStatus == kEAGLCPGPURestartStatusCaused || restartStatus == kEAGLCPGPURestartStatusBlacklisted) {
+        LOG(WebGL, "The GPU has either reset or blacklisted us. Lose the context.");
+        forceContextLost();
         [EAGLContext setCurrentContext:0];
-        [static_cast<EAGLContext*>(currentContext) release];
-        forceContextLost();
     }
 #endif
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to