Commit Graph
11 Commits
Author SHA1 Message Date
Behdad EsfahbodandClaude Opus 4.6 f2eb9d58bc [gpu] Reduce default perspective in demo
The large default text block looked too distorted with
perspective=4.  Use 16 for a flatter initial view.
The user can still adjust with Shift+right-drag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:38:27 -06:00
Behdad EsfahbodandClaude Opus 4.6 e4c174015f [gpu] Rename u_atlas uniform to hb_gpu_atlas
Namespace the GLSL uniform to avoid conflicts with user code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 17:21:27 -06:00
Behdad EsfahbodandClaude Opus 4.6 0582846c08 [gpu] Simplify shader API: return single string per language
Change hb_gpu_shader_{fragment,vertex}_sources() (array + count)
to hb_gpu_shader_{fragment,vertex}_source() returning a single
const char *.  Each language variant is one complete string.

Simplifies the demo shader compilation and documentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 17:10:04 -06:00
Behdad EsfahbodandClaude Opus 4.6 25e69d9b96 [gpu] Port hb-gpu-demo to options.hh infrastructure
Replace the manual getopt-based demo main with the standard
main_font_text_t / shape_consumer_t composition, getting all
harfbuzz options for free: --variations, --features, --script,
--direction, --face-index, --font-funcs, etc.

New gpu_output_t (in util/gpu-output.hh) implements the output
interface, feeding shaped glyphs to the demo's GL renderer.

Add demo_buffer_add_glyph() and demo_buffer_current_line() to
demo-buffer for glyph-at-a-time insertion (vs the old batch
add_text which did its own shaping).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:34:04 -06:00
Behdad EsfahbodandClaude Opus 4.6 686f3caa86 [gpu] Implement blob recycling in encode
recycle_blob stores the blob; encode reuses both the blob object
and its data buffer when the buffer is >= needed and < 2x needed.
Otherwise malloc fresh and replace_buffer on the recycled blob.

hb_blob_t::replace_buffer now skips destroy_user_data when the
new data pointer is the same as the old one (same-buffer reuse).

Add explicit destructor to hb_gpu_draw_t for recycled_blob cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 15:13:44 -06:00
Behdad EsfahbodandClaude Opus 4.6 69686b0768 [gpu] Use hb-gpu-demo name in help text and window title
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:23:17 -06:00
Behdad EsfahbodandClaude Opus 4.6 e8d2bddfab [gpu] Make GL deps optional; add them to Linux CI
The demo requires GLEW, GLFW3, and GL. Make these optional so the
library still builds on headless systems. The demo is skipped when
they're missing.

Install the GL packages in the Linux CI workflow so the demo
builds there.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:14:10 -06:00
Behdad EsfahbodandClaude Opus 4.6 65d357f808 [gpu] Rename hb_gpu_glyph_t to hb_gpu_draw_t
The object is a draw_funcs_t closure, same role as hb_raster_draw_t.
Rename for consistency with the other modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:09:40 -06:00
Behdad EsfahbodandClaude Opus 4.6 9732ad4bcf [gpu] Build hb-gpu binary in util/ instead of util/gpu/
Move the executable definition to util/meson.build so the binary
lands at util/hb-gpu, consistent with other utilities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:50:41 -06:00
Behdad EsfahbodandClaude Opus 4.6 294b625f7c [gpu] Wire up default font/text in demo
Fall back to an embedded font when no font file is given,
matching the glyphy-demo behaviour.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:32:21 -06:00
Behdad EsfahbodandClaude Opus 4.6 03c2688436 [gpu] Add GPU demo app in util/gpu
Port the glyphy-demo to use the hb-gpu API.  Builds as util/hb-gpu
and requires GLEW, GLFW3, and OpenGL 3.3.  Includes default text
and embedded font for quick testing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:30:13 -06:00