Re:CanvasKit – Skia and WebAssembly
by pjmlp on Friday July 19, 2019 @02:11PM
(#20481078)
There is no guarantee that canvas is hardware accelerated, or how whatever they are optimized, so a low level software rendering library might turn out to execute faster, regardless of the browser.
[ Parent
| on HN ]
This is not about Canvas but rather set of primitives that browser uses for rendering web pages.
Like in my Sciter (https://sciter.com) where you can do
var anyEl = …;
anyEl.paintBackground = function(gfx) {
gfx.fillColor(rgb(0,0,0))
.rectangle(0,0,100cm,100cm);
return true; // to suppress CSS background drawing
}
paintBackground/Content/Foreground methods are called while rendering HTML tree and the `gfx` passed to that function is the very same graphics that is used for rendering HTML/CSS tree.That thing allows to combine immediate mode graphics a la ImGui with retained one to achieve more performant solution at the end.
The same approach can be used with WASM I think.