NEW 270955
Canvas rendering issue in Safari causing delayed rendering compared to Chrome
https://bugs.webkit.org/show_bug.cgi?id=270955
Summary Canvas rendering issue in Safari causing delayed rendering compared to Chrome
Kapil Sardana
Reported 2024-03-13 21:21:18 PDT
Created attachment 470359 [details] Sample App where this issue can be replicated. I am encountering an issue with canvas rendering in Safari, where my drawing application, functioning smoothly on Chrome, exhibits delayed rendering behavior in Safari. Specifically, when clicking a button to draw a triangle on the canvas, it often requires multiple clicks (sometimes 3-4) to render the triangle as expected. Observations: Adding glFinish() after glDrawArrays resolves the issue, while glFlush() does not. Confirmed that the main thread is not blocked during the rendering process through logging. Attempted to call emscripten_webgl_commit_frame() after glDrawArrays at regular intervals, but the issue persists. The function consistently returns EMSCRIPTEN_RESULT_SUCCESS. Steps to Reproduce: Open the drawing application in Safari. Click the button to draw a triangle on the canvas. Observe that the triangle does not render on the first click and may require multiple clicks for rendering.
Attachments
Sample App where this issue can be replicated. (259.92 KB, application/zip)
2024-03-13 21:21 PDT, Kapil Sardana
no flags
Radar WebKit Bug Importer
Comment 1 2024-03-20 21:23:13 PDT
Mike Wyrzykowski
Comment 2 2024-07-08 14:19:40 PDT
Would be interesting to know if you reproduce in Chrome if you enable the Angle Metal backend in chrome://flags/
Kenneth Russell
Comment 3 2024-07-08 16:26:26 PDT
I've just tested this on Chrome 128.0.6559.0 (Official Build) dev (arm64) with ANGLE's Metal backend enabled (note, the example's Python script for running a local https server is important, since the test case uses SharedArrayBuffer and WebAssembly threads), and the triangle shows up reliably when clicking the button. The problem in Safari - assuming Chrome's behavior is correct - is probably related to reliable presentation of an OffscreenCanvas rendered on a background thread.
Kimmo Kinnunen
Comment 4 2024-07-30 06:12:48 PDT
Note, this is a known issue and being addressed in the linked bugs.
Deleted User
Comment 5 2025-03-24 01:46:18 PDT
Wondering if https://bugs.webkit.org/show_bug.cgi?id=290042 could be related.
Note You need to log in before you can comment on or make changes to this bug.