captureStream() flattens a display-p3 canvas to Rec.709
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
| path | frame | tagged | decodes to |
| 2D / ARGB readback | BGRA |
bt709 / iec61966-2-1 / rgb / full |
rgb(255, 103, 42) |
| WebGL / NV12 copy | NV12 |
bt709 / bt709 / bt709 / limited |
rgb(255, 103, 42) |
--disable-blink-features=CanvasCaptureColorSpacePropagation
feature on: frames carry the canvas primaries
display-p3 kept
| path | frame | tagged | decodes to |
| 2D / ARGB readback | BGRA |
smpte432 / iec61966-2-1 / rgb / full |
rgb(255, 103, 42) |
| WebGL / NV12 copy | NV12 |
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
| path | frame | tagged | decodes to |
| 2D / ARGB readback | BGRA |
bt709 / iec61966-2-1 / rgb / full |
rgb(255, 103, 42) |
| WebGL / YUV readback | I420 |
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
| path | frame | tagged | decodes to |
| 2D / ARGB readback | BGRA |
smpte432 / iec61966-2-1 / rgb / full |
rgb(255, 103, 42) |
| WebGL / YUV readback | I420 |
smpte432 / iec61966-2-1 / smpte170m / limited |
rgb(255, 103, 44) |
--gmb-readback-from-texture-disabled-for-debugging
The stack
- 8666829 - keep the canvas color
space on captured YUV frames instead of writing Rec.709 metadata over
display-p3 samples
- 8766177 - give canvas capture an
explicit fixed mode and canvas mode, so each path states which color space
it produces; the kill switch selects the mode
- 8766317 - pass a destination
color space to
glReadbackYUVImagePixelsINTERNAL, so the
single-plane YUV readback converts instead of only being relabeled