Skip to content

Blend geometry edge coverage in linear light - #89

Merged
ctate merged 1 commit into
mainfrom
fix/gamma-correct-shape-aa
Jul 10, 2026
Merged

ctate merged 1 commit into
mainfrom
fix/gamma-correct-shape-aa

Conversation

@ctate

@ctate ctate commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What

Anti-aliased fringes of opaque geometry — rounded rects, path fills and strokes (icons, charts, the checkbox mark) — now composite in linear light instead of sRGB space, which removes the dark rim sRGB blending grows on curved edges (the "still looks jagged despite AA" effect at 1x).

Scope discipline

  • Glyph coverage keeps sRGB blending: linear blending visibly changes text weight (thin light-theme text, blooming dark-theme text), and the macOS text pipeline composites in sRGB — text pins are byte-identical before/after
  • Translucent sources (washes, scrims, faded layers) keep sRGB blending everywhere, so overlay brightness is untouched
  • The blend space is a required parameter on the coverage path (no default) and unit tests pin the split in both directions, so it can never silently invert

Mechanism

LUT-based conversion (existing 256-entry decode table + a new 4096-entry encode table, ≤1 level vs exact) with an opaque-source fast path: interiors and washes never pay conversion. Fully covered pixels are bit-identical; the supersampled shape-fidelity test passes unchanged (it pins coverage, which is blend-space-invariant).

Verification

  • Shape goldens re-pinned from actual output with pixel review (diffs confined to corners/curves; e.g. the markdown fixture moved 728 pixels with max delta 1, zero in text)
  • Text-only pins unchanged; whole-frame census shows zero changed text pixels in either scheme
  • Full suite, validate, seven smokes, examples battery green; render budgets hold (deltas within run noise)

Note: the committed docs component-preview images render through these emitters and will show the old fringes until regenerated — follow-up, no CI check pins them.

- Anti-aliased fringes of opaque geometry (rounded rects, path fills and strokes) now composite in linear light through a LUT, removing the dark rim sRGB-space blending grows on curved edges; interiors stay byte-identical via an opaque fast path
- Glyph coverage and translucent sources keep sRGB blending so text weight and overlay brightness are unchanged, and tests pin the split in both directions
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
native-sdk Ready Ready Preview, Comment Jul 10, 2026 1:00pm

@ctate
ctate merged commit e71338f into main Jul 10, 2026
21 checks passed
@ctate ctate mentioned this pull request Jul 10, 2026
ctate added a commit that referenced this pull request Jul 10, 2026
- Bump @native-sdk/cli and platform packages to 0.4.3.

- Mark the v0.4.3 changelog entry for #89, #90, and #92.

- Remove changelog fragments merged into the release notes.

This branch was successfully deployed

1 active deployment
Preview — c945084d Deployed Jul 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant