Skip to content

fix(wasmskia): use webgl to load images instead of the 2d Canvas API to work around Skia alpha-premultiplication bug - #20771

Merged
ramezgerges merged 8 commits into
unoplatform:masterfrom
ramezgerges:skia_wasm_canvas_image_loading
Jul 2, 2025
Merged

ramezgerges merged 8 commits into
unoplatform:masterfrom
ramezgerges:skia_wasm_canvas_image_loading

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #20727

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 ℹ️

…to work around Skia alpha-premultiplication bug
@github-actions github-actions Bot added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Jun 12, 2025
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

@ajpinedam ajpinedam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@ramezgerges

Copy link
Copy Markdown
Contributor Author

It seems like loading with opengl costs so much more than loading with canvas.getContext('2d').drawImage and somehow looping by hand over the entire byte array has minimal impact even with very large images.
image
(row 1 is webgl, row 2 is the old implementation with drawImage, row 3 is drawImage + for loop for alpha multiplication)

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

@ramezgerges

Copy link
Copy Markdown
Contributor Author

The machine I was testing on was implementing webgl in software. When testing on a slower machine but with HWA, the numbers are closer but the 2d implementation is still better
image

@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Jun 13, 2025
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@ramezgerges

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

@ramezgerges

Copy link
Copy Markdown
Contributor Author

/azp run

@ramezgerges
ramezgerges enabled auto-merge July 2, 2025 11:14
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@ramezgerges
ramezgerges merged commit f0b9ba0 into unoplatform:master Jul 2, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/automation Categorizes an issue or PR as relevant to project automation 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.

Gallery logo does not render correctly

5 participants