Commit Graph
1078 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 526bb457ff [gpu] Fix D3D11 fullscreen restore (best-effort under Wine)
Wine may not properly restore windowed mode after fullscreen.
Works on native Windows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:29:25 -06:00
Behdad Esfahbod 8aae9a0e0d Reapply "[gpu] Add fullscreen toggle (F key) to D3D11 demo"
This reverts commit ddcedece1d.
2026-03-29 22:26:30 -06:00
Behdad Esfahbod ddcedece1d Revert "[gpu] Add fullscreen toggle (F key) to D3D11 demo"
This reverts commit 66ce800631.
2026-03-29 22:25:42 -06:00
Behdad EsfahbodandClaude Opus 4.6 66ce800631 [gpu] Add fullscreen toggle (F key) to D3D11 demo
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:25:06 -06:00
Behdad EsfahbodandClaude Opus 4.6 94e2b88570 [gpu] Fix D3D11 demo: culling, quit, vsync
Disable backface culling (both triangles per quad need to render).
Handle Esc/Q to quit via DestroyWindow. Wire vsync toggle to
swap chain present interval.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:23:54 -06:00
Behdad EsfahbodandClaude Opus 4.6 4249b9d894 [gpu] Fix HLSL: declare hb_gpu_atlas before library shader
The library's hb_gpu_fetch references the global hb_gpu_atlas,
so its StructuredBuffer declaration must precede the library
source in the concatenated shader.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:19:01 -06:00
Behdad EsfahbodandClaude Opus 4.6 29b5fee519 [gpu] Add D3D11 demo (MinGW cross-compile, Wine)
D3D11 renderer using Win32 windowing and runtime HLSL compilation.
Cross-compiles with MinGW, runs under Wine with DXVK.

Also fixes demo-common.h to guard GL/GLFW includes behind
HB_GPU_NO_GLFW, renames near/far to znear/zfar in demo-view
(reserved on Windows), and adds QueryPerformanceCounter timer
for Win32.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:17:13 -06:00
Behdad EsfahbodandClaude Opus 4.6 a37c32ed64 [gpu] Add debug heatmap to Metal demo
Wire up the 'd' key debug mode using _hb_gpu_curve_counts from
the library MSL shader. Same R/G/B heatmap as GL and WebGPU:
red = horizontal curve count, green = vertical, blue = coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:06:57 -06:00
Behdad EsfahbodandClaude Opus 4.6 2760be8109 [gpu] Add debug heatmap to WebGPU demo
Now that the WGSL shader has _hb_gpu_curve_counts, wire up
the debug uniform and heatmap visualization. Same R/G/B output
as the GL demo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:05:11 -06:00
Behdad EsfahbodandClaude Opus 4.6 23c2d3de0c [gpu] Handle canvas resize in WebGPU demo
Check canvas size each frame and reconfigure the WebGPU surface
when it changes. Fixes black screen when toggling dev tools or
resizing the browser window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:59:59 -06:00
Behdad EsfahbodandClaude Opus 4.6 98c1cfc0a7 [gpu] Add stem darkening to Metal demo
Same algorithm as GL: pow(coverage, exp) where exp varies by
foreground brightness and ppem, smoothly transitioning to no
effect above 48ppem. Toggled with 's' key, on by default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:46:45 -06:00
Behdad EsfahbodandClaude Opus 4.6 286c40ad71 [gpu] Add stem darkening to WebGPU demo
Same per-pixel coverage adjustment as the GL demo. Replaces
unused debug uniform with stem_darkening in the uniform buffer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:42:15 -06:00
Behdad EsfahbodandClaude Opus 4.6 d8dcc4a620 [gpu] Add stem darkening and debug to desktop help text
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:37:51 -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 c9a9c92a3c [gpu] Add stem darkening (s key, on by default)
Adjust coverage at small sizes to compensate for gamma washing
out thin stems. Dark-on-light gets pow(cov, 0.7) to fatten,
light-on-dark gets pow(cov, 1.4) to thin. Smoothly transitions
to no effect above 48ppem. Applied before gamma correction so
it works with sRGB, gamma 2.2, and none.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:34:27 -06:00
Behdad EsfahbodandClaude Opus 4.6 0fef6b2ffd [gpu] Add DOM/CSS demo for rendering comparison
Self-contained HTML with embedded font and text, same controls
as GPU demos (pan, zoom, 3D rotation, drag-release animation).
Useful for comparing DOM text rendering performance vs GPU.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:15:55 -06:00
Behdad EsfahbodandClaude Opus 4.6 b920377d40 [gpu] Add DOM/CSS fallback web demo for comparison
Self-contained HTML with embedded font (base64) and default text.
Same controls as GPU demos. Useful for comparing rendering
performance: DOM vs WebGL vs WebGPU.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:57:43 -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 07598f4bb2 [gpu] Support middle-click in WebGPU demo
Map DOM button 1 (middle) to GLFW middle button so middle-click
reset and middle-drag zoom work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:42:05 -06:00
Behdad EsfahbodandClaude Opus 4.6 c8e0670f7c [gpu] Document middle-click reset in help text
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:38:07 -06:00
Behdad EsfahbodandClaude Opus 4.6 fd465792c9 [gpu] Middle-click to reset view
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:33:00 -06:00
Behdad EsfahbodandClaude Opus 4.6 b68fc1de22 [gpu] Fix WebGPU scroll zoom sensitivity
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:05:29 -06:00
Behdad EsfahbodandClaude Opus 4.6 5a08291dde [gpu] Use raw string literal for WGSL demo shader
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:03:41 -06:00
Behdad EsfahbodandClaude Opus 4.6 f3be5f329b [gpu] Inline demo shaders as raw string literals
Replace separate .glsl files and generated .hh headers with C++11
raw string literals (R"glsl(...)glsl") directly in demo-shader.cc.
Matches the pattern already used by demo-metal.mm and the WebGPU
demo. Removes demo shader generation from meson and the generator
script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:02:00 -06:00
Behdad EsfahbodandClaude Opus 4.6 09e85623bc [gpu] Fix Metal build; silence float-to-double warning
Add missing set_debug() to Metal renderer.
Cast float to double in demo-shader.h vertex extents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 17:56:48 -06:00
Behdad EsfahbodandClaude Opus 4.6 b42cd76d05 [gpu] Remove debug heatmap from WebGPU demo
The WGSL shader compilation fails with _hb_gpu_curve_counts.
Debug mode is available in desktop and WebGL demos.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 17:44:30 -06:00
Behdad EsfahbodandClaude Opus 4.6 c2618a00c4 [gpu] Use alpha blending for debug heatmap
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 17:42:21 -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 47512ddcb4 [gpu] Add Backspace as alternative reset key
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:48:32 -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 33de483673 [gpu] Fix NaN in trackball rotation speed
Clamp dquat[3] to [-1, 1] before acos() to prevent NaN from
float imprecision. Without the clamp, slightly-out-of-range
quaternion w values make rot_speed NaN, poisoning the quaternion
and causing text to disappear until reset.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 16:03:38 -06:00
Behdad EsfahbodandClaude Opus 4.6 30ff2b7d9d [gpu] Fix drag-release animation in WebGPU demo
Don't call demo_view_motion_func in on_mouseup — it zeros dx/dy
(same position as last mousemove), killing the velocity needed
for drag-release spin detection. Also remove debug printfs.

Track active_buttons to filter spurious document-level mouseup
events from UI controls while still catching drag releases
outside the canvas.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:51:57 -06:00
Behdad EsfahbodandClaude Opus 4.6 ca2fb1eb68 [gpu] Share demo_view between WebGL and WebGPU web demos
Refactor demo_view to work without GLFW (guarded by HB_GPU_NO_GLFW):
- Add demo_view_create_headless() for non-GLFW use
- Store fb/window dimensions in the view struct
- Use emscripten_get_now() for timing when on Emscripten
- Guard GLFW-specific calls (fullscreen, window close, cursor query)

Rewrite WebGPU entry point to use demo_view and demo_renderer_t
interface instead of duplicated view/input code. This gives the
WebGPU demo identical trackball rotation, drag-release animation,
keyboard shortcuts, and gamma cycling as the GL demos.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:36:19 -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 c43e4cc8d0 [gpu] Sync C++ WebGPU error message with JS one
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:24:44 -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