Bug 252795 - [WebGL] Avoid using glReadPixels to paint WebGL canvas into 2D canvas
Summary: [WebGL] Avoid using glReadPixels to paint WebGL canvas into 2D canvas
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dan Glastonbury
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-02-22 20:59 PST by Dan Glastonbury
Modified: 2023-04-03 13:44 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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