The differences resulted from discrepancies between
the engines in applying equality or inequality signs
and in using different precision levels when determining
the dash remainder when transitioning to a new path
command.
@Issue: https://github.com/thorvg/thorvg/issues/3265
Support the bindings to be more integrable with a system's coherent memory management.
Pleaes note that thorvg now only allow the desinated memory allocators here:
malloc -> tvg::malloc
calloc -> tvg::calloc
realloc -> tvg::realloc
free -> tvg::free
issue: https://github.com/thorvg/thorvg/issues/2652
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
Ensure they do not terminate prematurely for paths
with a step of 0 or exceptionally small values
when a valid stroke-width is present.
In my opinion, the optimal approach was to separate vertex generation
into dedicated methods: strokeRoundPoint and strokeSquarePoint.
My update supports two different stroke-cap styles.
I have also tested it with various files (JSON, SVG)
as well as a small example application similar
to the one included in the previous pull request (#3066).
issue: https://github.com/thorvg/thorvg/issues/3065
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.
* Optimize clip logical, change to use GL_GRATER and keep incrace depth
value, so no need to do depth clear after every clip draw.
* Correct geometry bounding box calculation, and make sure the bounds is
larger than all vertices
* Limit drawing area for off-screen RenderPass with correct scissor box
* restrict the scissor box of composite task
* do not tessellate stroke or fill geometry if there is no Fill or
Stroke color
* use actually transformed curve to calculate polyline count when doing
curve flatten
* Fix error when handle GradientTransform calculation. And move the inv
calculation into gradient vertex shader.
* Fix cubic tessellation not close the last point
Since we choose MSAA, no need to calculate edge alpha during fragment
stage. So this commit removed the alpha attribute and related code:
* Remove the alpha attribute in vertex data.
* Change position type from `vec3` to `vec2` in all shader code.
* Remove alhpa multiplication in all fragment shaders
* add new render task to do stencil and cover rendering which is a
fallback rendering method to handle cases that trianglation tessellation
failed
* add a new tessellator to generate stencil and cover vertex mesh
* merge vertices that are close enough before tessellation
* append return branch in tessellation to prevent dead loop caused by floating point precision