captureStream is getting black frames with webgl canvas
Created attachment 305941 [details] Patch
(In reply to youenn fablet from comment #0) > captureStream is getting black frames with webgl canvas Regression is due to the timer introduced to not produce too many frames.
Created attachment 305979 [details] Fixing release builds
Comment on attachment 305979 [details] Fixing release builds View in context: https://bugs.webkit.org/attachment.cgi?id=305979&action=review > Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:136 > + if (canvas.renderingContext() && canvas.renderingContext()->isWebGL()) > + static_cast<WebGLRenderingContextBase*>(canvas.renderingContext())->preserveDrawingBuffer(); Doing this does have a negative performance effect on the WebGL context. Maybe until we have the recording synced with the endPaint, we should print a warning to the console saying this might be slow (if the context wasn't already created with preserveDrawingBuffer = true) > Source/WebCore/html/canvas/WebGLRenderingContextBase.h:210 > + void preserveDrawingBuffer() { m_attributes.preserveDrawingBuffer = true; } I think this should be setPreserveDrawingBuffer(bool), with a preserveDrawingBuffer() getter. > Source/WebCore/testing/Internals.h:590 > + std::optional<TrackFramePromise> m_nextFramePromise; Maybe m_nextTrackFramePromise?
Created attachment 306023 [details] Updated according review
(In reply to Dean Jackson from comment #4) > Comment on attachment 305979 [details] > Fixing release builds > > View in context: > https://bugs.webkit.org/attachment.cgi?id=305979&action=review > > > Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:136 > > + if (canvas.renderingContext() && canvas.renderingContext()->isWebGL()) > > + static_cast<WebGLRenderingContextBase*>(canvas.renderingContext())->preserveDrawingBuffer(); > > Doing this does have a negative performance effect on the WebGL context. > Maybe until we have the recording synced with the endPaint, we should print > a warning to the console saying this might be slow (if the context wasn't > already created with preserveDrawingBuffer = true) Added > > > Source/WebCore/html/canvas/WebGLRenderingContextBase.h:210 > > + void preserveDrawingBuffer() { m_attributes.preserveDrawingBuffer = true; } > > I think this should be setPreserveDrawingBuffer(bool), with a > preserveDrawingBuffer() getter. OK > > Source/WebCore/testing/Internals.h:590 > > + std::optional<TrackFramePromise> m_nextFramePromise; > > Maybe m_nextTrackFramePromise? OK
Created attachment 306076 [details] Patch for landing
Thanks for the review. > Doing this does have a negative performance effect on the WebGL context. > Maybe until we have the recording synced with the endPaint, we should print > a warning to the console saying this might be slow (if the context wasn't > already created with preserveDrawingBuffer = true) I added the log message and added a test to cover "preserveDrawingBuffer = true" case.
Comment on attachment 306076 [details] Patch for landing Clearing flags on attachment: 306076 Committed r214806: <http://trac.webkit.org/changeset/214806>
All reviewed patches have been landed. Closing bug.