feat(terminal): recover webgl renderer context
This commit is contained in:
@@ -231,7 +231,11 @@
|
||||
### P9 — WebGL Renderer 工程化深化
|
||||
|
||||
**计划实现**:
|
||||
1. WebGL context loss/recovery 与 atlas 重建。
|
||||
1. **WebGL context loss/recovery 与 atlas 重建** ✅
|
||||
- 监听 `webglcontextlost` / `webglcontextrestored`,lost 时阻止默认行为并清空 `WebGlRendererState`。
|
||||
- context lost 或 WebGL 初始化失败时显示独立 Canvas 2D fallback surface,避免同一 canvas 上 WebGL lost 后无法获取 2D context 导致白屏。
|
||||
- restore 后清空旧 state 并触发重绘,下一帧重建 shader/program/buffer/texture/glyph atlas。
|
||||
- context lifecycle listener 由 `WebGlContextLifecycle` 持有,组件卸载或 renderer 切换时自动移除。
|
||||
2. 渲染性能 benchmark 和自动截图 / pixel smoke test。
|
||||
3. Canvas 2D / WebGL runtime switch。
|
||||
4. 与 Canvas 2D 做 benchmark 对比,按 viewport size / output rate 自动选择 renderer。
|
||||
|
||||
Reference in New Issue
Block a user