The only scenarios where 'check valid region' and
'check boundary' occur are when mathUpdateOutlineBBox()
returns true. This, in turn, happens only if mathClipBBox()
returns true. If that is the case, it means that just
before this return, exactly the same checks were performed.
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%)
Following ThorVG API changes (#1372), updated the canvas handling:
- Replaced Canvas::clear() calls with Canvas::remove()
- Updated Canvas::draw() usage to handle buffer clearing
Basically rewrite the PathTrim code, correct the Line and Bezier split
function calling.
Also the trim situation where start is greater than end can be handled correctly.
Added a `clear` parameter to Canvas::draw(), allowing users to decide
whether to clear the target buffer before drawing.
To remove the paints from a canvas, please use Canvas::remove()
C++ API Removals:
- Result Canvas::clear(bool paints, bool buffer)
C++ API Modifications:
- Result Canvas::draw()
-> Result Canvas::draw(bool clear)
C API Removals:
- Tvg_Result tvg_canvas_clear(bool paints, bool buffer)
C API Modifications:
- Tvg_Result tvg_canvas_draw(Tvg_Canvas* canvas)
-> Tvg_Result tvg_canvas_draw(Tvg_Canvas* canvas, bool clear)
issue: https://github.com/thorvg/thorvg/issues/1372
enhanced the rendering composition target to better support features such as
alpha blending, blending, masking, post effects, and more.
This allows rasterizers to prepare the composition context with more precise control.
Additionally, resolved a crash in the software engine's post-effect process
caused by a buffer size mismatch during XY buffer flipping.
issue: https://github.com/thorvg/thorvg/issues/3009
issue: https://github.com/thorvg/thorvg/issues/2984
- Enhanced Scene management to provide users with more control.
- Scenes now support adding specific scenes at defined positions and removing them as needed.
- Ensure safe access to Canvas, Scene paints() by adding const specifiers.
- Removed virtual specifier for the canvas primitive apis.
- Introduced a nested scene in the canvas to remove logic duplication.
C++ API Modification:
- Result Scene::push(Paint* paint)
-> Result Scene::push(Paint* target, Paint* at = nullptr)
- Result Scene::clear(bool free = true)
-> Result Scene::remove(Paint* paint = nullptr)
- Result Canvas::push(Paint* paint)
-> Result Canvas::push(Paint* target, Paint* at = nullptr)
- list<Paint*>& Scene::paints()
-> const list<Paint*>& Scene::paints() const
- list<Paint*>& Canvas::paints()
-> const list<Paint*>& Canvas::paints() const
C++ API Addition:
- Result Canvas::remove(Paint* paint = nullptr);
C API Modifications:
- Tvg_Result tvg_scene_clear(Tvg_Paint* scene, bool free)
-> Tvg_Result tvg_scene_remove(Tvg_Paint* scene, Tvg_Paint* paint)
C API Addition:
- Tvg_Result tvg_scene_push_at(Tvg_Paint* scene, Tvg_Paint* target, Tvg_Paint* at)
- Tvg_Result tvg_canvas_push_at(Tvg_Canvas* canvas, Tvg_Paint* target, Tvg_Paint* at)
- Tvg_Result tvg_canvas_remove(Tvg_Canvas* canvas, Tvg_Paint* paint)
issue: https://github.com/thorvg/thorvg/issues/2957
issue: https://github.com/thorvg/thorvg/issues/1372
Since longjmp is not yet fully supported on Wasm (emscripten uses
JS to make the jumps and requires slow jumps), but also because
longjmp is hard to reason about, this patch replaces it with
return values. The logic stays exactly the same.
certain systems, may not support file I/O operations.
ThorVG should provide users with an option to configure
builds according to their requirements.
This ensures that file I/O calls are avoided,
preventing potential crashes.
Please use the meson '-Dfile=true/false' option for this.
Please note that "THORVG_FILE_IO_SUPPORT" might be expected
for your thorvg manual build.
issue: https://github.com/thorvg/thorvg/issues/3008
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.