Seams between adjacent transformed layers

#401515597 Filed 2025-03-04 New

Reproducer

Two independently composited 100 x 100 images share an edge over a yellow backdrop. At non-integral browser zoom, the shared anti-aliased edge can expose a yellow seam.

Set browser zoom to 80%, 90%, 110%, or 125%, then move the phase control. The expected result is one continuous blue rectangle.

0.60px
live browser rendering; yellow at the image boundary is the failure
Expected continuous blue rectangle over yellow
Affected shared edge highlighted in magenta
Standalone sampler Stepper seam finder Animated transforms

Cause

Each image edge is blended separately with SrcOver. Complementary edge coverages therefore apply the backdrop twice at any shared edge that lands on a fractional device coordinate.

The fix removes the fractional edge at the source: layers composited solely for a 3d-transform reason (the translate3d map tile pattern) are snapped to the pixel grid in cc, reusing the same TransformTree snapping that scroll translations already get. With edges on integer device coordinates there is no partial coverage to mis-blend, no renderer changes are needed, and outer edges become crisp instead of anti-aliased. Composited translation animations get the same treatment: their subpixel paint offset residue is no longer baked into the rastered content, so a finished or fill: forwards animation settles on the pixel grid without a seam. will-change: transform and view transition layers are deliberately not snapped: will-change already discards subpixel translation, and view transition pseudos must preserve captured fractional geometry. Behind the SnapComposited2dTranslations blink runtime feature (enabled by default, kill switch). An earlier attempt fixed this at composite time in Viz (AccumulateAdjacentAAQuadCoverage) but was rejected for its O(n^2) quad analysis and forced shader blending.

Watch it on a patched build

Your browser likely does not have the patch, so the live reproducer above always shows the unfixed behavior. The capture below sweeps the phase control from 0 to 1px on the same patched build, twice: the left side runs with the SnapComposited2dTranslations kill switch (equivalent to an unpatched build) and the seam pulses in and out with the fractional phase; the right side runs the default and stays continuous. Device scale factor 1.1, tile area at 3x nearest-neighbor zoom.

Before / after

Captures from the same patched build at device scale factor 1.25 (headless, software compositing). "Before" runs with --disable-blink-features=SnapComposited2dTranslations, which is equivalent to an unpatched build; "after" is the default. Crops are 4x nearest-neighbor around the shared edge.

Case 1: adjacent composited image layers (this issue's repro)

before backdrop shows through the shared edge: rgb(46,46,207)
Before: vertical yellow-tinted seam between two blue image layers
after continuous rgb(0,0,255)
After: continuous blue, no seam

Two independently composited 100x100 images over yellow, translated to a fractional device position.

Case 2: adjacent solid color layers

before seam at the shared edge
Before: seam between two solid color layers
after continuous color
After: continuous color, no seam

Solid color layers skip rasterization and become SolidColorDrawQuads, so the raster-time seam mitigation never applied to them. Matches the open "adjacent solid color layers" rows in the issue 40084005 case sheet.

Case 3: map tiles (leaflet), fractional translation

before light seam line across dark tiles
Before: light seam line between dark map tiles
after tiles meet without a seam
After: map tiles meet without a seam

Leaflet-style pane: absolutely positioned tiles moved by translate3d, with the pane panned to a fractional offset; the same pattern as the leaflet tile case from the issue 40084005 case sheet, freemap.sk, and Google Maps tile seams. Both the vertical and the horizontal seam lines at the tile junction disappear.

Animated transforms

Earlier patchsets left compositor-animated transforms seaming: blink propagated the subpixel paint offset into the rastered content of translation-animated layers, and no compositor-side alignment can remove a fraction that is baked into the pixels. A finished animation kept filling with fill: forwards therefore seamed forever. PS18 discards that subpixel residue for composited transform animations too, so the content stays on the pixel grid and cc realigns the layer once the animation settles: running, fill: forwards, and committed-on-animationend are all clean. Static will-change: transform layers never seamed: blink already discards their subpixel translation.

Three cases on the patched build: running animation, finished fill-forwards animation, and value committed on animationend are all clean

All three captured on the patched build at DPR 1.1. Try it live: animated transforms sampler.