Title: [286422] trunk/Source/WebCore
Revision
286422
Author
[email protected]
Date
2021-12-02 06:11:50 -0800 (Thu, 02 Dec 2021)

Log Message

REGRESSION(r286209) [GTK][WPE] crashes in offscreen canvas tests that try to create a GL context
https://bugs.webkit.org/show_bug.cgi?id=233712

Patch by Kimmo Kinnunen <[email protected]> on 2021-12-02
Reviewed by Antti Koivisto.

Fix a crash for ports that use offscreen canvas WebGL.
Currently we do not have code to navigate from offscreen canvas
CanvasBase to ChromeClient. For this case it doesn't matter, as
GPUP does not support offscreen canvas in meaningful way
anyway.

No new tests, tested by existing test.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (286421 => 286422)


--- trunk/Source/WebCore/ChangeLog	2021-12-02 12:51:10 UTC (rev 286421)
+++ trunk/Source/WebCore/ChangeLog	2021-12-02 14:11:50 UTC (rev 286422)
@@ -1,3 +1,21 @@
+2021-12-02  Kimmo Kinnunen  <[email protected]>
+
+        REGRESSION(r286209) [GTK][WPE] crashes in offscreen canvas tests that try to create a GL context
+        https://bugs.webkit.org/show_bug.cgi?id=233712
+
+        Reviewed by Antti Koivisto.
+
+        Fix a crash for ports that use offscreen canvas WebGL.
+        Currently we do not have code to navigate from offscreen canvas
+        CanvasBase to ChromeClient. For this case it doesn't matter, as
+        GPUP does not support offscreen canvas in meaningful way
+        anyway.
+
+        No new tests, tested by existing test.
+
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::create):
+
 2021-11-25  Sergio Villar Senin  <[email protected]>
 
         Reset height definiteness when constructing flex items

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (286421 => 286422)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2021-12-02 12:51:10 UTC (rev 286421)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2021-12-02 14:11:50 UTC (rev 286422)
@@ -860,7 +860,13 @@
         renderingContext->suspendIfNeeded();
         return renderingContext;
     }
-    auto context = hostWindow->createGraphicsContextGL(attributes);
+    RefPtr<GraphicsContextGL> context;
+    if (hostWindow)
+        context = hostWindow->createGraphicsContextGL(attributes);
+    else {
+        // FIXME: OffscreenCanvas does not support GPU process.
+        context = createWebProcessGraphicsContextGL(attributes);
+    }
     if (!context) {
         if (canvasElement) {
             canvasElement->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to