captureStream() flattens a display-p3 canvas to Rec.709

#40261346 CL 8666829 CL 8766177 CL 8766317 live sampler results.json

The sampler fills a display-p3 2D canvas and a display-p3 WebGL canvas with the same color, pulls one VideoFrame out of captureStream() through MediaStreamTrackProcessor, and decodes that frame into a 1x1 sRGB canvas. The screenshots are the four swatches; the numbers below each one are what the frame was tagged with and what it decodes to.

Same content_shell build for every run (all three CLs applied), SwiftShader under Xvfb. The feature-off runs use the kill switch, the readback runs disable the accelerated NV12 copy so the single-plane YUV readback is taken instead. Canvas color is rgb(255, 103, 42) in sRGB in all runs.

Accelerated NV12 copy -- CL 8666829 / CL 8766177

feature off: frames are relabeled Rec.709

gamut flattened
2D canvas, captured frame, WebGL canvas, captured frame
pathframetaggeddecodes to
2D / ARGB readbackBGRA bt709 / iec61966-2-1 / rgb / full rgb(255, 103, 42)
WebGL / NV12 copyNV12 bt709 / bt709 / bt709 / limited rgb(255, 103, 42)
--disable-blink-features=CanvasCaptureColorSpacePropagation

feature on: frames carry the canvas primaries

display-p3 kept
2D canvas, captured frame, WebGL canvas, captured frame
pathframetaggeddecodes to
2D / ARGB readbackBGRA smpte432 / iec61966-2-1 / rgb / full rgb(255, 103, 42)
WebGL / NV12 copyNV12 smpte432 / iec61966-2-1 / bt709 / limited rgb(255, 102, 44)
(no flags)

Single-plane YUV readback -- CL 8766317

feature off: readback converts into Rec.601 and clips the gamut

gamut flattened
2D canvas, captured frame, WebGL canvas, captured frame
pathframetaggeddecodes to
2D / ARGB readbackBGRA bt709 / iec61966-2-1 / rgb / full rgb(255, 103, 42)
WebGL / YUV readbackI420 smpte170m / smpte170m / smpte170m / limited rgb(255, 95, 45)
--disable-blink-features=CanvasCaptureColorSpacePropagation --gmb-readback-from-texture-disabled-for-debugging

feature on: readback converts into the canvas color space

display-p3 kept
2D canvas, captured frame, WebGL canvas, captured frame
pathframetaggeddecodes to
2D / ARGB readbackBGRA smpte432 / iec61966-2-1 / rgb / full rgb(255, 103, 42)
WebGL / YUV readbackI420 smpte432 / iec61966-2-1 / smpte170m / limited rgb(255, 103, 44)
--gmb-readback-from-texture-disabled-for-debugging

The stack