Expand description
Compositing 8-bit coverage masks.
An anti-aliased glyph is a rectangle of coverage values, and drawing it is the single most repeated operation a text-heavy panel performs. The M1 benches measured the per-pixel path at 31 Mpx/s against 457 Mpx/s for the span path on a Pi 3 — fifteen times slower — and predicted that glyphs would be where that gap gets paid. This is the code that stops it being paid.
The trick is that a mask is mostly not partial. The interior of a glyph is solid 255 and everything outside it is 0; only the rim is in between. So the blitter walks each row in runs, sends solid runs through the span blend, skips empty runs entirely, and pays the per-pixel cost only on the edge.
Structs§
- Mask
- A borrowed 8-bit coverage mask:
0transparent,255fully covered.