[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>
This commit is contained in:
Behdad EsfahbodandClaude Opus 4.6 committed 2026-03-30 11:06:42 -06:00
1 parent c4f8c58433
commit 317dffe886
1 file changed
+2
+2
View File
@@ -127,6 +127,8 @@ tap: animate · dbl-tap+drag: zoom · long-press: reset</span>
}
resizeCanvas();
window.addEventListener('resize', resizeCanvas);
document.addEventListener('visibilitychange', resizeCanvas);
canvas.addEventListener('webglcontextrestored', resizeCanvas);
/* Backend selector */
var isWebGPU = location.pathname.indexOf('webgpu') !== -1;