Bug 218186

Summary: CanvasCaptureMediaStreamTrack enables WebGL drawing buffer preserving and changes clear semantics
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dino, jonlee, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=218187
https://bugs.webkit.org/show_bug.cgi?id=217211

Description Kimmo Kinnunen 2020-10-26 06:36:01 PDT
CanvasCaptureMediaStreamTrack enables WebGL drawing buffer preserving

This changes de-facto observable behavior, as websites expect rAF to prepare the drawing buffer for display.

Web sites in general sometimes depend on the buffer clearing semantics.
Comment 1 Kimmo Kinnunen 2020-10-26 06:38:43 PDT
Marking as blocking WebGL GPU Process work, since this is buggy that would need to be implemented in remote WebGL.

This should be instead fixed by introducing a canvas monitoring callback for drawing buffer prepare and calling that before the buffer is being prepared for display.
Comment 2 Radar WebKit Bug Importer 2020-11-02 05:36:19 PST
<rdar://problem/70946812>
Comment 3 Kimmo Kinnunen 2021-03-06 04:43:59 PST
So the purpose of the feature is to take the webgl canvas contents and send it through webrtc, if I understand correctly.

What the implementation does is:
1) Turn on WebGL "preserve drawing buffer" flag of the webgl context.
2) Takes a snapshot of the webgl canvas contents at random point in time after each modification when the execution drops to main loop
3) send that picture over webrtc

Steps 1 and 2 are not good.