hb-cairo hands the actual rendering to cairo, so the work done per
paint operation (clip, gradient, compositing) is cairo's, not ours.
Any count we keep is a guess. The guesses we had were not good:
022a9e475 charged each paint
(1 + clip + path segments) x max(weight, segments), with a weight of
up to 8192, against HB_BUDGET_GLYPH. Real fonts blow through that.
For example, hb-view renders the Spain flag in Noto-COLRv1 (U+1F1EA
U+1F1F8) as a blank image, and about ten glyphs in that font go over.
Remove the budget accounting from hb-cairo:
- Revert 022a9e475 "[cairo] Charge compositing operations to the
glyph budget", with its test font and generator.
- Revert 8f3ab5ab8 "[cairo] Share work across nested glyph
rendering": the per-scaled-font hb_cairo_budget_t, the segment
charges in the draw callbacks, and the set/get budget callbacks
on the cairo draw and paint funcs.
Keep paint_color_glyph declining (fd8c9209b), so COLR paints nested
glyphs inline under the decycler and nesting limits of the walk in
progress. Going through cairo_show_glyphs() again would bring back
the PaintColrGlyph cycle crash, which test_hb_cairo_color_glyph_cycle
covers. Only the code comment loses its mention of work limits.
Testing: meson test -C build: 299 OK, 1 skipped. The Spain flag
renders again, and the PaintColrGlyph cycle glyphs in
test_glyphs-glyf_colr_1.ttf render without crashing.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>