feat(wasm): software rendering fallback#22247
feat(wasm): software rendering fallback#22247MartinZikmund merged 11 commits intounoplatform:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements a software rendering fallback for WebAssembly when WebGL context creation fails, addressing issue #21994. When WebGL is unavailable or initialization fails, the renderer now falls back to using a 2D canvas context with CPU-based rendering via SkiaSharp's software rasterizer.
Key changes:
- Added try-catch around WebGL initialization with automatic fallback to 2D canvas context
- Implemented software rendering path using pixel buffers and
putImageDatafor blitting - Refactored
JsInfofrom a struct with validation to a record with aUseSoftwareflag - Improved TypeScript type safety by replacing
anytypes with proper type annotations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| BrowserRenderer.ts | Added software rendering support with 2D context, pixel buffer management, and WebGL fallback logic; improved type safety |
| BrowserRenderer.cs | Refactored initialization flow, added dual rendering paths (hardware/software), and simplified JsInfo structure |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22247/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html |
|
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22247/wasm-skia-net9/index.html |
b01c09f to
0e7ed25
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22247/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22247/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html |
7658d34 to
899c15d
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22247/wasm-skia-net9/index.html |
|
@Mergifyio backport release/stable/6.5 |
✅ Backports have been createdDetails
|
GitHub Issue: closes #21994
PR Type:
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️