mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 14:01:10 +01:00
* hb_gpu_paint_glyph() switches from hb_font_paint_glyph_or_fail
to hb_font_paint_glyph so non-color glyphs also produce a blob
(harfbuzz synthesizes push_clip_glyph + color(is_foreground) +
pop_clip which our callbacks turn into a single LAYER_SOLID
op). Return value is now "no internal error" rather than
"glyph had color paint".
* util/gpu/demo-font.cc: drops the draw-only upload path and
routes every glyph through hb_gpu_paint_{clear,glyph,encode,
recycle_blob}. Uploads the active palette to the
hb_gpu_palette uniform array in demo_font_create.
* util/gpu/demo-shader.cc: concatenates hb_gpu_paint_shader_source
after the shared + draw sources, and the demo's fragment main
now calls hb_gpu_paint(texcoord, glyphLoc, u_foreground)
directly. Stem-darkening / debug overlay paths preserved
against the premultiplied alpha channel returned by paint.
MSL / WGSL / HLSL demo paths are unchanged for now -- the paint
shader is GLSL-only and those demos keep using the draw path.
wasm size impact (local Emscripten build):
baseline 412722 170342 gz
+HB_NO_COLOR/HB_NO_PAINT 437752 179165 gz
+demo paint wiring 443313 181502 gz
delta (vs baseline) +30591 +11160
All 241 tests pass.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>