Commit graph

20 commits

Author SHA1 Message Date
Hermet Park
1f996c1382 sw_engine: rectify consecutive line drawings.
There are differences in behavior compared to the SVG spec,
especially when consecutive line drawings occur without a moveTo command
following a closePath command.

Actually, thorvg didn't care the behavior in that scenario,
this update ensures the scenario is handled correctly
to align with the SVG specification.

issue: https://github.com/thorvg/thorvg/issues/1487
2024-03-27 10:53:32 +09:00
Vincent Torri
2ec9fdb932 [common] code clean up
use fmodf() instead of fmod()
2024-03-23 11:45:11 +09:00
Mira Grudzinska
f535a6e139 sw_engine: fix a regression bug
After introducing the length measurement
of approximate and exact Bezier curves in
a8c0030d80
the calculation of the outline length still
used the approximate functions, while further
calculations took the exact value into account.
This discrepancy led to the creation of artifacts.

@Issue: https://github.com/thorvg/thorvg/issues/2021
2024-03-04 11:20:21 +09:00
Hermet Park
9e55eefe13 common: code refactoring
refactor common code to consolidate Bezier and line
function implementations into a single location.
2024-02-20 17:19:15 +09:00
Hermet Park
31b4428dd8 Revert "Revert "sw_engine: Increasing accuracy for dashed curves""
This reverts commit e49f9125b2.
2024-02-20 12:33:00 +09:00
Hermet Park
e49f9125b2 Revert "sw_engine: Increasing accuracy for dashed curves"
This reverts commit a8c0030d80.
2024-02-20 12:23:55 +09:00
Mira Grudzinska
a8c0030d80 sw_engine: Increasing accuracy for dashed curves
Dashed curves require greater precision in calculating
their lengths and while splitting Bezier curves.
Otherwise, it results in visual discrepancies compared
to the expected outcomes.
Approximate functions 'bezLengthApprox' and 'bezAtApprox'
used for calculations in the lottie loader.

issue: https://github.com/thorvg/thorvg/issues/1686
2024-02-20 12:11:43 +09:00
Hermet Park
e7a1e6e43c sw_engine: Address a corner case in trim path handling
This update fixes an issue where duplicated overlapping curves/lines,
when introduced as a single line.
That case overlapping command operation is take account for
the trim path's path-building process.

We now skip such cases to ensure the trim path functions correctly.

issue: https://github.com/thorvg/thorvg/issues/1939
2024-01-30 10:34:01 +09:00
Hermet Park
04121ad2be sw_engine: Rectified dash line drawing issue.
Omit the dash line when its length falls below a minimal threshold.
This threshold is set to less than 0.0001 times the pixel size.
2024-01-24 10:17:38 +09:00
Hermet Park
6ba89df805 sw_engine: removed redundant logic.
Basically, sw_engine uses a desinated memory pool,
this reservation is not so effective.
2024-01-18 17:33:48 +09:00
Jinny You
2c6c8d3b21
updated copyright date (#1866) 2023-12-28 10:43:25 +09:00
Hermet Park
33a2ef0b2d sw_engine: ++null safety 2023-11-10 12:12:39 +09:00
Hermet Park
0cc6cfffef sw_engine/stroke: enhanced the quality of the dash line corners.
Previously, the engine didn't properly cover the dash line corner styles
because it considered a new line to start at the corner.

This update modifies the logic to recognize curved lines
as a single line, including the corners.

There may still be some quality issues,
but it's an improvement over the previous version.

@Issue: https://github.com/thorvg/thorvg/issues/121
2023-10-05 14:30:10 +09:00
Hermet Park
edb156f4fc sw_engine/shape: fix a dash-line infite-loop bug.
a regresion bug was introduced by d683d2e70d
2023-09-21 21:55:53 +09:00
Hermet Park
d683d2e70d sw_engine: Do not handle exceptions for zero line length.
While it may represent a dot with a stroke width,
ignoring its length is not a good idea.

this also eliminates 0 size dash dots caused by unexpected empty lengths.
2023-09-15 11:16:38 +09:00
Hermet Park
78cb32794a sw_engine: utilize the memory pool for dash stroking. 2023-09-05 12:38:57 +09:00
Hermet Park
ad9d9d0ecd loader/lottie: support trimpath feature 2023-09-01 13:16:18 +09:00
Hermet Park
992891e6a8 sw_engine: a minor optimization.
reduced the point counting since we already know some of them.
2023-08-29 13:24:54 +09:00
Hermet Park
5a73bcaa8f common/array: code refactoring
easy access to a specific data with a operator.
2023-08-29 12:28:38 +09:00
Hermet Park
24711e485c infra: renames the source folders
lib -> renderer
bin -> tools
utils -> common
2023-08-28 13:11:24 +09:00
Renamed from src/lib/sw_engine/tvgSwShape.cpp (Browse further)