Repository navigation
fix(skia): Outset damage clip to cover AA fringe at fractional scales - #24031
Conversation
The per-present damage clip is intentionally non-antialiased so boundary pixels aren't blended against the retained surface, but that makes it include only device pixels whose centers lie inside the damage region, while AA rendering also writes pixels whose centers lie outside the geometry. The record-side 2px outset protects content edges, yet wherever the damage region is intersected with an ancestor clip its edge coincides exactly with an AA-rendered clip edge with no margin. At fractional rasterization scales (e.g. 150%) those edges land between device pixels, so the written AA fringe is permanently excluded from replay and accumulates as stale stripe artifacts under translate animations (popup + clipped track + static overlay). Outset the present clip by one device pixel (stroke-and-union, still non-AA). The replayed picture is the full frame, so over-covering is always correct. Runtime-validated A/B on a 150%-scale GPU machine: stripes reproduce with the raw clip and disappear with the outset applied. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR addresses GPU-backed Skia rendering artifacts at fractional rasterization scales by expanding the present-time damage clip so antialiased fringe pixels are also repainted, preventing stale 1px stripe accumulation (notably in Popup scenarios with ancestor clipping).
Changes:
- Added
OutsetDamageForPresentto expand the damage clip by ~1 device pixel via stroke-and-union. - Updated the Skia
Drawpath to clip using the out-set damage region (still non-antialiased).
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24031/wasm-skia-net9/index.html |
|
The build 226774 found UI Test snapshots differences: Details
|
Co-Authored-By: Claude Fable 5 <[email protected]>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24031/wasm-skia-net9/index.html |
|
The build 226834 found UI Test snapshots differences: Details
|
|
Tick the box to add this pull request to the merge queue (same as
|
|
@Mergifyio backport release/stable/6.7 |
✅ Backports have been createdDetails
|
…6.7/pr-24031 fix(skia): Outset damage clip to cover AA fringe at fractional scales (backport #24031)
GitHub Issue: closes unoplatform/kahua-private#534
PR Type:
🐞 Bugfix
What changed? 🚀
Current behavior: at fractional rasterization scales (e.g. 150% display scale) on GPU-backed Skia hosts, a translate-animated element inside a
Popup— with an ancestor clip cutting its damage region and static content drawn above it — leaves stale ≤1px stripe artifacts across the vacated area (see the linked issue: TabBarSlideselection indicator).Root cause: the per-present damage clip in
CompositionTarget.Drawis intentionally non-antialiased (so boundary pixels aren't blended against the retained surface), which means it includes only device pixels whose centers lie inside the damage region. Rendering, however, is antialiased and also writes fringe pixels whose centers lie outside the drawn geometry. The record side already outsets content edges by 2px (OutsetForAntialiasing), but whereverTryGetPaintDamageRegionintersects the damage region with an ancestor clip, the damage edge coincides exactly with an AA-rendered clip edge — zero margin. At integer scales those edges are device-pixel-aligned so no fringe exists (the "regions are pixel-snapped" premise of the original non-AA choice); at fractional scales they land between device pixels, and the written AA fringe is permanently excluded from every replay, accumulating as stripes.This PR: outsets the present-time damage clip by exactly one device pixel (stroke-and-union,
OutsetDamageForPresent). The clip stays non-antialiased, preserving the original rationale; the replayed picture is always the full frame, so over-covering is correct by construction.Validation: runtime A/B on a 150%-scale machine with a real GPU (Win32
GlRenderer): stripes reproduce with the raw clip and disappear with the outset applied, in the same binary with the outset toggled.PR Checklist ✅
DirtyRectangles_*manual samples cover the damage-region pipeline)Screenshots Compare Test Runresults.🤖 Generated with Claude Code