Commit Graph
238 Commits
Author SHA1 Message Date
Behdad Esfahbod 32fbe980ad [NEWS] Attribution 2026-04-14 22:08:06 -06:00
Behdad Esfahbod cb834b17b5 [NEWS] Draft entry for upcoming release
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>
2026-04-14 21:35:54 -06:00
Behdad Esfahbod 7c7b1756c1 [gpu] Support 3 nested glyph clips per layer
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>
2026-04-14 19:25:58 -06:00
Behdad Esfahbod f6cd414c9f [gpu] Add hb_gpu_paint_set_scale / _get_scale
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>
2026-04-14 19:08:03 -06:00
Behdad Esfahbod b38c5189df [gpu] Detect paint-encoder limits, fail rather than misrender
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>
2026-04-14 18:45:35 -06:00
Behdad Esfahbod 157e5111b3 [gpu] Add tests + benchmark for hb_gpu_paint, NEWS draft
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>
2026-04-14 16:00:51 -06:00
Khaled Hosny cfb70b0b91 14.1.0 2026-04-04 20:31:18 +02:00
Khaled Hosny da69b6585c 14.0.0 2026-04-01 14:54:05 +02:00
Behdad EsfahbodandClaude Opus 4.6 b26f1a8bc1 [docs] Rename "Core libraries" to "Libraries", update NEWS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 20:48:15 -06:00
Behdad EsfahbodandClaude Opus 4.6 541ed9ab3f [docs] Add NEWS entry for 14.0.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 20:13:37 -06:00
Khaled Hosny 6f4c5cec30 13.2.1 2026-03-19 16:09:56 +02:00
Khaled Hosny 5ad3909af4 13.2.0 2026-03-19 00:45:24 +02:00
Khaled Hosny 70b812d8d2 13.1.1 2026-03-13 03:08:03 +02:00
Khaled Hosny 68d19d6964 13.1.0 2026-03-11 04:01:41 +02:00
Khaled Hosny c298b921d6 13.0.1 2026-03-07 20:25:13 +02:00
Khaled Hosny 381b5d7cd4 Typo [ci skip] 2026-03-04 22:40:59 +02:00
Khaled Hosny a0fc099681 13.0.0 2026-03-04 22:28:50 +02:00
Khaled Hosny 8a481237ec Typo [ci skip] 2026-01-24 14:15:46 +02:00
Khaled Hosny b42511e071 12.3.2 2026-01-24 14:09:52 +02:00
Khaled Hosny abcb75a5d1 12.3.1 2026-01-20 23:59:40 +02:00
Khaled Hosny 45c3dfa737 Typo 2025-12-27 23:16:33 +02:00
Khaled Hosny 5a31dd02f0 12.3.0 2025-12-27 21:58:17 +02:00
Khaled Hosny 0426759f2b 12.2.0 2025-11-05 07:18:46 +02:00
Khaled Hosny cb59b347ca 12.1.0 2025-10-01 08:24:34 +03:00
Khaled Hosny 720f1a3b66 12.0.0 2025-09-28 00:55:46 +03:00
Khaled Hosny 7497c41474 11.5.1 2025-09-22 19:58:28 +03:00
Behdad Esfahbod bf8929fbfb 11.5.0 2025-09-12 13:32:38 -06:00
Khaled Hosny 22f77d48ab 11.4.5 2025-08-30 11:39:01 +03:00
Khaled Hosny 3420ef0212 11.4.4 2025-08-26 00:57:35 +03:00
Khaled Hosny 9ac9af2554 11.4.3 2025-08-23 11:48:18 +03:00
Khaled Hosny 6b754c3344 11.4.2 2025-08-21 08:40:14 +03:00
Behdad Esfahbod 6b285e6e94 11.4.1 2025-08-13 11:59:30 -06:00
Behdad Esfahbod 8c859f2528 11.4.0 2025-08-13 11:47:38 -06:00
Behdad Esfahbod c3fcbffa65 11.3.3 2025-07-26 14:00:32 -06:00
Behdad Esfahbod 4e3df1c138 11.3.2 2025-07-20 18:12:39 -06:00
Behdad Esfahbod 95a15d5313 11.3.1 2025-07-20 14:15:02 -06:00
Khaled Hosny 30e7af11ee 11.3.0 2025-07-20 21:40:37 +03:00
Khaled Hosny ba8b4dca9e Typo [ci skip] 2025-05-12 19:58:50 +03:00
Khaled Hosny 33a3f8de60 11.2.1 2025-05-12 19:51:07 +03:00
Khaled Hosny 63cdd745ff 11.2.0 2025-04-28 15:56:32 +03:00
Khaled Hosny 6f5ededc80 Minor 2025-04-28 15:56:32 +03:00
Khaled Hosny 416e6b6921 11.1.0 2025-04-16 20:35:58 +02:00
Khaled Hosny 58170206a1 Typo [ci skip] 2025-04-06 03:55:56 +02:00
Khaled Hosny 43a7784922 11.0.1 2025-04-04 22:41:26 +02:00
Khaled Hosny ea6a172f84 11.0.0 2025-03-24 00:33:53 +02:00
Khaled Hosny 3ef8709829 10.4.0 2025-03-01 00:59:49 +02:00
Khaled Hosny 694ffa8747 10.3.0 2025-02-20 23:56:59 +02:00
Khaled Hosny 7b27c8edd4 10.2.0 2025-01-11 18:13:18 +02:00
Khaled Hosny 9ef44a2d67 10.1.0 2024-11-05 08:04:49 +02:00
Khaled Hosny a1d9bfe628 10.0.1 2024-09-24 19:52:43 +03:00