Refactor library fragment shaders (GLSL, MSL, WGSL) to extract
_hb_gpu_decode_glyph and _hb_gpu_curve_counts helpers, used by
both hb_gpu_render and the debug visualization.
Debug mode (d key) shows per-pixel curve counts as a heatmap:
R = horizontal band curves, G = vertical band curves, B = text
coverage. Scale 0-8 curves maps to 0-1 intensity.
Also auto-generates demo shader headers via meson, and adds
set_debug to the renderer interface.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three-finger drag on mobile now does trackball rotation, matching
right-drag on desktop. Uses centroid of three touch points.
Release with momentum triggers spin animation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Show helpful error with browser support link when WebGPU is
unavailable (JS-level check before WASM loads)
- Suggest Linux Chrome flags for Vulkan/WebGPU
- Prevent onRuntimeInitialized from hiding the error message
- Set page title to WebGL/WebGPU variant
- Make adapter failure in C++ also show HTML error
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Default to light mode matching GL demo
- Gamma cycles between 2.2 and none (no sRGB framebuffer)
- Gamma depends on dark_mode (1/2.2 for dark, 2.2 for light)
- Add console logging for key presses
- Blur backend dropdown after selection to prevent space capture
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a "text" button that opens a modal textarea with the current
text. Apply sends new text to WASM, flushing the glyph cache and
atlas. Custom text is preserved across font changes.
Also adds demo_font_clear_cache() and demo_atlas_clear() for
flushing state without full destroy/recreate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a font button and drag-and-drop support to the web demo.
When a user provides their own .ttf/.otf font, the glyph cache
and atlas are flushed and the display is rebuilt with English-only
text (since the font may not support Persian).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Make scroll zoom proportional to delta (pow(STEP, yoffset))
instead of fixed steps. Add JS pinch-to-zoom handler that
translates two-finger touch to wheel events with a dead zone
to prevent jitter.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Web build using Emscripten + WebGL2 with HB_GPU_ATLAS_2D mode.
Touch support: drag to pan, tap to toggle animation.
FPS counter overlay. Viewport meta for mobile.
Fix cursor position on first touch by querying glfwGetCursorPos
in mouse_func. Left click/tap also toggles animation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>