Commit Graph
20815 Commits
Author SHA1 Message Date
Behdad EsfahbodandClaude Opus 4.6 d8f1c44fd3 [gpu] Skip first touchmove after finger count change
Prevents jumps during 3→2→1 finger transitions by dropping
one frame and reinitializing pinch state for the new finger
count.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:36:22 -06:00
Behdad EsfahbodandClaude Opus 4.6 dac2716b2a [gpu] Fix 3-finger to 2-finger transition jump
Reinitialize pinch state (distance, angle, centroid) when
exiting 3-finger mode with 2 fingers remaining. Prevents
large zoom/rotate delta from stale pinch values.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:29:07 -06:00
fa50f16e51 [gpu] Fix black screen on resume with web_request_redraw
Add demo_view_request_redraw() and export as _web_request_redraw.
Shell calls it on visibilitychange, focus, pageshow, and
webglcontextrestored events to force a redraw after phone
lock/unlock or tab switch.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:17:42 -06:00
Behdad EsfahbodandClaude Opus 4.6 34d0280f80 [gpu] Revert canvas width hack, keep visibilitychange listener
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:12:00 -06:00
Behdad EsfahbodandClaude Opus 4.6 8e8322eb8d [gpu] Force canvas resize on visibility change
Toggle canvas width by 1px to ensure GLFW detects the size
change and triggers a redraw after phone lock/unlock.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:08:38 -06:00
Behdad EsfahbodandClaude Opus 4.6 317dffe886 [gpu] Redraw on visibility change and context restore
Fixes black screen after phone lock/unlock or tab switch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:06:42 -06:00
Behdad EsfahbodandClaude Opus 4.6 c4f8c58433 [gpu] Prevent animation toggle after long-press reset
preventDefault on touchend after long-press fires, so GLFW
doesn't see it as a click.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:01:14 -06:00
Behdad EsfahbodandClaude Opus 4.6 6b111e5ca2 [gpu] Fix mobile gestures: long-press reset, double-tap-drag zoom
Long-press uses _web_reset directly with 10px jitter threshold.
Double-tap-drag undoes first tap's animation toggle via
_web_toggle_animation, then preventDefault blocks GLFW from
seeing the second tap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:59:04 -06:00
Behdad EsfahbodandClaude Opus 4.6 10ca3ef37f [gpu] Fix long-press reset and double-tap-drag animation
Use exported _web_reset() for long-press instead of synthesized
keyboard event. Second tap of double-tap-drag naturally undoes
the first tap's animation toggle via GLFW click handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:51:03 -06:00
Behdad EsfahbodandClaude Opus 4.6 d2469853e8 [gpu] Add mobile gestures: long-press reset, double-tap-drag zoom
Long-press (500ms) resets view. Double-tap and drag vertically
zooms in/out (one-handed zoom like Google Maps).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:46:59 -06:00
209985fb95 [gpu] Fix pinch centering: anchor on previous centroid
Scale and rotate around the previous finger midpoint, then apply
centroid drift as pan afterwards. This prevents the content from
orbiting during pinch-rotate.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:40:52 -06:00
Behdad Esfahbod eb0f937ea5 Merge remote-tracking branch 'origin/main' 2026-03-30 10:23:35 -06:00
Behdad EsfahbodandClaude Opus 4.6 9da25b8a1f [gpu] Rework pinch: unified pan+zoom+rotate gesture
Single demo_view_pinch() handles all three components atomically:
- Pan from centroid movement
- Zoom around centroid (proven middle-drag math)
- Screen-space Z rotation (separate from 3D quaternion)

Pinch rotation uses a screen_angle field applied as a post-MVP
2D rotation, keeping it independent from the 3D trackball.
Zoom centering works correctly; rotation centering is approximate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:19:45 -06:00
Behdad EsfahbodandClaude Opus 4.6 7659baca01 [gpu] Pinch-zoom around pinch center
Adds demo_view_zoom_around() which scales while compensating
translation so the midpoint between fingers stays fixed.
Same maps-like behavior as the pinch rotation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 09:44:40 -06:00
Behdad EsfahbodandClaude Opus 4.6 37a635de21 [docs] Add CLAUDE.md symlink to AGENTS.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 09:44:09 -06:00
Behdad EsfahbodandClaude Opus 4.6 c1550337db [gpu] Pinch-rotate around pinch center, not screen center
Adds demo_view_rotate_z_around() which compensates translation
so the point between the two fingers stays fixed during rotation,
like maps apps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 09:40:56 -06:00
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 Esfahbod 29f1e02c03 Merge remote-tracking branch 'origin/main' 2026-03-30 09:21:03 -06:00
Behdad EsfahbodandClaude Opus 4.6 2355baf3aa [docs] Add CLAUDE.md symlink to AGENTS.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 09:19:38 -06:00
dependabot[bot] e68aaba4e3 Bump hendrikmuhs/ccache-action from 1.2.21 to 1.2.22
Bumps [hendrikmuhs/ccache-action](https://github.com/hendrikmuhs/ccache-action) from 1.2.21 to 1.2.22.
- [Release notes](https://github.com/hendrikmuhs/ccache-action/releases)
- [Commits](https://github.com/hendrikmuhs/ccache-action/compare/1bbbcda0748b3e340dee71a314fa68ffcbd6df79...33522472633dbd32578e909b315f5ee43ba878ce)

---
updated-dependencies:
- dependency-name: hendrikmuhs/ccache-action
  dependency-version: 1.2.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-30 16:40:47 +02:00
dependabot[bot] 10dbd60e2b Bump github/codeql-action from 4.34.1 to 4.35.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.34.1 to 4.35.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/38697555549f1db7851b81482ff19f1fa5c4fedc...c10b8064de6f491fea524254123dbe5e09572f13)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-30 16:40:08 +02: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 d55db833fd [gpu] Fix WGSL: use gi.bandIndex.y for hband fetch
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:03:20 -06:00
Behdad EsfahbodandClaude Opus 4.6 cb9ab32b8b [gpu] Add _hb_gpu_decode_glyph and _hb_gpu_curve_counts to WGSL
Bring WGSL shader in line with GLSL/MSL/HLSL by extracting the
header decode + band index computation into a shared helper.
Enables future debug heatmap support in the WebGPU demo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:01:44 -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 f215e90916 [gpu] Consistent shader function naming across all languages
Make hb_gpu_fetch public (no underscore prefix) in all shaders.
Internal functions use _hb_gpu_* consistently, including WGSL
(single leading underscore is legal per gpuweb/gpuweb#2298).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:53:02 -06:00
Behdad EsfahbodandClaude Opus 4.6 22c16a95c6 [gpu] Document font scale, dilation, and static dilation alternative
Explain why font scale should be left at default, how dilation
works and what jac means, and provide a simpler static dilation
alternative for 2D rendering at known sizes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:43:45 -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