Skip to content

feat(wasm): software rendering fallback#22247

Merged
MartinZikmund merged 11 commits intounoplatform:masterfrom
ramezgerges:wasm_skia_softwarerender
Jan 17, 2026
Merged

feat(wasm): software rendering fallback#22247
MartinZikmund merged 11 commits intounoplatform:masterfrom
ramezgerges:wasm_skia_softwarerender

Conversation

@ramezgerges
Copy link
Copy Markdown
Contributor

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:

Other information ℹ️

Copilot AI review requested due to automatic review settings January 5, 2026 16:05
@github-actions github-actions Bot added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Jan 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 putImageData for blitting
  • Refactored JsInfo from a struct with validation to a record with a UseSoftware flag
  • Improved TypeScript type safety by replacing any types 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

Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Rendering/BrowserRenderer.cs Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Rendering/BrowserRenderer.cs Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Rendering/BrowserRenderer.cs Outdated
@unodevops
Copy link
Copy Markdown
Contributor

🤖 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

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html

@unodevops
Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 189927 has failed on Uno.UI - CI.

Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Rendering/BrowserRenderer.cs Outdated
Copilot AI review requested due to automatic review settings January 7, 2026 12:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/ts/Runtime/BrowserRenderer.ts Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Rendering/BrowserRenderer.cs Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Rendering/BrowserRenderer.cs Outdated
@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html

@unodevops
Copy link
Copy Markdown
Contributor

🤖 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

@ramezgerges ramezgerges force-pushed the wasm_skia_softwarerender branch from b01c09f to 0e7ed25 Compare January 7, 2026 20:43
@unodevops
Copy link
Copy Markdown
Contributor

🤖 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

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html

Copilot AI review requested due to automatic review settings January 8, 2026 12:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 20 out of 20 changed files in this pull request and generated 9 comments.

Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Rendering/BrowserRenderer.cs Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Builder/WebAssemblyHostBuilder.cs Outdated
Comment thread src/Uno.UI.Runtime.Skia.WebAssembly.Browser/Builder/HostBuilder.cs
@unodevops
Copy link
Copy Markdown
Contributor

🤖 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

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html

@ramezgerges ramezgerges force-pushed the wasm_skia_softwarerender branch from 7658d34 to 899c15d Compare January 8, 2026 17:52
@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22247/docs/index.html

@unodevops
Copy link
Copy Markdown
Contributor

🤖 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

@MartinZikmund MartinZikmund merged commit 2749009 into unoplatform:master Jan 17, 2026
53 checks passed
@ramezgerges ramezgerges deleted the wasm_skia_softwarerender branch January 18, 2026 14:27
@MartinZikmund
Copy link
Copy Markdown
Member

@Mergifyio backport release/stable/6.5

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 20, 2026

backport release/stable/6.5

✅ Backports have been created

Details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WASM][Chrome][Linux] WASM App does not load when launched in Chrome

5 participants