Bug 252795

Summary: [WebGL] Avoid using glReadPixels to paint WebGL canvas into 2D canvas
Product: WebKit Reporter: Dan Glastonbury <djg>
Component: WebGLAssignee: Dan Glastonbury <djg>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, Hironori.Fujii, kbr, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   

Description Dan Glastonbury 2023-02-22 20:59:51 PST
Current codepath works like:

* Send request to read the back buffer to a pixel-buffer
* Create native image from pixel-buffer
* Draw native image to context 2D

We should try to do better especially when GPUP is enabled because this leads to:

* WP: Send request to read the back buffer to a pixel buffer
* GPUP: glReadPixels to a malloc buffer (WebCore::PixelBuffer)
* GPUP: Send the pixel buffer to WP
* WP: Creates native image out of that, sends that to GPUP
* GPUP: draws that native image to Context2D back-buffer
Comment 1 Dan Glastonbury 2023-02-22 21:01:05 PST
<rdar://87173127>
Comment 2 Dan Glastonbury 2023-02-22 21:07:51 PST
Pull request: https://github.com/WebKit/WebKit/pull/10560
Comment 3 EWS 2023-04-03 11:13:48 PDT
Committed 262518@main (50ae4e81ccce): <https://commits.webkit.org/262518@main>

Reviewed commits have been landed. Closing PR #10560 and removing active labels.
Comment 4 Fujii Hironori 2023-04-03 13:44:57 PDT
Regressed: Bug 254942 – REGRESSION(262518@main) [cairo] Crash under GraphicsContextGL::paintToCanvas