Commit graph

2412 commits

Author SHA1 Message Date
Hermet Park
4b01c0ef52 renderer/canvas: ++exceptional handling.
do not allow change the target if the condition is not satisfied.
2024-06-27 14:42:27 +09:00
JunsuChoi
35b1d9a544 renderer/canvas: Check refresh before draw
If target() is called again after update() is called and the size of the buffer changes, a crash may occur.
Therefore, check the refresh variable and perform drawing after update().
2024-06-27 14:42:27 +09:00
RuiwenTang
5836661155 gl_engine: Fix compile error if only has OpenGL library on MacOS
Since GLES headers and library can not be found on MacOS,
use macros to determin if link with OpenGL library.
2024-06-27 14:42:27 +09:00
Hermet Park
2fb79eca7d sw_engine: fix missing fill/stroke raster
properly update the fill/stroke when the path
has been changed
2024-06-27 14:42:27 +09:00
Hermet Park
d5c38cebb7 renderer: minor optimization
reduce the path flag writing
2024-06-27 14:42:27 +09:00
Hermet Park
933176e309 lottie: hotfix for preventing a crash.
MaskMode=None is not properly addressed,
Prevent the crash from the use-case.

issue: https://github.com/thorvg/thorvg/issues/2426
2024-06-27 14:42:27 +09:00
Mira Grudzinska
58e24f63a4 sw_engine: fix stroke miterlimit precision
Since the value was casted to int the results
were different than expected.
2024-06-27 14:42:27 +09:00
Hermet Park
ef409139c2 infra: promote the GL engine to an official one.
The ThorVG OpenGL/ES engine has been stabilized and improved
significantly. Now, as a graphics engine, its drawing features
are quite functional. It is time to officially release the
engine and maintain it in the release process.

Thanks @Ruiwen for going above and beyond!

issue: https://github.com/thorvg/thorvg/issues/2435
2024-06-27 14:42:27 +09:00
Mira Grudzinska
0a53090a87 docs: descriptions++ 2024-06-27 14:42:27 +09:00
Sergii Liebodkin
f40586bd3d wg_engine: fix incorrect geomatry
Fix computation of segments count for cubic curves.
Using screen coordinates of base points, instead of world coordinates
2024-06-27 14:42:27 +09:00
Hermet Park
0d9b7c2006 gl_engine: improve the dependency check
- dependency() works with a pkgconfig, more preferred.
- add fallback to GL library search with candididates.
2024-06-27 14:42:27 +09:00
Hermet Park
a0c6025132 lottie: fix a compile error on MSC with clang.
issue: https://github.com/thorvg/thorvg/issues/2347
2024-06-27 14:42:27 +09:00
Hermet Park
8b5d2e4a13 sw_engine: ++exception handling
prevent the out of range anti-aliasing frames.

issue: https://github.com/thorvg/thorvg/issues/2401
2024-06-27 14:42:27 +09:00
Hermet Park
8332ee3b95 sw_engine: hotfix avx/neon 8 bit rasterizer.
recte/rle 8 bit rasterizer has been broken,
make it work safely with c raster version.

issue: https://github.com/thorvg/thorvg/issues/2146
2024-06-27 14:42:27 +09:00
Mira Grudzinska
03242b5367 common: add missing ifdef
In the absence of support for the TTF loader
crashes occurred. Fixed.
2024-06-24 14:56:36 +09:00
Mira Grudzinska
d9326921fa lottie: fix repeater order
Assigning numbers 1 or 2 to a bool always
resulted in true. Now fixed and repeated
shapes are drawn in the proper order.
If the repeater had no elements, iterating
shapes from the end would result in a segf.
This issue is now fixed.
2024-06-24 14:56:31 +09:00
Hermet Park
70daa7b399 infra: --EGL dependency
there is no more EGL dependency in gl engine.
2024-06-24 14:56:24 +09:00
Sergii Liebodkin
9c9999169e wg_engine: fix scene rendering with blend
Fix allplience of the blend method, that setuped for scene, but not for a shape
Overlay blend func changed to be close to spec
2024-06-24 14:56:14 +09:00
Mira Grudzinska
08d310111e capi: text c-api binding
@Issue: https://github.com/thorvg/thorvg/issues/2374
2024-06-24 14:55:02 +09:00
Sergii Liebodkin
2725ccfcd7 wg_engine: skip shapes with zero opacity values
Skip shapes rendering, if opacity is 0 and if fill color for shape and strokes also equal to 0
This behavior is used in sw renderer and fix visual artifacts in referenced animations.
Also this rule fix composition results in case of AlphaMask and InvAlphaMask methods
2024-06-24 14:54:56 +09:00
Hermet Park
7008d26d05 wg_engine: --redundant code 2024-06-24 14:54:49 +09:00
Mira Grudzinska
393fc88570 common: force the use of ttf loader for font data
Providing an incorrect mimetype or not specifying one
was not handled and resulted in data not being loaded
when loading the font from memory.
Now, the use of the TTF loader is enforced regardless
of the provided mimetype.
2024-06-24 14:53:21 +09:00
Mira Grudzinska
33640eae83 common: fix returned value
In the case of requesting to unload a font that
has not been previously loaded, InsufficientCondition
should be returned, not InvalidArgument.
2024-06-24 14:52:27 +09:00
Sergii Liebodkin
596845d1cf wg_engine: fix composition math
Fix AlphaMask, InvAlphaMask, LumaMask and InvLumaMask math
Fix double apllience of opacity value
2024-06-24 14:52:21 +09:00
Sergii Liebodkin
7bbd058bd7 wg_engine: fix fill rule usage
Fix wronk application of fill rule in a cases of terminated path (.close()/.moveTo())
2024-06-24 14:52:15 +09:00
Sergii Liebodkin
5cf7c756db wg_engine: fix strokes failers and visual atrifacts
Ignoring rezo-width strokes, single point strokes.
Fix visual artifacts in case of mitter joints.
2024-06-24 14:52:09 +09:00
Hermet Park
2079c95668 infra: build wg canvas properly. 2024-06-24 14:52:03 +09:00
Hermet Park
784ff30008 renderer/canvas: clean up code
pimpl is not used at all.
2024-06-24 14:51:57 +09:00
Mira Grudzinska
4c546f843f capi: remove the incorrectly named API
There was a typo in the name (tvg_canvas_est_viewport),
which made it seem like it was missing. The correctly
named API has already been added, so this one can be
removed.
2024-06-24 14:51:51 +09:00
Hermet Park
56d3885f24 sw_engine: fix a crash issue.
set the anti-aliasing frame info properly, in an exceptional case.

issue: https://github.com/thorvg/thorvg/issues/2391
2024-06-24 14:51:40 +09:00
Hermet Park
59194b8ab2 sw_engine: fix a missing anti-aliasing
enable fill anti-aliasing when the stroke is trimming.
2024-06-24 14:51:34 +09:00
Hermet Park
35b1f4933d infra: relocate the tools folder.
Collect only library source code in src
2024-06-24 14:51:27 +09:00
Hermet Park
1d9adab607 infra: ++wg_native package dependency
Windows might need a own library linking method.
2024-06-24 14:50:55 +09:00
Sergii Liebodkin
9b4df3f0af wg_engine: fix model view matrix
In a case of compostions model view matrix did not apply samples count
2024-06-24 14:50:49 +09:00
Sergii Liebodkin
23d50fcda5 wg_engine: clear bbox mesh lists
when cleaning the geometry of an object, it is also necessary to clean the bounding boxes and store them in the pool
2024-06-24 14:50:42 +09:00
Sergii Liebodkin
47b9866f8b wg_engine: cross-platform support
it provide changes public API for webgpu canvas interface to provide nessessary handles to native window for different platforms:

API Change:
- Result target(void *instance, void *surface, uint32_t w, uint32_t h) noexcept;
2024-06-24 14:50:28 +09:00
Mira Grudzinska
ec77d8bd89 ttf_loader: support loading from memory
New text API for loading fonts from memory
is introduced. This is necessary to enable
embedded fonts support.
2024-06-24 14:50:13 +09:00
RuiwenTang
063474ba05 gl_engine: fix clip path and bounds not correct
* 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
2024-06-24 14:47:33 +09:00
Hermet Park
7e83590ec5 wg_engine: resolve gcc compiler warnings.
virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor]
2024-06-24 14:45:26 +09:00
Hermet Park
4b4514a8b0 wg_engine: add the wgpu_native library dependency.
about the wgpu-native please visit:
https://github.com/gfx-rs/wgpu-native/releases
2024-06-24 14:45:19 +09:00
Hermet Park
28ac09648e common: fix a crash on CI windows test.
it's a vs2022 17.10 stl known issue.
https://github.com/microsoft/STL/wiki/Changelog
2024-06-24 14:44:58 +09:00
Mira Grudzinska
70c2260cfb svg_loader: handle text node
The text node is handled, but default values
of the font-family and font-size as used in
the user's system are not.
For now font has to be loaded by the user.

@Issue: https://github.com/thorvg/thorvg/issues/2350
2024-06-24 14:44:52 +09:00
Hermet Park
d928c93239 renderer: optimize the ClipPath fast-track.
this optimization applies when the clipper is
not an axis-aligned rectangle under the following conditions:

a. Coverage where the clipper is a regional superset of the viewport.
b. Coverage where the clipper is completely outside of the viewport.

issue: https://github.com/thorvg/thorvg/issues/2332
2024-06-24 14:44:21 +09:00
Hermet Park
5a6d31a2e9 renderer: code clean up 2024-06-24 14:44:15 +09:00
Hermet Park
0cf840fbd4 common/math: added minor math functions. 2024-06-24 14:44:05 +09:00
Mira Grudzinska
b95fa3a7bd sw_engine: fix fastTrack condition
When checking the fastTrack condition,
it's necessary to exclude the outlines
with a Bezier curve (Move-Cubic-Line,
Move-Cubic-Close, Move-Line-Cubic).

@Issue: https://github.com/thorvg/thorvg/issues/2379
2024-06-24 14:43:54 +09:00
Mira Grudzinska
733f0996d8 docs: resolve doxygen warnings 2024-06-24 14:43:48 +09:00
Hermet Park
3c3ad144a7 Revert "sw_engine: revert the threshold."
This reverts commit dad797445b.

Misidentified the key issue. It will be reviewed again.
2024-06-24 14:43:07 +09:00
Hermet Park
f9c86fc38a sw_engine: revert the threshold.
Somehow, it breaks the window unit-test, revert the value.

regression by: 51a2936b28
2024-06-24 14:43:00 +09:00
Hermet Park
7fd552fab0 sw_engine: fine-tuning RLE performance.
the arranged value is examined with the local test,
improved the speed twice for a corner-case that
extreamly huge size shape.
2024-06-24 14:42:54 +09:00