The sw_engine, when determining the outline, converts
floats to ints by multiplying them x64, resulting in
a comparison precision of 1/64 = 0.015625.
Both gl_engine and wg_engine operate on floats. Before
adding a closing point to a shape, they performed a comparison
to check if the point differed from the starting point:
- wg: with a precision of 1e-3 (using length2, i.e., eps = 1e-6
- gl: used direct == comparison.
Now, consistency has been ensured by introducing a comparison
precision of 1/64 in both wg_engine and gl_engine.
@issue: https://github.com/thorvg/thorvg/issues/2799
@issue: https://github.com/thorvg/thorvg/issues/3235
Manage the global buffer memory for vertex and indexed vertex buffers,
increase the memory size incrementally twice by default and reduce
the default buffer size, which is not suitable for typical scenarios.
This could reduce the a bit stack memory usage and improve
the portability across systems where has the stack memory
limitation and potentially gaining performance enhancement
by avoiding brutal stack memory usage at the many function calls.
added the internal functions:
- WgVertexBuffer* mpoolReqVertexBuffer(float scale = 1.0f);
- WgIndexedVertexBuffer* mpoolReqIndexedVertexBuffer(float scale = 1.0f);
- void mpoolRetVertexBuffer(WgVertexBuffer* buffer);
- void mpoolRetIndexedVertexBuffer(WgIndexedVertexBuffer* buffer);
issue: https://github.com/thorvg/thorvg/issues/3159
- Changed optimization flags to -Oz, reducing the binary size by 120KB.
- Applied wasm-opt convergence as a post-process to ensure the minimum possible size with the given optimization flag.
In cases where the fill was changed while the stroke existed
but remained unchanged, the stroke would disappear because it
was being reset during the shape preparing (shapeReset).
Fixed by disabling the reset of stroke rle from shape reseting.
Also the shape should be prepared not only when the RenderUpdateFlag
is set to Color, but also when it is set to Gradient.
@Issue: https://github.com/thorvg/thorvg/issues/3237
For an odd number of dash/gap segments, the offset was
handled incorrectly because the non-doubled count of
dashes and gaps was used.
Additionally, in ddcbbf7, an error was introduced by
overlooking the fact that the offset can shift the dash
pattern in such a way that the first segment of the dashed
line becomes a gap.
Until now lottie loader supported only a single
dash-gap pair, and only the case where only the dash
was provided was handled correctly. When both values
were provided, the gap was incorrectly increased by
the dash value. If more values were supplied, only
the last pair was considered.
@Issue: https://github.com/thorvg/thorvg/issues/3191
This eliminates the jerryscript features
which are unlikely to be used by thorvg.
- JERRY_LINE_INFO
- JERRY_PROMISE_CALLBACK
- JERRY_FUNCTION_TO_STRING
- JERRY_MEM_GC_BEFORE_EACH_ALLOC
- JERRY_CPOINTER_32_BIT
- JERRY_REGEXP_STRICT_MODE
We have improved the functionality to manage the memory pool safely,
by figuring out the current working threads. Users no longer need to
manually configure memory pool management, and the related APIs
have been removed.
API Removals:
- Result SwCanvas::mempool(MempoolPolicy policy)
- enum SwCanvas::MempoolPolicy
- Tvg_Result tvg_swcanvas_set_mempool(Tvg_Canvas* canvas, Tvg_Mempool_Policy policy)
- enum Tvg_Mempool_Policy
issue: https://github.com/thorvg/thorvg/issues/3116
Bug introduced as part of a7e7bbc.
After recalculating begin and end to the 0-1 range, an extra
check was added to handle cases when begin is very close to end.
However, this was a bad approach since, even for very close values,
their relationship remains important. What should have been
done in the mentioned commit is properly handling the case
begin == end, which was incorrectly treated as trimming from begin
to end. Instead, it should be handled as trimming from begin to
1.0 and from 0.0 to end.
@Issue: https://github.com/thorvg/thorvg/issues/3204
- In cases where the begin and end values of trimming did not
result in trimming (end - begin > 1), trimming was ignored.
However, when the stroke is also dashed, this case affects
the shift of the point where the first dash becomes visible.
- Trimming that passes through the curve's start point (like -0.1:0.1)
requires passing through the curve twice. The points obtained from
both passes must be joined - visible when dashing
Cases for simultaneous = true have been handled.
@Issue: https://github.com/thorvg/thorvg/issues/3192
The idea of introducing epsilon during trimming was to
eliminate the occurrence of short segments whose length
would be zero when higher computational accuracy was used.
By mistake, during the refactor of 8ed4c2f302,
one of the conditions was lost. Fixed.
@Issue: https://github.com/thorvg/thorvg/issues/3053
The trim handling from sw_engine has been removed.
Instead the common logic from the TrimPath structure
is used.
On the sw_engine side, the dashed outline is now
used for both: dashed and/or trimmed strokes.
@Issue: https://github.com/thorvg/thorvg/issues/2854
frame tweening allows user to interpolate two frames
over a speicified duration. This Tweening functionality
can be particularly powerful when combined with state-based
(a.k.a. Marker) animation playback in Lottie.
For example, apps support state machine based animations,
where the transition sequences between states are not linear
and can occur in highly irregular directions.
Experimental APIs:
- Result LottieAnimation::tween(float from, float to, float progress)
- Tvg_Result tvg_lottie_animation_tween(Tvg_Animation* animation, float from, float to, float progress)