2 ms·
This is not about Canvas but rather set of primitives that browser uses for rendering web pages. Like in my Sciter (https://sciter.com https://sciter.com) wher
by c-smile 7y ago
This is not about Canvas but rather set of primitives that browser uses for rendering web pages.
Like in my Sciter (https://sciter.com 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.