Files
harfbuzz/test/api
Behdad Esfahbod dfee0d4380 [raster] Split outline and pixel budgets; drive them via public API
raster-paint reached into the rasterizer through two internal functions:
hb_raster_draw_set_external_work() to inject a shared work counter and
hb_raster_draw_get_edge_work() to read scanline cost back.  Both are gone.

The paint session now carries two budgets for two different resources:

 - The outline budget bounds glyph outline traversal and curve
   flattening.  It is the public draw/paint budget: raster-paint seeds the
   rasterizer with hb_draw_set_budget() before each glyph and reads the
   remainder back with hb_draw_get_budget_remaining(), so a whole COLR
   walk shares one budget without touching rasterizer internals.

 - The pixel budget bounds scanline and fill work, which scales with
   surface area, not outline complexity.  It is charged from the public
   extents of the rendered mask (and other pixel areas) and keeps its
   surface-sized default.  An unlimited outline policy disables it too.

Folding pixel work into the outline budget was why the default had to be
inflated by the surface passes; the two now live apart, so HB_BUDGET_GLYPH
is a pure outline budget and the surface scaling belongs to the pixel
budget.  Standalone hb_raster_draw is unchanged: it draws once, so its
scanline work needs no session budget, only its structural caps.

COLR drives only push_clip_glyph, whose seed/emit/readback is a single
self-contained step, so the aggregate outline budget is always conserved
across a COLR walk.  The push_clip_path_start/end pair spans client draw
calls; like push/pop it must be balanced by the client for the outline
budget to reconcile, and each render is still bounded by the rasterizer's
structural caps regardless.  hb_draw_set_budget() clamps a negative seed
to zero, so outline exhaustion does not latch across glyphs; an empty
mask can then be rendered once more, but that path is bounded by the
pixel budget.

Add a regression test that paints a real multi-layer COLR glyph into a
1x1 surface (unbounded pixel budget) and checks the outline budget both
aggregates the layers' work and bounds the walk.

Tests: meson test -C build (275/275 passed); the raster and gpu COLR
regression seeds complete in 0.40s and 0.44s.

Assisted-by: Claude <noreply@anthropic.com>
2026-08-27 16:53:55 -06:00
..
2025-04-06 18:08:50 -06: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-08-19 16:00:05 -06: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
2025-09-10 12:15:49 -04:00
2025-06-08 13:43:27 +03:00