Changeset 291477 in webkit
- Timestamp:
- Mar 18, 2022, 5:18:00 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r291471 r291477 1 2022-03-18 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 Recycling a webgl context when it has been lost and restored causes a crash 4 https://bugs.webkit.org/show_bug.cgi?id=238024 5 6 Reviewed by Geoffrey Garen. 7 8 Creating excessive amount of contexts will lose the oldest context via 9 "simulated context lost" logic, making the contexts non-restorable. 10 11 Previously the test tried to test that requesting a restore on a context that 12 had simulated context lost would not restore. However, the test was invalid, 13 as it asserted that the context is still lost immediately after preventDefault(): 14 15 event.preventDefault(); 16 if (!contexts[0].isContextLost()) 17 document.getElementById("result").textContent = "FAIL"; 18 19 This is not correct, as the preventDefault() only informs the browser 20 that the context should be restored. The restore happens asynchronously. 21 22 Fix the test logic and add extra cases. Make the logic as such: 23 1. Lose the context in some way 24 2. Wait for context lost event, request restore 25 3. Optionally do something that would trigger another way of losing the context 26 4. Run assertions about context being still expectedly lost 27 28 The failures in the test expectation: 29 FAIL getError expected: INVALID_OPERATION. Was NO_ERROR : 30 FAIL getError expected: CONTEXT_LOST_WEBGL. Was NO_ERROR : 31 bug 236965 32 33 FAIL Expected restore be ignored, but it was not. 34 bug 238034 35 36 * webgl/max-active-contexts-webglcontextlost-prevent-default.html: 37 1 38 2022-03-18 Carlos Garcia Campos <cgarcia@igalia.com> 2 39 -
trunk/LayoutTests/platform/glib/TestExpectations
r291399 r291477 1385 1385 webkit.org/b/172812 webgl/lose-context-after-context-lost.html [ Failure ] 1386 1386 webkit.org/b/172812 webgl/multiple-context-losses.html [ Failure ] 1387 webkit.org/b/172812 webgl/max-active-contexts-webglcontextlost-prevent-default.html [ Failure ] 1387 1388 1388 1389 webkit.org/b/223624 webgl/conformance/extensions/khr-parallel-shader-compile.html [ Skip ] -
trunk/LayoutTests/webgl/max-active-contexts-webglcontextlost-prevent-default-expected.txt
r259900 r291477 1 CONSOLE MESSAGE: There are too many active WebGL contexts on this page, the oldest context will be lost. 2 PASS if the first context was lost due to creating too many WebGL contexts even though preventDefault() was called when a webglcontextlost event was dispatched. 1 Test that first losing context, trying to restore it, and then doing something to really lose it does not crash. 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 TEST COMPLETE: 42 PASS, 10 FAIL 6 7 Running test: loseMethod: loseContext, loseMethod2: loseContext 8 PASS Got webglcontextlost and restore was attempted. 9 PASS getError was expected value: CONTEXT_LOST_WEBGL : 10 PASS getError was expected value: INVALID_OPERATION : 11 PASS gl.isContextLost() is true 12 PASS getError was expected value: NO_ERROR : 13 Running test: loseMethod: loseContext, loseMethod2: manyContexts 14 PASS Got webglcontextlost and restore was attempted. 15 PASS getError was expected value: CONTEXT_LOST_WEBGL : 16 PASS gl.isContextLost() is true 17 PASS getError was expected value: NO_ERROR : 18 Running test: loseMethod: loseContext, loseMethod2: gpuStatusFailure 19 PASS Got webglcontextlost and restore was attempted. 20 PASS getError was expected value: CONTEXT_LOST_WEBGL : 21 PASS gl.isContextLost() is true 22 PASS getError was expected value: NO_ERROR : 23 Running test: loseMethod: loseContext, loseMethod2: nothing 24 PASS Got webglcontextlost and restore was attempted. 25 PASS getError was expected value: CONTEXT_LOST_WEBGL : 26 PASS gl.isContextLost() is true 27 PASS getError was expected value: NO_ERROR : 28 Running test: loseMethod: manyContexts, loseMethod2: loseContext 29 PASS Got webglcontextlost and restore was attempted. 30 FAIL getError expected: CONTEXT_LOST_WEBGL. Was NO_ERROR : 31 FAIL getError expected: INVALID_OPERATION. Was NO_ERROR : 32 PASS gl.isContextLost() is true 33 PASS getError was expected value: NO_ERROR : 34 Running test: loseMethod: manyContexts, loseMethod2: manyContexts 35 PASS Got webglcontextlost and restore was attempted. 36 FAIL getError expected: CONTEXT_LOST_WEBGL. Was NO_ERROR : 37 PASS gl.isContextLost() is true 38 PASS getError was expected value: NO_ERROR : 39 Running test: loseMethod: manyContexts, loseMethod2: gpuStatusFailure 40 PASS Got webglcontextlost and restore was attempted. 41 FAIL getError expected: CONTEXT_LOST_WEBGL. Was NO_ERROR : 42 PASS gl.isContextLost() is true 43 PASS getError was expected value: NO_ERROR : 44 Running test: loseMethod: manyContexts, loseMethod2: nothing 45 PASS Got webglcontextlost and restore was attempted. 46 FAIL getError expected: CONTEXT_LOST_WEBGL. Was NO_ERROR : 47 PASS gl.isContextLost() is true 48 PASS getError was expected value: NO_ERROR : 49 Running test: loseMethod: gpuStatusFailure, loseMethod2: loseContext 50 PASS Got webglcontextlost and restore was attempted. 51 PASS getError was expected value: CONTEXT_LOST_WEBGL : 52 FAIL getError expected: INVALID_OPERATION. Was NO_ERROR : 53 FAIL Expected restore be ignored, but it was not. 54 PASS getError was expected value: NO_ERROR : 55 Running test: loseMethod: gpuStatusFailure, loseMethod2: manyContexts 56 PASS Got webglcontextlost and restore was attempted. 57 PASS getError was expected value: CONTEXT_LOST_WEBGL : 58 FAIL Expected restore be ignored, but it was not. 59 PASS getError was expected value: NO_ERROR : 60 Running test: loseMethod: gpuStatusFailure, loseMethod2: gpuStatusFailure 61 PASS Got webglcontextlost and restore was attempted. 62 PASS getError was expected value: CONTEXT_LOST_WEBGL : 63 FAIL Expected restore be ignored, but it was not. 64 PASS getError was expected value: NO_ERROR : 65 Running test: loseMethod: gpuStatusFailure, loseMethod2: nothing 66 PASS Got webglcontextlost and restore was attempted. 67 PASS getError was expected value: CONTEXT_LOST_WEBGL : 68 FAIL Expected restore be ignored, but it was not. 69 PASS getError was expected value: NO_ERROR : 70 PASS successfullyParsed is true 71 72 TEST COMPLETE 73 -
trunk/LayoutTests/webgl/max-active-contexts-webglcontextlost-prevent-default.html
r199819 r291477 1 <div id="result">PASS if the first context was lost due to creating too many WebGL contexts even though <code>preventDefault()</code> was called when a <code>webglcontextlost</code> event was dispatched.</div> 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <link rel="stylesheet" href="resources/webgl_test_files/resources/js-test-style.css"/> 6 <script src="resources/webgl_test_files/js/js-test-pre.js"></script> 7 <script src="resources/webgl_test_files/js/webgl-test-utils.js"></script> 8 </head> 9 <body onload="test()"> 10 <div id="description"></div> 11 <div id="console"></div> 2 12 <script> 3 if (window.testRunner) { 4 testRunner.waitUntilDone(); 5 testRunner.dumpAsText(); 13 "use strict"; 14 description("Test that first losing context, trying to restore it, and then doing something to really lose it does not crash."); 15 16 // The test would crash with following sequence: 17 // 1. Cause a real context lost. In this test, "gpuStatusFailure". 18 // 2. Page would try to restore the context. This would start the restore timer. 19 // 3. Before the restore timer fires, really lose the context. In this test, "manyContext". 20 // 4. The restore timer would fire, and restore function would use nullptr context. 21 22 var wtu = WebGLTestUtils; 23 var gl; 24 25 async function waitForEvent(element, eventName, timeoutMS) 26 { 27 timeoutMS = timeoutMS || 2000; 28 return new Promise((resolve, reject) => { 29 function timeoutHandler() { 30 element.removeEventListener(eventName, handler, { once: true }); 31 reject(); 32 } 33 const rejectID = setTimeout(timeoutHandler, timeoutMS); 34 function handler(event) { 35 clearTimeout(rejectID); 36 resolve(event); 37 } 38 element.addEventListener(eventName, handler, { once: true }); 39 }); 6 40 } 7 41 8 var maxNumberOfActiveContexts = 16; 9 var contexts = []; 10 for (var i = 0; i <= maxNumberOfActiveContexts; i++) { 11 var canvas = document.createElement("canvas"); 12 canvas.addEventListener("webglcontextlost", function(event) { 13 event.preventDefault(); 14 if (!contexts[0].isContextLost()) 15 document.getElementById("result").textContent = "FAIL"; 16 if (window.testRunner) 17 testRunner.notifyDone(); 18 }); 19 contexts[i] = canvas.getContext("webgl"); 42 async function waitForWebGLContextRestored(canvas, timeoutMS) 43 { 44 await waitForEvent(canvas, "webglcontextrestored", timeoutMS); 45 } 46 47 async function waitForWebGLContextLostAndRestore(canvas, timeoutMS) 48 { 49 let event = await waitForEvent(canvas, "webglcontextlost", timeoutMS); 50 event.preventDefault(); 51 } 52 53 function testDescription(subcase) { 54 return Object.keys(subcase).map((k) => `${k}: ${typeof subcase[k] === "function" ? subcase[k].name : subcase[k]}`).join(", "); 55 } 56 57 async function runTest(subcase) 58 { 59 debug(`Running test: ${testDescription(subcase)}`); 60 61 const canvas = document.createElement("canvas"); 62 canvas.width = 1; 63 canvas.height = 1; 64 gl = wtu.create3DContext(canvas); 65 const WEBGL_lose_context = wtu.getExtensionWithKnownPrefixes(gl, "WEBGL_lose_context"); 66 67 const webglcontextlostandrestore = waitForWebGLContextLostAndRestore(canvas); 68 const webglcontextrestored = waitForWebGLContextRestored(canvas); 69 let expectRestoreIgnored = subcase.loseMethod(gl, WEBGL_lose_context); 70 71 try { 72 await webglcontextlostandrestore; 73 testPassed("Got webglcontextlost and restore was attempted."); 74 wtu.glErrorShouldBe(gl, gl.CONTEXT_LOST_WEBGL); 75 } catch (e) { 76 if (e) 77 throw e; 78 testFailed("Timed out waiting webglcontextlost that would attempt to be restored."); 79 } 80 expectRestoreIgnored = subcase.loseMethod2(gl, WEBGL_lose_context) || expectRestoreIgnored; 81 82 try { 83 await webglcontextrestored; 84 if (expectRestoreIgnored) 85 testFailed("Expected restore be ignored, but it was not."); 86 else 87 shouldBeFalse("gl.isContextLost()"); 88 } catch (e) { 89 if (e) 90 throw e; 91 if (!expectRestoreIgnored) 92 testFailed("Did not expect restore be ignored, but it was."); 93 else 94 shouldBeTrue("gl.isContextLost()"); 95 } 96 97 wtu.glErrorShouldBe(gl, gl.NO_ERROR); 98 } 99 100 function loseContext(gl, WEBGL_lose_context) 101 { 102 if (!WEBGL_lose_context) { 103 testFailed("Could not find WEBGL_lose_context extension"); 104 return; 105 } 106 let wasLost = gl.isContextLost(); 107 WEBGL_lose_context.loseContext(); 108 if (wasLost) 109 wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION); 110 return true; // Request for restore is ignored. 111 } 112 113 function manyContexts() 114 { 115 // This causes the older contexts to be lost, including the first one we created 116 // for testing. 117 const contexts = [] 118 for (let i = 0; i < 50; ++i) 119 contexts.push(document.createElement("canvas").getContext("webgl")); 120 return true; // Request for restore is ignored. 121 } 122 123 function gpuStatusFailure(gl) 124 { 125 internals.simulateEventForWebGLContext("GPUStatusFailure", gl); 126 gl.clear(gl.COLOR_BUFFER_BIT); 127 return true; // Request for restore is honored. 128 } 129 130 function nothing() 131 { 132 return false; 133 } 134 135 const loseMethods = [loseContext, manyContexts]; 136 if (window.internals) 137 loseMethods.push(gpuStatusFailure); 138 139 const subcases = []; 140 for (const loseMethod of loseMethods) 141 for (const loseMethod2 of loseMethods.concat(nothing)) 142 subcases.push({loseMethod, loseMethod2}); 143 144 async function test() 145 { 146 for (let subcase of subcases) 147 await runTest(subcase); 148 finishTest(); 20 149 } 21 150 </script> 151 </body> 152 </html> -
trunk/Source/WebCore/ChangeLog
r291476 r291477 1 2022-03-18 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 Recycling a webgl context when it has been lost and restored causes a crash 4 https://bugs.webkit.org/show_bug.cgi?id=238024 5 6 Reviewed by Geoffrey Garen. 7 8 Simulated context lost makes WebGLRenderingContextBase::m_context = nullptr 9 Real context lost preserves WebGLRenderingContextBase::m_context. 10 11 WebGLRenderingContextBase::maybeRestoreContext() used m_context. 12 13 The intention was that simulated context lost never invokes maybeRestoreContext() 14 as the timer to run maybeRestoreContext() is started only on real context lost. 15 16 However, it is possible to invoke simulated context lost after a real context lost, 17 but before the timer triggers maybeRestoreContext(). 18 19 The sequence would be: 20 1. Lose the context somehow 21 2. Wait for webglcontextlost, use event.preventDefault() to request a restore. 22 3. Before restore happens, lose the context via simulated context lost. 23 This can be done by creating many contexts or via the WEBGL_lose_context.loseContext(). 24 4. maybeRestoreContext() would query m_context->getGraphicsResetStatusARB() for 25 console log reasons, trying to explain to the developer why the context was lost. 26 In case simulated context lost set the m_context == nullptr, this would crash. 27 28 getGraphicsResetStatusARB() has likely not been accurate for any platform ever. 29 For ANGLE, it is unimplemented and cannot pinpoint which context caused the context lost. 30 Just remove getGraphicsResetStatusARB() use from maybeRestoreContext(), this prevents 31 the crash. Remove it also from WebKit use altogether, it is never used for anything. 32 33 Adds the case to webgl/max-active-contexts-webglcontextlost-prevent-default.html 34 35 * html/canvas/WebGLRenderingContextBase.cpp: 36 (WebCore::WebGLRenderingContextBase::loseContextImpl): 37 (WebCore::WebGLRenderingContextBase::maybeRestoreContext): 38 * loader/FrameLoaderClient.h: 39 * platform/graphics/GraphicsContextGL.h: 40 * platform/graphics/angle/GraphicsContextGLANGLE.cpp: 41 * platform/graphics/angle/GraphicsContextGLANGLE.h: 42 * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: 43 * platform/graphics/opengl/ExtensionsGLOpenGLCommon.h: 44 * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: 45 * platform/graphics/opengl/ExtensionsGLOpenGLES.h: 46 * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: 47 * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 48 1 49 2022-03-18 Cameron McCormack <heycam@apple.com> 2 50 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
r291468 r291477 6453 6453 m_contextLostMode = mode; 6454 6454 6455 if (mode == RealLostContext) {6456 // Inform the embedder that a lost context was received. In response, the embedder might6457 // decide to take action such as asking the user for permission to use WebGL again.6458 auto* canvas = htmlCanvas();6459 if (canvas) {6460 if (RefPtr<Frame> frame = canvas->document().frame())6461 frame->loader().client().didLoseWebGLContext(m_context->getGraphicsResetStatusARB());6462 }6463 }6464 6465 6455 detachAndRemoveAllObjects(); 6466 6456 loseExtensions(mode); … … 7772 7762 return; 7773 7763 7774 int contextLostReason = m_context->getGraphicsResetStatusARB();7775 7776 switch (contextLostReason) {7777 case GraphicsContextGL::NO_ERROR:7778 // The GraphicsContextGLOpenGL implementation might not fully7779 // support GL_ARB_robustness semantics yet. Alternatively, the7780 // WEBGL_lose_context extension might have been used to force7781 // a lost context.7782 break;7783 case GraphicsContextGL::GUILTY_CONTEXT_RESET_ARB:7784 // The rendering context is not restored if this context was7785 // guilty of causing the graphics reset.7786 printToConsole(MessageLevel::Warning, "WARNING: WebGL content on the page caused the graphics card to reset; not restoring the context");7787 return;7788 case GraphicsContextGL::INNOCENT_CONTEXT_RESET_ARB:7789 // Always allow the context to be restored.7790 break;7791 case GraphicsContextGL::UNKNOWN_CONTEXT_RESET_ARB:7792 // Warn. Ideally, prompt the user telling them that WebGL7793 // content on the page might have caused the graphics card to7794 // reset and ask them whether they want to continue running7795 // the content. Only if they say "yes" should we start7796 // attempting to restore the context.7797 printToConsole(MessageLevel::Warning, "WARNING: WebGL content on the page might have caused the graphics card to reset");7798 break;7799 }7800 7801 7764 auto* canvas = htmlCanvas(); 7802 7765 if (!canvas) -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r289790 r291477 341 341 #if ENABLE(WEBGL) 342 342 virtual bool allowWebGL(bool enabledPerSettings) { return enabledPerSettings; } 343 // Informs the embedder that a WebGL canvas inside this frame received a lost context344 // notification with the given GL_ARB_robustness guilt/innocence code (see GraphicsContextGL.h).345 virtual void didLoseWebGLContext(int) { }346 343 virtual WebGLLoadPolicy webGLPolicyForURL(const URL&) const { return WebGLLoadPolicy::WebGLAllowCreation; } 347 344 virtual WebGLLoadPolicy resolveWebGLPolicyForURL(const URL&) const { return WebGLLoadPolicy::WebGLAllowCreation; } -
trunk/Source/WebCore/platform/graphics/GraphicsContextGL.h
r291468 r291477 1376 1376 virtual bool isExtensionEnabled(const String&) = 0; 1377 1377 1378 // GL_ARB_robustness1379 // Note: This method's behavior differs from the GL_ARB_robustness1380 // specification in the following way:1381 // The implementation must not reset the error state during this call.1382 // If getGraphicsResetStatusARB returns an error, it should continue1383 // returning the same error. Restoring the GraphicsContextGLOpenGL is handled1384 // externally.1385 virtual GCGLint getGraphicsResetStatusARB() = 0;1386 1387 1378 // GL_ANGLE_translated_shader_source 1388 1379 virtual String getTranslatedShaderSourceANGLE(PlatformGLObject) = 0; -
trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp
r291399 r291477 2924 2924 } 2925 2925 2926 GLint GraphicsContextGLANGLE::getGraphicsResetStatusARB()2927 {2928 return GraphicsContextGL::NO_ERROR;2929 }2930 2931 2926 String GraphicsContextGLANGLE::getTranslatedShaderSourceANGLE(PlatformGLObject shader) 2932 2927 { -
trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h
r291399 r291477 330 330 void ensureExtensionEnabled(const String&) override; 331 331 bool isExtensionEnabled(const String&) override; 332 GCGLint getGraphicsResetStatusARB() override;333 332 void drawBuffersEXT(GCGLSpan<const GCGLenum>) override; 334 333 String getTranslatedShaderSourceANGLE(PlatformGLObject) override; -
trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp
r289790 r291477 160 160 } 161 161 162 int ExtensionsGLOpenGLCommon::getGraphicsResetStatusARB()163 {164 return GraphicsContextGL::NO_ERROR;165 }166 167 162 String ExtensionsGLOpenGLCommon::getTranslatedShaderSourceANGLE(PlatformGLObject shader) 168 163 { -
trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.h
r289790 r291477 44 44 virtual void ensureEnabled(const String&); 45 45 virtual bool isEnabled(const String&); 46 virtual int getGraphicsResetStatusARB();47 46 virtual String getTranslatedShaderSourceANGLE(PlatformGLObject); 48 47 virtual void drawBuffersEXT(GCGLSpan<const GCGLenum> bufs) = 0; … … 58 57 virtual void vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) = 0; 59 58 60 // EXT Robustness - uses getGraphicsResetStatusARB()59 // EXT Robustness 61 60 virtual void readnPixelsEXT(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, void *data); 62 61 virtual void getnUniformfvEXT(GCGLuint program, int location, GCGLsizei bufSize, float *params); -
trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLES.cpp
r289790 r291477 167 167 } 168 168 169 int ExtensionsGLOpenGLES::getGraphicsResetStatusARB()170 {171 // FIXME: This does not call getGraphicsResetStatusARB, but instead getGraphicsResetStatusEXT.172 // The return codes from the two extensions are identical and their purpose is the same, so it173 // may be best to rename getGraphicsResetStatusARB() to getGraphicsResetStatus().174 if (m_contextResetStatus != GL_NO_ERROR)175 return m_contextResetStatus;176 if (m_glGetGraphicsResetStatusEXT) {177 int reasonForReset = GraphicsContextGL::UNKNOWN_CONTEXT_RESET_ARB;178 if (m_context->makeContextCurrent())179 reasonForReset = m_glGetGraphicsResetStatusEXT();180 if (reasonForReset != GL_NO_ERROR)181 m_contextResetStatus = reasonForReset;182 return reasonForReset;183 }184 185 m_context->synthesizeGLError(GL_INVALID_OPERATION);186 return false;187 }188 189 169 void ExtensionsGLOpenGLES::readnPixelsEXT(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, void *data) 190 170 { -
trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLES.h
r289790 r291477 99 99 void vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) override; 100 100 101 // EXT Robustness - reset102 int getGraphicsResetStatusARB() override;103 104 101 // EXT Robustness - etc 105 102 void readnPixelsEXT(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, void *data) override; -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.cpp
r291399 r291477 3071 3071 } 3072 3072 3073 GLint GraphicsContextGLOpenGL::getGraphicsResetStatusARB()3074 {3075 return getExtensions().getGraphicsResetStatusARB();3076 }3077 3078 3073 void GraphicsContextGLOpenGL::drawBuffersEXT(GCGLSpan<const GCGLenum> buffers) 3079 3074 { -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h
r291399 r291477 373 373 void ensureExtensionEnabled(const String&) final; 374 374 bool isExtensionEnabled(const String&) final; 375 GLint getGraphicsResetStatusARB() final;376 375 void drawBuffersEXT(GCGLSpan<const GCGLenum>) override; 377 376 String getTranslatedShaderSourceANGLE(PlatformGLObject) final; -
trunk/Source/WebKit/ChangeLog
r291475 r291477 1 2022-03-18 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 Recycling a webgl context when it has been lost and restored causes a crash 4 https://bugs.webkit.org/show_bug.cgi?id=238024 5 6 Reviewed by Geoffrey Garen. 7 8 Remove GraphicsContextGL::getGraphicsResetStatusARB(), it's unused now. 9 10 * GPUProcess/graphics/RemoteGraphicsContextGL.messages.in: 11 * GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h: 12 (getActiveUniformBlockiv): 13 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: 14 (WebKit::RemoteGraphicsContextGLProxy::paintRenderingResultsToCanvas): 15 (WebKit::RemoteGraphicsContextGLProxy::paintCompositedResultsToCanvas): 16 (WebKit::RemoteGraphicsContextGLProxy::markContextLost): 17 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h: 18 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp: 19 1 20 2022-03-18 Carlos Garcia Campos <cgarcia@igalia.com> 2 21 -
trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in
r291468 r291477 285 285 void UniformBlockBinding(uint32_t program, uint32_t uniformBlockIndex, uint32_t uniformBlockBinding) 286 286 void GetActiveUniformBlockiv(uint32_t program, uint32_t uniformBlockIndex, uint32_t pname, uint64_t paramsSize) -> (IPC::ArrayReference<int32_t> params) Synchronous 287 void GetGraphicsResetStatusARB() -> (int32_t returnValue) Synchronous288 287 void GetTranslatedShaderSourceANGLE(uint32_t arg0) -> (String returnValue) Synchronous 289 288 void DrawBuffersEXT(IPC::ArrayReference<uint32_t> bufs) -
trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h
r291032 r291477 1322 1322 completionHandler(IPC::ArrayReference<int32_t>(reinterpret_cast<int32_t*>(params.data()), params.size())); 1323 1323 } 1324 void getGraphicsResetStatusARB(CompletionHandler<void(int32_t)>&& completionHandler)1325 {1326 GCGLint returnValue = { };1327 assertIsCurrent(workQueue());1328 returnValue = m_context->getGraphicsResetStatusARB();1329 completionHandler(returnValue);1330 }1331 1324 void getTranslatedShaderSourceANGLE(uint32_t arg0, CompletionHandler<void(String&&)>&& completionHandler) 1332 1325 { -
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h
r291468 r291477 315 315 void uniformBlockBinding(PlatformGLObject program, GCGLuint uniformBlockIndex, GCGLuint uniformBlockBinding) final; 316 316 void getActiveUniformBlockiv(GCGLuint program, GCGLuint uniformBlockIndex, GCGLenum pname, GCGLSpan<GCGLint> params) final; 317 GCGLint getGraphicsResetStatusARB() final;318 317 String getTranslatedShaderSourceANGLE(PlatformGLObject arg0) final; 319 318 void drawBuffersEXT(GCGLSpan<const GCGLenum> bufs) final; -
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp
r291032 r291477 2268 2268 } 2269 2269 2270 GCGLint RemoteGraphicsContextGLProxy::getGraphicsResetStatusARB()2271 {2272 int32_t returnValue = { };2273 if (!isContextLost()) {2274 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetGraphicsResetStatusARB(), Messages::RemoteGraphicsContextGL::GetGraphicsResetStatusARB::Reply(returnValue));2275 if (!sendResult)2276 markContextLost();2277 }2278 return returnValue;2279 }2280 2281 2270 String RemoteGraphicsContextGLProxy::getTranslatedShaderSourceANGLE(PlatformGLObject arg0) 2282 2271 {
Note:
See TracChangeset
for help on using the changeset viewer.