Files
harfbuzz/test/api
Behdad Esfahbod dde1f1baee [gpu] Assign curves to bands using quantized bounds (#6132)
The fragment shader picks one horizontal and one vertical band from
the fragment position and walks only that band's curve list, so a
curve must be listed in every band its bounding box reaches into.

The encoder computed those bounding boxes from the unquantized
control points, but the shader only ever sees the coordinates after
they are rounded to quarter font units.  When rounding pushed a
curve's extreme across a band boundary, the curve was left out of the
band it now reached into.  Fragments landing in that sliver never saw
the curve, so their winding number was off by one and the pixel came
out empty in the middle of a filled area -- a thin black line through
the glyph, appearing and disappearing as the font size moves the
pixel grid.

The rounding error is at most an eighth of a font unit, so this is
invisible for an integer-coordinate glyph rendered at its own upem.
It gets easy to hit when the coordinates are fractional: CFF glyphs
after cu2qu, or any font whose hb_font_t scale is not its upem.  With
hb_font_set_scale(font, 163, 163), as in issue #6131, more than half
of the glyphs of util/gpu/default-font.ttf had at least one band the
shader could reach but that did not list the curve.

Compute the bounds (and the is_horizontal/is_vertical tests) from the
quantized control points instead, and widen the band range by 1/1024
of a band so that the double arithmetic here cannot disagree with the
shader's float32 band index right at a boundary.

Verified with a CPU port of _hb_gpu_slug_single: comparing the banded
lookup against a walk over every curve of the glyph, at sizes 39, 47
and 107 with scale 163, default-font.ttf had 27 wrong pixels before
and none after.  Encoded atlas size grows by 0.12%.

Adds test_encode_band_membership, which checks the invariant directly
on the encoded blob and fails before this change.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 22:41:56 -06:00
..
2026-07-31 04:31:26 +03:00
2025-04-06 18:08:50 -06:00
2025-06-08 13:43:27 +03:00
2026-07-30 19:02:25 -06:00
2026-07-31 04:31:26 +03:00
2025-04-05 22:37:10 -06:00
2026-02-13 15:06:01 -07:00
2020-01-31 16:37:30 -05:00
2020-01-29 10:21:00 -05:00
2020-01-15 13:36:01 -08:00
2026-07-14 16:26:49 -06:00
2025-09-10 12:15:49 -04:00
2025-06-08 13:43:27 +03:00