What this checks
This sampler checks whether ctx.globalCompositeOperation = "plus-darker" is accepted and whether a few pixels match the CSSWG/WebKit-aligned formula.
Fix CLs: Skia 1273117 adds SkBlendMode::kPlusDarker; Chromium 7966179 wires it into Blink canvas compositing and adds an upstreamable WPT, css/compositing/canvas-plus-darker.html.
alpha = min(1, sourceAlpha + destinationAlpha)
color = max(0, alpha - min(1,
sourceAlpha * (1 - sourceColor) + destinationAlpha * (1 - destinationColor)))
On unpatched Chromium, assignment falls back to source-over. On a patched build, the reported operation remains plus-darker and the pixel checks pass.
Live result
Rendered
Expected pattern
left to right: transparent red over blue, half red over half blue, opaque gray over black.
Pixel checks
| case | actual rgba | expected rgba | result |
|---|
Links followed
- w3c/fxtf-drafts#447: CSSWG resolved to define plus-darker from Safari/WebKit research.
- w3c/csswg-drafts#9276: view transitions should use plus-lighter or plus-darker based on color-scheme.
- Chromium issue 40281895: dependent view-transition color-scheme work.
- WPT PR 41713: canvas composite-mode test used for RED/GREEN validation.
- Skia CL 1273117: adds the plus-darker blend mode implementation.
- Chromium CL 7966179: exposes plus-darker to canvas globalCompositeOperation and adds
canvas-plus-darker.html.