Capturing WebGL canvas through peer connection shows the image flipped
<rdar://problem/88043325>
https://youennf.github.io/webrtc-tests/src/content/capture/canvas-pc/ <-- shows the bug Note: The newer version of this fails to show anything: https://webrtc.github.io/samples/src/content/capture/canvas-pc/ <-- does not show stuff
Youenn Fablet 7:12 PM canvas-pc is using legacy APIs that we do not support and it messes up the script. https://github.com/webrtc/samples/pull/1511
Created attachment 450036 [details] WIP
Created attachment 450043 [details] Patch
Comment on attachment 450043 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=450043&action=review > Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:556 > + // TODO: When this is moved to GraphicsContextGLCocoa, set m_mediaSampleRotationSession = nullptr. s/TODO/FIXME/ > LayoutTests/webrtc/canvas-to-peer-connection.html:80 > +// FIXME: Tthis should be filled when 2D context supports HTMLCanvasElement.captureStream(). Typo: Tthis
Created attachment 450107 [details] Simpler version
Created attachment 450112 [details] Simpler version
Comment on attachment 450112 [details] Simpler version View in context: https://bugs.webkit.org/attachment.cgi?id=450112&action=review > Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:791 > + return MediaSampleAVFObjC::createImageSample(WTFMove(mediaSamplePixelBuffer), MediaSampleAVFObjC::VideoRotation::None, false); When canvas is in GPUProcess, aren't we going the RemoteGraphicsContextGLProxyCocoa::paintCompositedResultsToMediaSample code path? It seems that RemoteGraphicsContextGLCocoa::prepareForDisplay should somehow do the flip if needed to remove the need for RemoteGraphicsContextGLProxyCocoa::paintCompositedResultsToMediaSample to make the sample as upsidedown+flipped.
Created attachment 450124 [details] For debugging
Created attachment 450129 [details] Patch
Created attachment 450227 [details] Patch
Created attachment 450229 [details] Patch
Committed r288789 (246566@main): <https://commits.webkit.org/246566@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 450229 [details].