Bug 240380
Summary: | Capturing a canvas that is not in the DOM can lead to erratic frame rates or no frame emission at all | ||
---|---|---|---|
Product: | WebKit | Reporter: | youenn fablet <youennf> |
Component: | Media | Assignee: | Dan Glastonbury <djg> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | claudio.destro, eric.carlson, kkinnunen, sabouhallawa, simon.fraser, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
youenn fablet
Capturing a canvas that is not in the DOM can lead to erratic frame rates or no frame emission at all
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/93239022>
Said Abou-Hallawa
Test case is https://jsfiddle.net/0b3dqxeg/
Claudio Destro
Hi hope this helps:
in our solution, canvas with CSS fixed position works
Claudio Destro
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
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
Pull request: https://github.com/WebKit/WebKit/pull/901
EWS
Committed r294864 (250996@main): <https://commits.webkit.org/250996@main>
Reviewed commits have been landed. Closing PR #901 and removing active labels.