Since it is a slow news day, I wanted to ask a question.
Or make a suggestion, really.
What if, in addition to all the sample projects demonstrating CanvasKit, there was also a basic example of a WebAssembly app that kept Skia internal to itself and simply exposed a draw() command to the outside world?
(to the javascript world)
For example, a sample project that built a star.wasm (and corrospoding star.js) that had linked in the libskia.a that gets built when CanvasKit gets built. It could just expose a simple API function like:
draw(
/*string*/ canvas_name)
And then the C++ code in star.cpp would make a WebGL context for that html canvas object, if it didn't already make one in a previous call, and create an SkSurface and SkCanvas. All while keeping a copy around if it had already done that stuff already. Maybe storing them in global variables. Maybe rebuilding them if the width or height change, etc...
And then have the draw() function do some simple C++ code like this fiddle, for example:
https://fiddle.skia.org/c/@skpaint_sum_path_effectBut maybe use random numbers to change the wiggles.
Then, in the star.html file, add some inline javascript code that loads star.wasm. And then add an onDraw() handler and make it just loop over and over, calling draw(). So that the star wiggles like lightning.