Commit Graph
32 Commits
Author SHA1 Message Date
Behdad EsfahbodandClaude Opus 4.6 16c30ac052 [gpu] Add pinch-to-rotate alongside pinch-to-zoom
Two-finger pinch now does both zoom (distance change) and Z-axis
rotation (angle change) simultaneously. Adds demo_view_rotate_z()
for direct Z-axis rotation from touch input.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 09:35:53 -06:00
Behdad EsfahbodandClaude Opus 4.6 0c96216518 [gpu] Move / and ? to keyboard section in help modal
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 00:11:57 -06:00
Behdad EsfahbodandClaude Opus 4.6 8e460c5298 [gpu] Add / clean screen to help modal
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 00:09:52 -06:00
Behdad EsfahbodandClaude Opus 4.6 c81010f99f [gpu] Split / and ?: / toggles HUD, ? shows help modal
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 00:08:42 -06:00
Behdad EsfahbodandClaude Opus 4.6 c8e37ce1f5 [gpu] Rearrange help modal, add HarfBuzz link
Keyboard first, mouse/touch second. Link to HarfBuzz GitHub
at bottom right.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 00:00:31 -06:00
Behdad EsfahbodandClaude Opus 4.6 936486dea8 [gpu] Fix help text alignment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:56:46 -06:00
Behdad EsfahbodandClaude Opus 4.6 47e83b0bac [gpu] Show ?: help in quick-guide
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:54:09 -06:00
Behdad EsfahbodandClaude Opus 4.6 41798ff4d3 [gpu] Fix help modal toggle and polish help text
Only toggle on keydown (not keyup). Remove vsync from web help.
Format key names with spaces.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:52:36 -06:00
Behdad EsfahbodandClaude Opus 4.6 af6891a307 [gpu] Add ? help overlay to web demo
Press ? or / to show full keyboard/mouse/touch reference.
Esc or ? again to dismiss.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:49:11 -06:00
Behdad EsfahbodandClaude Opus 4.6 0118c285ef [gpu] / and ? toggle help: print in desktop, toggle HUD in web
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:44:37 -06:00
Behdad EsfahbodandClaude Opus 4.6 b8a17218d1 [gpu] Shift+R to reload page in web demo
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:33:25 -06:00
Behdad EsfahbodandClaude Opus 4.6 02edb7ba46 [gpu] Treat empty text as cancel in text modal
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:29:53 -06:00
Behdad EsfahbodandClaude Opus 4.6 ed91b9645f [gpu] Add keyboard shortcuts: t=text, f=font, w=switch backend
Also Ctrl/Shift/Cmd+Enter commits text in the text modal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:27:43 -06:00
Behdad EsfahbodandClaude Opus 4.6 0ec8ed2e62 [gpu] Update web demo help text
Add stem darkening, shorten labels, remove =/-: zoom.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:37:02 -06:00
Behdad EsfahbodandClaude Opus 4.6 8022d64440 [gpu] Add WebGL2 availability check to web demo
Show helpful error with link to webglreport.com when WebGL2
context creation fails (e.g. Firefox with hardware acceleration
disabled or GPU blocklisted).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:41:30 -06:00
Behdad EsfahbodandClaude Opus 4.6 ddd6a86470 [gpu] Add debug heatmap mode (d key)
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>
2026-03-29 17:40:38 -06:00
Behdad EsfahbodandClaude Opus 4.6 98f7d746f3 [gpu] Add 3-finger touch gesture for 3D rotation
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>
2026-03-29 16:18:44 -06:00
Behdad EsfahbodandClaude Opus 4.6 41973ac2c4 [gpu] Polish WebGPU error message layout
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:26:40 -06:00
Behdad EsfahbodandClaude Opus 4.6 3a7d9d8679 [gpu] Clean up web demo error message and titles
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:23:36 -06:00
Behdad EsfahbodandClaude Opus 4.6 d35076bb28 [gpu] Fix line break in WebGPU error message
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:18:18 -06:00
Behdad EsfahbodandClaude Opus 4.6 10f18a652f [gpu] WebGPU error handling and UI polish
- 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>
2026-03-29 15:16:41 -06:00
Behdad EsfahbodandClaude Opus 4.6 a3dedf59b9 [gpu] Fix WebGPU demo gamma, colors, and UI
- 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>
2026-03-29 15:03:33 -06:00
Behdad EsfahbodandClaude Opus 4.6 dbbcca47b0 [gpu] WebGPU web demo working
Fix WebGPU rendering: remove wgpuSurfacePresent (browser auto-presents),
query preferred surface format, set depthSlice undefined for 2D targets.
Match GL demo behavior: light mode default, proper trackball rotation,
CSS-pixel coordinate mapping, perspective frustum projection.

Add backend dropdown (WebGL/WebGPU) to shell.html that navigates
between index.html and webgpu.html.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 14:56:56 -06:00
Behdad EsfahbodandClaude Opus 4.6 892f9ebffc [gpu] Add loading screen to web demo
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 13:59:02 -06:00
Behdad EsfahbodandClaude Opus 4.6 58f84001c3 [gpu] Show simplified help text on mobile, clean up desktop help
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 12:57:49 -06:00
Behdad EsfahbodandClaude Opus 4.6 1a8621c557 [gpu] Show simplified help text on mobile
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 12:54:02 -06:00
Behdad EsfahbodandClaude Opus 4.6 ccc532d999 [gpu] Hide font/text buttons on mobile
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 12:51:52 -06:00
Behdad EsfahbodandClaude Opus 4.6 67ecdf8da7 [gpu] Add text editing modal to web demo
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>
2026-03-29 12:48:44 -06:00
Behdad EsfahbodandClaude Opus 4.6 ce3b2df037 [gpu] Add font file loading to web demo
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>
2026-03-29 11:41:22 -06:00
Behdad EsfahbodandClaude Opus 4.6 1ffb1faf82 [gpu] Add controls overlay to web demo
Show mouse and keyboard shortcuts in the bottom-left corner.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:30:11 -06:00
Behdad EsfahbodandClaude Opus 4.6 3b7bfd4289 [gpu] Pinch-to-zoom and proportional scroll zoom
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>
2026-03-28 01:44:28 -06:00
Behdad EsfahbodandClaude Opus 4.6 90e8b99cd5 [gpu] Add Emscripten web demo; mobile touch support
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>
2026-03-28 01:31:28 -06:00