Commit graph

2930 commits

Author SHA1 Message Date
Hermet Park
3dcc22309d gl_engine/renderer: code clean up
separate private / public methods designated in sectors.

no logical changes.
2024-09-30 12:53:08 +09:00
Hermet Park
f22afaefc2 gl_engine: ++thread safety
The `dispose()` method can be called on a worker thread.
GL resources are released on `sync()`, ensuring guaranteed thread safety.
2024-09-30 12:52:38 +09:00
Sergii Liebodkin
9b638ea470 examples: fix surface refresh approuchfor webgpu
Move surface refresh approach from engine side to user size.
2024-09-30 12:51:09 +09:00
Sergii Liebodkin
e27ce23d4b wg_engine: fix blend methods support
Full review of blending support.
Support Solid color, Gradient fill and Image blending workflows

See Blending, SceneBlending, Opacity examples
2024-09-30 12:51:02 +09:00
RuiwenTang
35d168db9e gl_engine: support simple hairline stroke rendering
Reduce alpha if stroke width is too thin to mock hairline rendering
2024-09-30 12:50:43 +09:00
RuiwenTang
338c75ca3a gl_engine: optimize off-screen rendering
Performing a full-screen RenderPass resolve is too expensive.
Because most composite cases only require a small area to be rendered off-screen.
To improve performance, use the bounds of the Geometry for off-screen rendering whenever possible
2024-09-30 12:50:17 +09:00
Hermet Park
ce50165103 common: Fix a compilation failure on VS 2017
issue: https://github.com/thorvg/thorvg/issues/2512
2024-09-30 12:49:06 +09:00
Sergii Liebodkin
21286f679d wg_engine: fix scene opacity usage
Changed blend equation to make it the same as for referenced sw renderer.
2024-09-30 12:48:58 +09:00
Hermet Park
359ad22b3a lottie: fix a regression bug of masking
InverseAlphaMasking should be applied as intended,
but it was mistakenly reverted to alpha.

regression in v0.14.0 by: 2c7a83406e
2024-09-30 12:48:50 +09:00
Hermet Park
dd0705eef9 lottie: allow image asset sharing among LottiePicture instances
Previously, the Lottie builder didn't account for image asset sharing
among multiple layers. This update rectifies the situation.

issue: https://github.com/thorvg/thorvg/issues/2428
2024-09-30 12:48:08 +09:00
Hermet Park
3390ff21fc sw_engine: support the grayscale scaled-image drawing 2024-09-30 12:46:56 +09:00
Hermet Park
98e613e3f0 lottie/parser: optimization++
Skip the data constructuion if the mask mode
is none. it's not used at all.
2024-09-30 12:46:49 +09:00
Hermet Park
b94c30675c lottie/builder: revise the masking update.
Append the mask shape to the previous one, instead of composition,
when it's able by the condition.

issue: https://github.com/thorvg/thorvg/issues/2426
2024-09-30 12:46:40 +09:00
Josh Soref
bb33a84a30 infra/workflow: Use GitHub Step Summary
Unlike comments, Step Summaries do not require permissions.
2024-09-30 12:46:32 +09:00
Josh Soref
2fa723c947 infra/workflow: Reduce workflow permissions
By explicitly listing the permissions required in general, repositories
without restrictive permissions will only allocate the specified
permissions which is much safer than the default, fairly wide,
permissions grant.

Most workflows don't appear to need any permissions beyond
`contents: read` which is required for checkout (when a repository is
private). By specifying this permission, it tells GitHub not to include
any of its additional default permissions (when a repository is
configured permissively).

The .github/workflows/memcheck_*.sh scripts called by build_ubuntu.yml
require write permissions in order to post their output to a pull
request (as a comment).

In locked down GitHub repositories, unless a workflow/job asks for
write permissions, it will not have them and such API calls will result
in:

{
  "message": "Resource not accessible by integration",
  "documentation_url": "https://docs.github.com/rest/issues/comments#create-an-issue-comment",
  "status": "403"
}

By specifically requesting the permissions, the workflow will continue
to work as expected.
2024-09-30 12:46:24 +09:00
Josh Soref
dab9794e28 infra/workflow: Declare limited permissions for regression
Note that this workflow currently imagines writing a comment.
It does not actually try to do so, and thus there is no need to ask
for permission to use `pull-requests: write`.

If at some point, someone decides to fix that feature, they
will need to add that permission.

OTOH, using a GitHub Step Summary instead does not require any permissions.
2024-09-30 12:45:55 +09:00
Josh Soref
0e48234cab infra/workflow: Only comment if there is output 2024-09-30 12:45:47 +09:00
Mira Grudzinska
ceae547062 sw_engine: fix aa
For shapes with a stroke that has opacity, anti-aliasing
should be applied to a fill.
The use of a transparent gradient stroke will also be handled
correctly.
2024-09-30 12:45:40 +09:00
Hermet Park
7b79f37dd2 api: ++description
issue: https://github.com/thorvg/thorvg/issues/2494
2024-09-30 12:45:29 +09:00
Hermet Park
3d3c76083f updated AUTHORS 2024-09-30 12:45:22 +09:00
Hermet Park
74cd0ba0e7 common: code refactoring
replaced min/max with the standard library
2024-09-30 12:45:14 +09:00
Hermet Park
fad80deceb lottie: remove exception handling
don't stop the parsing when the data type is incorrect.
just let it slide.

issue: https://github.com/thorvg/thorvg/issues/2389
2024-09-30 12:42:17 +09:00
Hermet Park
dfa2b78ad8 lottie/rapidjson: --assert
Save binary size about 0.8kb
2024-09-30 12:42:10 +09:00
Josh Soref
e3c66db301 common: fix 178+ spelling errors 2024-09-30 12:41:38 +09:00
Mira Grudzinska
f3e0dc3432 sw_engine: improve grad quality
For gradients with fill spread set as repeat,
the lack of anti-aliasing between the last and
the first color caused noticeable jagged edges.
Interpolation was introduced between them,
visually improving the gradient quality.
2024-09-30 12:37:15 +09:00
Vincent Torri
ab7ff34674 json loader: fix warnings in jerryscript on Windows 2024-09-30 12:37:03 +09:00
Thaddeus Crews
2f2435dd34 common: ensure const equality operators
A minor syntactic adjustment to two instances of operator== and one instance of operator!=, both to the end of ensuring these locally-scoped functions are properly identified as const. In the majority of cases, this shouldn't have any impact; however, this change makes these operators play nice in c++20 contexts.
2024-09-30 12:36:55 +09:00
Hermet Park
0ecd09e7ff doc: polishing++ 2024-09-30 12:36:43 +09:00
Hermet Park
ae4e9d003c bump up version v0.14.0 2024-06-27 14:44:39 +09:00
Hermet Park
a51c067894 test/capi: --compiler warning on MSVC
warning C4305: 'argument': truncation from 'double' to 'float'
2024-06-27 14:44:39 +09:00
Hermet Park
5f4468236c sw_engine: ++thread safety
Synchronize the engine process precisely
before updating internal data.
2024-06-27 14:42:27 +09:00
Hermet Park
6f0ae1cd3f example: do not scan a given resource folder recursively 2024-06-27 14:42:27 +09:00
Mira Grudzinska
66048b31b5 wg_engine: fix shapes closing
Shapes were incorrectly closed in certain cases -
the decision to close a shape or not should be based on
path commands rather than the number of points and
their distances from each other.
2024-06-27 14:42:27 +09:00
Hermet Park
38e2812004 renderer: ++stabilization
This introduces a managed condition to precisely control the
canvas updates. This prevents a crash when the target is
changed and drawn without any update calls.

issue: https://github.com/thorvg/thorvg/issues/2484
2024-06-27 14:42:27 +09:00
Hermet Park
3019bb81e8 example: do not redraw for the static content 2024-06-27 14:42:27 +09:00
Hermet Park
8c11fa085f example: ++exception handling 2024-06-27 14:42:27 +09:00
Mira Grudzinska
0f2fe0c4d4 common: fix rendering failure
In case of a problem with loading font data, there
is no paint inside a text that can be rendered,
but this should not interrupt the rendering process
of other paints. Now fixed.

@Issue: https://github.com/thorvg/thorvg/issues/2468
2024-06-27 14:42:27 +09:00
Mira Grudzinska
90ee76bd7b examples: fix sdl2 headers in Capi example 2024-06-27 14:42:27 +09:00
Hermet Park
89c31d0e35 docs: updated to v0.14 2024-06-27 14:42:27 +09:00
Hermet Park
f3469350b9 lottie: fix a data-race problem
make it sync call before accessing the composition data
from marker and segments.

issue: https://github.com/thorvg/thorvg/issues/2462
2024-06-27 14:42:27 +09:00
Hermet Park
dcf67e9c14 Revert "renderer/canvas: Check refresh before draw"
This reverts commit 60212747b5.

this triggered duplicated updates,
it came up with many thread sanitizer problems.

issue: https://github.com/thorvg/thorvg/issues/2462
2024-06-27 14:42:27 +09:00
Sergii Liebodkin
a671254400 examples: fix sdl2 headers includes path
Fix SDL2 headers include path to release IDE warnings.
Tested on linux and macos
2024-06-27 14:42:27 +09:00
Mira Grudzinska
ff3767da2b tests: ++coverage 2024-06-27 14:42:27 +09:00
Hermet Park
b6597fc1ef apis: promotes to official apis.
C++
- GlCanvas::gen()

CAPI
- TVG_COMPOSITE_METHOD_INVERSE_LUMA_MASK
2024-06-27 14:42:27 +09:00
Sergii Liebodkin
119ca34219 wg_engine: force texture data writing on GPU side
Texture must be fully uploaded into GPU memory before we can use or destroy it.
This change force texture data updates
2024-06-27 14:42:27 +09:00
Mira Grudzinska
e8702de059 tvg_saver: fix 'order' serialization
Serialization of the "order" attribute caused
the bytes counter to be overwritten, resulting
in the created TVG file being corrupted.
Correctly created tag.tvg file has been included
as a test resource..
2024-06-27 14:42:27 +09:00
Hermet Park
fd6385a17b example: synchronize the canvas before the window pops up.
This ensures that the window pops up with the appropriate content,
since windows can be popped up asynchronously with mainloop.
2024-06-27 14:42:27 +09:00
Sergii Liebodkin
58705281cd wg_engine: fix stroke mitter limit
Change the appliense of stroke mitter limit as in SVG spec

Before/After
2024-06-27 14:42:27 +09:00
RuiwenTang
2c84033a07 gl_engine: correct the return value of render function
If RenderData has nothing to draw, need to return `true`.
2024-06-27 14:42:27 +09:00
Hermet Park
8259bb9d4e doc: removed useless information for easier maintainence.
That basic information is addressed in the Results section.
We can only add information that pertains to a specific scenario.
2024-06-27 14:42:27 +09:00