Hermet Park
5bdb585534
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-04-05 17:37:55 +09:00
Sergii Liebodkin
84d3ef7184
wg_engine: introduced compute pipeline entities
...
introduces posibility to create compute pipelines
does not affect functionality
2024-04-05 17:37:49 +09:00
Hermet Park
0d337deddb
examples/gif: revise the sample.
...
60fps takes a bit long time for our daily testing.
Removed it for the speed.
2024-04-05 17:37:44 +09:00
Hermet Park
9972fa9831
svg_loader: code refactoring
...
removed duplicate matrix multiply function.
2024-04-05 17:37:39 +09:00
Mew Pur Pur
d23e0fd22c
svg_loader: Add missing implementation of skewX and skewY in transform-list
2024-04-05 17:37:33 +09:00
Hermet Park
bd4cda3c73
sw_engine: fix a regression bug
...
invalidate cached compositors when target size is changed.
compositors must be re-initialized with a new size.
regression bug by ca3c1fc1b9
2024-04-05 17:35:18 +09:00
Hermet Park
96f5f82050
sw_engine: retain the compositor cache memory
...
The compositor memory is likely to be reused in the next frame.
To enhance performance, it is advisable to retain this memory by default.
We may consider introducing a cache policy interface in the Initializer.
This would allow users to manage the Canvas memory more effectively.
Anyhow, this improves the Lottie example performance by 10%
2024-04-05 17:35:11 +09:00
RuiwenTang
fc7ba88585
gl_engine: append stencil attachment in GLRenderTarget
...
Plans to use stencil to test support for path clipping and complex path rendering
When the tessellation algorithm cannot handle it.
2024-04-05 17:34:59 +09:00
Hermet Park
c9ee5d274d
sw_engine: tweak the image down-scaler.
...
Adjust the sampling count according to the scale ratio.
This significantly improves performance
while making it hard to recognize any loss in image quality.
Lottie example performance has improved by 15%.
2024-04-05 17:30:28 +09:00
Hermet Park
e2914c3cd6
examples: updated scale up/down
2024-04-05 17:29:58 +09:00
Sergii Liebodkin
96e0794a67
wg_engine: introduced scene opacity
...
[issues 1479: opacity](#1479 )
Supported opacity value for scene
Usage example:
//Create a Scene
auto scene = tvg::Scene::gen();
scene->opacity(100);
//Prepare Circle
auto shape1 = tvg::Shape::gen();
shape1->appendCircle(400, 400, 250, 250);
shape1->fill(255, 255, 0);
shape1->opacity(100);
scene->push(std::move(shape1));
//Round rectangle
auto shape2 = tvg::Shape::gen();
shape2->appendRect(450, 100, 200, 200, 50, 50);
shape2->fill(0, 255, 0);
shape2->strokeWidth(10);
shape2->strokeFill(255, 255, 255);
scene->push(std::move(shape2));
canvas->push(std::move(scene));
2024-04-05 17:28:34 +09:00
Hermet Park
780f30bfcc
sw_engine: removed redundant logic.
...
Basically, sw_engine uses a desinated memory pool,
this reservation is not so effective.
2024-04-05 17:28:27 +09:00
Hermet Park
27d85f5861
lottie: Improve feature coverage by correctly handling XOR shapes
...
XOR when the shape's direction property is set to a value of 2.
Currently, the direction property is expected to have
either 1 for clockwise or 3 for counterclockwise orientation.
Just found out the number 2 use-case...
2024-04-05 17:28:08 +09:00
Hermet Park
ed55c04a26
examples: revise the usage.
...
Remove the canvas buffer clear call
when the solid bg is introduced.
2024-04-05 17:28:08 +09:00
Hermet Park
3c98cb5828
lottie: Fixed the issue with gradient filling.
...
Previously, multiple gradients within a single group
couldn't be accounted for during rendering.
This fix addresses the scenario by fragmenting the rendering context.
2024-04-05 17:28:08 +09:00
Hermet Park
5b89479963
lottie: properly capture the stroking context
...
Each group must determine the stroking rendering contexts
and assess whether context switching has occurred.
Migrate the sequence from the root layer to all groups.
2024-04-05 17:28:08 +09:00
Hermet Park
441542b272
common: STM32 portability enhancement
...
Some systems such as micro-processor might not support
the thread feature on the system.
Enhance the portability by compiling the thorvg with toggling the
threading depepdency through the build option.
For this, thorvg newly introduced the internal Key/ScopedLock abstraction
for transparent thread-locking dependnecy.
To turn off the thread feature, please use the next build option:
$meson setup build -Dthreads=false ...
Note that, the thread feature is enabled in default.
Turning off the thread feature could reduce the binary size by 7kb.
issue: https://github.com/thorvg/thorvg/issues/1900
2024-04-05 17:28:08 +09:00
Sergii Liebodkin
af6969e15e
wg_engine: introduced composition ability
...
[issues 1479: Masking](#1479 )
Supported composition methods:
AlphaMask
InvAlphaMask
LumaMask
InvLumaMask
AddMask
SubtractMask
IntersectMask
DifferenceMask
Usage example:
//Solid Rectangle
auto shape = tvg::Shape::gen();
shape->appendRect(0, 0, 400, 400);
shape->fill(0, 0, 255);
//Mask
auto mask = tvg::Shape::gen();
mask->appendCircle(200, 200, 125, 125);
mask->fill(255, 255, 255); //AlphaMask RGB channels are unused.
//Nested Mask
auto nMask = tvg::Shape::gen();
nMask->appendCircle(220, 220, 125, 125);
nMask->fill(255, 255, 255); //AlphaMask RGB channels are unused.
mask->composite(std::move(nMask), tvg::CompositeMethod::AlphaMask);
shape->composite(std::move(mask), tvg::CompositeMethod::AlphaMask);
canvas->push(std::move(shape));
//Star
auto star = tvg::Shape::gen();
star->fill(80, 80, 80);
star->moveTo(599, 34);
star->lineTo(653, 143);
star->lineTo(774, 160);
star->lineTo(687, 244);
star->lineTo(707, 365);
star->lineTo(599, 309);
star->lineTo(497, 365);
star->lineTo(512, 245);
star->lineTo(426, 161);
star->lineTo(546, 143);
star->close();
star->strokeWidth(30);
star->strokeJoin(tvg::StrokeJoin::Miter);
star->strokeFill(255, 255, 255);
//Mask3
auto mask3 = tvg::Shape::gen();
mask3->appendCircle(600, 200, 125, 125);
mask3->fill(255, 255, 255); //AlphaMask RGB channels are unused.
mask3->opacity(200);
star->composite(std::move(mask3), tvg::CompositeMethod::AlphaMask);
if (canvas->push(std::move(star)) != tvg::Result::Success) return;
2024-04-05 17:28:08 +09:00
RuiwenTang
78b2435596
gl_engine: fix radial gradient not render correctly
...
root cause: the gradient shader not taking into account FillSpread property
2024-04-05 17:28:08 +09:00
Hermet Park
be65d9d2e5
renderer/shape: fixed a regression bug
...
the bug was introduced in 9bf8bb018d
.
Migrated the circle commands to the rectangle, which is currently necessary.
Retained the previous circle commands for backward compatibility.
2024-04-05 17:28:08 +09:00
Hermet Park
8b26f8b7ea
lottie: Corrected the Time Remapping Range ( #1907 )
...
enable exceeding the range of normalized values in time remapping.
the issue came from a misunderstanding of the lottie spec.
issue: https://github.com/thorvg/thorvg/issues/1809
2024-04-05 17:28:08 +09:00
Hermet Park
388631be68
lottie: Newly added support for the text feature.
...
This enhancement enables embedded glyphs rendering.
The 'fonts' and 'chars' properties are now supported.
2024-04-05 17:28:05 +09:00
Hermet Park
5a7de430e0
renderer/shape: refine the circle draw commands.
...
Adjusted the path's start point to 90 degrees
to align the origin consistently with other path commands.
No compatibility issue, this only could affect the trimpath effects.
2024-04-05 17:21:53 +09:00
Hermet Park
a078f14bb3
loader: code refactoring
...
Ensure scene data is freed when it's dangled in the loader.
2024-04-05 17:21:18 +09:00
Gabor Kiss-Vamosi
c099ec94b1
fix another type mismatch
2024-04-05 17:20:59 +09:00
Gabor Kiss-Vamosi
bc3e6ec99d
fix the prototype of mpoolInit
2024-04-05 17:20:46 +09:00
Hermet Park
29a0469e1c
ttf: Fixed an invalid unicode encoding.
...
Ensured the data count is correctly multiplied by the data size.
2024-04-05 17:20:38 +09:00
JunsuChoi
7220ebba3c
loader/svg: Skip check for quotes inside quotes
...
Single or double quotation marks that occur before
closing the quotation mark are ignored.
2024-04-05 17:20:32 +09:00
Hermet Park
25ea242d38
saver/tvg: removed an unstable condition.
...
this optimization breaks the scene composition, remove it.
Issue: https://github.com/thorvg/thorvg/issues/1750
2024-01-03 16:21:15 +09:00
Jinny You
959f45313e
wasm: Revise saver methods
2024-01-03 14:15:23 +09:00
Hermet Park
cf76f2f604
ttf: removed the beta tag.
...
incorporate TTF support into the CI build tests.
2024-01-03 11:52:23 +09:00
Hermet Park
8c3c2ab652
ttf: fix the windows compilation errors.
2024-01-03 11:52:18 +09:00
Hermet Park
cfb9ea8a43
tvg picture: binary version up.
2024-01-02 20:34:12 +09:00
Sergii Liebodkin
4242485810
xides compilation issue with loaders ( #1885 )
2024-01-02 20:34:12 +09:00
Hermet Park
4ebbd0aefc
examples: ++safety.
...
Guarantee the resource free at the termination.
2024-01-02 20:34:12 +09:00
Hermet Park
ab744fc164
svg: ensure that all allocated memory.
...
observed a memory leak at a corner case.
2024-01-02 20:34:12 +09:00
Hermet Park
38c625d070
renderer: enhanced shared surface handling with mutex implementation
...
Introduced a dedicated mutex for each surface instance
to ensure safe sharing between the loader, renderer, and engine.
This enhancement allows for secure modification and access to bitmap data,
addressing potential concurrency issues.
Multiple Picture instances can now safely share a single loader instance,
optimizing performance.
This change builds upon the previous Loader Cache improvements:
ff6ea4b6c4
2024-01-02 20:34:12 +09:00
Hermet Park
102414d56f
lottie: resolve a thread sanitizer report.
...
Issue: https://github.com/thorvg/thorvg/issues/1874
2024-01-02 20:34:12 +09:00
Hermet Park
15d1def0ec
renderer/loader: improve thread safety
...
activeLoaders can be accessed by loaders within the worker thread.
the issue came up with the Loader cache feature:
ff6ea4b6c4
Issue: https://github.com/thorvg/thorvg/issues/1874
2024-01-02 20:34:12 +09:00
Hermet Park
4d344c888e
sw_engine: resolve a thread sanitizer report.
...
Synchronize before accessing the shared bbox.
Issue: https://github.com/thorvg/thorvg/issues/1874
2024-01-02 20:34:12 +09:00
Hermet Park
65ff0ba1b1
renderer/taskscheduler: Resolve a thread sanitizer report.
...
Since each thread worker accesses the 'threads.count' variable,
delay the thread starting until initialization is completed.
2024-01-02 20:34:12 +09:00
Hermet Park
60282f51f8
renderer/loader: code refactoring.
...
Removed internal unique_ptr usage for a more compact size.
2024-01-02 20:34:12 +09:00
Hermet Park
4997f55e6c
Revert "svg: removed an unnecessary nested scene."
...
A regression bug is occured.
clipper is also required to be transformed with loader->resize()...
This reverts commit e62a8668e7
.
2024-01-02 20:34:12 +09:00
Hermet Park
884a505d6a
text/ttf: fixed all memory violations.
2024-01-02 20:34:12 +09:00
Hermet Park
56d4628ee1
svg: removed an unnecessary nested scene.
2024-01-02 20:34:12 +09:00
Jinny You
92288c8291
updated copyright date ( #1866 )
2024-01-02 20:34:12 +09:00
Hermet Park
2ae8613a25
gl_engine: fix a compiler warning.
...
../src/renderer/gl_engine/tvgGlRenderer.cpp:450:24: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
450 | for (auto i = 0; i < mComposePool.count; i++) {
|
2024-01-02 20:34:12 +09:00
RuiwenTang
2db45c7ba0
gl_engine: fix svg gradient position not correct
...
* change the color and stop size to 16 in shader and buffer block
* calculate transform when upload gradient info to gpu pipeline
2024-01-02 20:34:11 +09:00
Hermet Park
dab0380398
examples/text: Added Text example.
2024-01-02 20:34:11 +09:00
Hermet Park
54528b6ac9
renderer: introduce a ThorVG Text interface.
...
Introduced New APIs under the experimental tags.
- Result Text::font(const char* name, float size, const char* style = nullptr);
- Result Text::text(const char* text);
- Result Text::fill(uint8_t r, uint8_t g, uint8_t b);
- static Result Text::load(const std::string& path);
- static Result Text::unload(const std::string& path);
- static Text::std::unique_ptr<Text> gen();
- static Text::uint32_t identifier()
@Issue: https://github.com/thorvg/thorvg/issues/969
2024-01-02 20:34:11 +09:00