RESOLVED FIXED 240380
Capturing a canvas that is not in the DOM can lead to erratic frame rates or no frame emission at all
https://bugs.webkit.org/show_bug.cgi?id=240380
Summary Capturing a canvas that is not in the DOM can lead to erratic frame rates or ...
youenn fablet
Reported 2022-05-13 05:05:20 PDT
Capturing a canvas that is not in the DOM can lead to erratic frame rates or no frame emission at all
Attachments
Radar WebKit Bug Importer
Comment 1 2022-05-13 05:05:45 PDT
Said Abou-Hallawa
Comment 2 2022-05-13 11:49:39 PDT
Claudio Destro
Comment 3 2022-05-16 23:10:56 PDT
Hi hope this helps: in our solution, canvas with CSS fixed position works
Claudio Destro
Comment 4 2022-05-16 23:15:39 PDT
Example missing (sorry): modify the test case to: <canvas id="canvas2" style="position: fixed; bottom: 0; right: 0; width: 100px"></canvas> videos still not playing in 15.4 desktop (they show a red background and nothing else happens)
youenn fablet
Comment 5 2022-05-17 02:39:00 PDT
I did some investigations: - CanvasCaptureMediaStreamTrack::Source::canvasChanged is correctly called each time the not-in-dom canvas is changed but it returns early due to m_canvas->renderingContext()->needsPreparationForDisplay() returning true. - Normally, the page will call updateRendering which will make the actual preparation happening, which in turn will tell CanvasCaptureMediaStreamTrack::Source to generate a frame. This is what happens when canvas is in the DOM. When canvas is not in the DOM, Page::updateRendering is not called as often and this impacts the canvas track frame rate.
Dan Glastonbury
Comment 6 2022-05-22 21:18:37 PDT
EWS
Comment 7 2022-05-25 20:16:07 PDT
Committed r294864 (250996@main): <https://commits.webkit.org/250996@main> Reviewed commits have been landed. Closing PR #901 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.