Cover since 14.1.0: GPU paint renderer (hb_gpu_paint_t), Vector
PDF output backend, SVG-in-OT glyph-source removal from Raster
and Vector, cross-subsystem _clear() companions and getter
companions, --output-file flag for hb-gpu, and fuzzer fixes.
List new / removed / changed API grouped by library.
Assisted-by: Claude <noreply@anthropic.com>
Replace the single-slot pending_clip / pending_clip_glyph /
pending_clip_font / pending_clip_transform fields with a stack of
up to HB_GPU_PAINT_MAX_CLIP_DEPTH (3) clips. push_clip_glyph
appends; pop_clip pops; depth > 3 sets `unsupported`.
LAYER_SOLID and LAYER_GRADIENT ops grow from 2 to 3 texels:
texel 0: (op_type, flags, clip1_hi, clip1_lo)
texel 1: (clip2_hi, clip2_lo, clip3_hi, clip3_lo)
texel 2: color (SOLID) or grad meta (GRADIENT)
The existing flags slot (i16) gains:
bit 0 IS_FOREGROUND (SOLID only -- was already there)
bit 8 HAS_CLIP2 (new)
bit 9 HAS_CLIP3 (new)
For GRADIENT the gradient subtype lives in bits 0..7.
Shader: nest the HAS_CLIP2 / HAS_CLIP3 checks (HAS_CLIP3 implies
HAS_CLIP2) so single-clip layers pay only one branch, two-clip
layers pay one extra slug call, three-clip layers pay two extra.
On Noto-COLRv1 the bench is unchanged (~320 fps with the emoji
text the user benches against), within noise of the depth-1
baseline -- the extra branches don't fire on most layers.
Ports across all four shader languages (GLSL, MSL, HLSL, WGSL).
NEWS: limitation entry updated to "up to 3 levels are intersected
exactly; deeper nests set unsupported".
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mirror the draw API. hb_gpu_paint_t already had x_scale / y_scale
fields and hb_gpu_paint_glyph() set them directly, but no public
setter / getter -- callers that want to use the paint funcs
without going through paint_glyph had no way to wire the scale.
Add the public setters / getters and route paint_glyph through
them, matching hb_gpu_draw_glyph's pattern. Document on both
draw and paint that the convenience wrappers call _set_scale.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Paint encoder used to push past several limits and produce a blob
that wraps an int16, overflows the shader's group stack, or skips
unsupported callbacks entirely. Detect each:
- num_ops > 32767 (the i16 blob header field's range): set
paint->unsupported in every emit path.
- group depth > HB_GPU_PAINT_MAX_GROUP_DEPTH (4 -- matches the
fragment shader's HB_GPU_PAINT_GROUP_DEPTH): set unsupported
in push_group; mirror the symmetric pop guard.
- PaintImage: register an `image` callback that sets unsupported
(the slug+gradient encoder can't represent raster images).
push_clip_rectangle is intentionally NOT trapped -- the encoder
silently ignores it; rendered output is wider than the rectangle
asks but doesn't fail.
Nested PaintGlyph clips still silently override the outer clip
(only depth 1 is faithfully stored); follow-up commit will lift
this to depth 2.
Document all of the above in NEWS, and relax the COLR test to
tolerate a font where every glyph trips one of these limits.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
test/api/test-gpu: extends the existing draw test suite with
paint counterparts -- create/destroy, get_funcs singleton,
shader_source for all four langs, empty encode returns nullptr,
encode of a monochrome glyph (synthesized single-layer fallback),
encode of a real COLRv1 glyph (test_glyphs-glyf_colr_1.ttf,
scanning for a glyph our encoder fully supports), auto-clear on
encode, reset wipes config, recycle_blob roundtrip.
perf/benchmark-gpu: add BM_GpuPaintEncode parallel to
BM_GpuDrawEncode (renamed from BM_GpuEncode for symmetry) so the
two paths can be compared on the same fonts.
NEWS: draft entry under "leading to NEXT (REPLACEME)" listing the
new hb_gpu_paint_* API surface and the recent GPU library changes
(--draw / --paint flags, gradient inverse-transform). Release
manager will fold this into the actual release section.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>