The binary size recently increased due to the ASYNCIFY option, which was required for WebGPU initialization.
To prevent unnecessary binary size growth, ThorVG will no longer depend on asynchronous processes such as `emscripten_sleep` (ASYNCIFY or JSPI).
As a result, the combined WASM binary size has been significantly reduced to less than 1MB.
Size comparison: 1559KB → 998KB (-36%)
Support cross compile the GL backend code into WASM.
The code needs WebGL 2.0 API so, the compile flags contains `MAX_WEBGL_VERSION` and `FULL_ES3`
Also add binding code to initialize the WebGL context and GLCanvas.
Updated WASM binding to bring WebGPU on the web player.
binding will generate a WASM binary, which can render animation through both SW and WG raster engine.
A raster engine will be chosen by parameter `engine`, when initializing.
enabled options:
- EXPORT_ES6 > to import glue code in es6 module system
- SINGLE_FILE > to build library as a single JS file, single file reduces loading latency
- MODULARIZE > proper option to build es6 module (optimized)
- EXPORTED_RUNTIME_METHODS > allow es6 module based glue code to import FS