mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 14:31:10 +01:00
Add push_clip_path_start / push_clip_path_end to the hb_paint_funcs_t vtable, for callers that want to clip paint output to an arbitrary shape (not just a glyph or rectangle). hb_draw_funcs_t *df = hb_paint_push_clip_path_start (pf, pd, &dd); hb_draw_move_to (df, dd, NULL, ...); hb_draw_line_to (df, dd, NULL, ...); ... hb_draw_close_path (df, dd, NULL); hb_paint_push_clip_path_end (pf, pd); /* paint ops here are clipped to the emitted path */ hb_paint_pop_clip (pf, pd); The backend hands back a draw_funcs + draw_data pair (transfer none) that accumulates the clip path; end() signals the caller is done drawing clip geometry and the accumulated path becomes an active clip. pop_clip closes the scope, symmetric with push_clip_glyph / push_clip_rectangle. Only public API and the nil vtable stubs land here. Backend implementations (hb-vector, hb-raster, hb-gpu) follow in separate commits. Partial: https://github.com/harfbuzz/harfbuzz/issues/5930 Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>