Commit graph

2953 commits

Author SHA1 Message Date
Hermet Park
d8f00f79be gl_engine: --deprecated warnings on macOS
macOS has officially deprecated OpenGL.
shutdown the warnings to avoid be side-tracked.
2024-07-05 12:17:39 +09:00
RuiwenTang
ea11d4d8a8 gl_engine: fix memory leak when rendering image 2024-07-05 12:13:53 +09:00
Hermet Park
4fee5458b2 gl_engine/renderer: code clean up
separate private / public methods designated in sectors.

no logical changes.
2024-07-05 10:46:47 +09:00
Hermet Park
688952be56 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-07-05 10:46:47 +09:00
Sergii Liebodkin
4693d7f4c1
examples: fix surface refresh approuchfor webgpu
Move surface refresh approach from engine side to user size.
2024-07-04 20:54:14 +09:00
Sergii Liebodkin
e7e6839571
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-07-04 16:19:50 +09:00
RuiwenTang
9bed64a4e7 gl_engine: support simple hairline stroke rendering
Reduce alpha if stroke width is too thin to mock hairline rendering
2024-07-04 12:03:39 +09:00
RuiwenTang
76f98008e8 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-07-04 11:44:02 +09:00
Hermet Park
53a570e680 common: Fix a compilation failure on VS 2017
issue: https://github.com/thorvg/thorvg/issues/2512
2024-07-03 22:45:29 +09:00
Sergii Liebodkin
1afe834021
wg_engine: fix scene opacity usage
Changed blend equation to make it the same as for referenced sw renderer.
2024-07-03 13:47:08 +09:00
Hermet Park
e8f1790e58 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-07-03 13:21:47 +09:00
Hermet Park
cbf124632f 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-07-03 13:21:47 +09:00
Hermet Park
6d8b973666 sw_engine: support the grayscale scaled-image drawing 2024-07-03 13:21:47 +09:00
Hermet Park
4f354f6d5e lottie/parser: optimization++
Skip the data constructuion if the mask mode
is none. it's not used at all.
2024-07-03 13:21:47 +09:00
Hermet Park
269ef22a97 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-07-03 13:21:47 +09:00
Josh Soref
29325c0ff9 infra/workflow: Use GitHub Step Summary
Unlike comments, Step Summaries do not require permissions.
2024-07-03 13:17:10 +09:00
Josh Soref
effb58fc63 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-07-03 13:17:10 +09:00
Josh Soref
8663e33353 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-07-03 13:17:10 +09:00
Josh Soref
af0cb93836 infra/workflow: Only comment if there is output 2024-07-03 13:17:10 +09:00
Mira Grudzinska
57cdff0d9e 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-07-03 13:14:25 +09:00
Hermet Park
e4c4a95495 api: ++description
issue: https://github.com/thorvg/thorvg/issues/2494
2024-07-02 18:21:11 +09:00
Hermet Park
0f36675f6d updated AUTHORS 2024-07-01 22:13:15 +09:00
Hermet Park
189b1bf4e7 common: code refactoring
replaced min/max with the standard library
2024-07-01 22:10:46 +09:00
Hermet Park
a48b6003af 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-07-01 22:07:06 +09:00
Hermet Park
fb20df9ad9 lottie/rapidjson: --assert
Save binary size about 0.8kb
2024-07-01 22:07:06 +09:00
Josh Soref
e061fa6628
common: fix 178+ spelling errors 2024-07-01 21:58:46 +09:00
Mira Grudzinska
98c6d92793 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-07-01 18:24:30 +09:00
Vincent Torri
4a23c39520 json loader: fix warnings in jerryscript on Windows 2024-07-01 15:02:46 +09:00
Thaddeus Crews
6e4b8a5bdf
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-06-29 11:39:25 +09:00
Hermet Park
d6e64c0619 doc: polishing++ 2024-06-28 16:14:57 +09:00
Hermet Park
38852538f5 infra: bumped up version v0.14, set it dev mode 2024-06-27 15:12:58 +09:00
Hermet Park
8f9d82c314 test/capi: --compiler warning on MSVC
warning C4305: 'argument': truncation from 'double' to 'float'
2024-06-27 14:43:53 +09:00
Hermet Park
1f41c9c80d sw_engine: ++thread safety
Synchronize the engine process precisely
before updating internal data.
2024-06-27 14:25:18 +09:00
Hermet Park
7556253c53 example: do not scan a given resource folder recursively 2024-06-27 14:12:28 +09:00
Mira Grudzinska
c36bc1a7a3 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 13:54:32 +09:00
Hermet Park
d1067ad080 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 12:54:53 +09:00
Hermet Park
23688dfb78 example: do not redraw for the static content 2024-06-27 12:54:53 +09:00
Hermet Park
f80814847d example: ++exception handling 2024-06-27 11:33:56 +09:00
Mira Grudzinska
adbf1d3cab 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 10:34:15 +09:00
Mira Grudzinska
9cfc65fbc7 examples: fix sdl2 headers in Capi example 2024-06-27 10:33:53 +09:00
Hermet Park
4dfd591a7b docs: updated to v0.14 2024-06-27 01:16:29 +09:00
Hermet Park
87cd9e4795 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 01:09:10 +09:00
Hermet Park
b2def251ca 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 00:51:11 +09:00
Sergii Liebodkin
f837ecf164 examples: fix sdl2 headers includes path
Fix SDL2 headers include path to release IDE warnings.
Tested on linux and macos
2024-06-26 15:38:49 +02:00
Mira Grudzinska
f26bdeba8d tests: ++coverage 2024-06-26 22:06:19 +09:00
Hermet Park
1ad00f987c apis: promotes to official apis.
C++
- GlCanvas::gen()

CAPI
- TVG_COMPOSITE_METHOD_INVERSE_LUMA_MASK
2024-06-26 15:16:26 +09:00
Sergii Liebodkin
83e834e16f 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-26 14:16:48 +09:00
Mira Grudzinska
a56fc81733 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-26 14:15:50 +09:00
Hermet Park
4c57a64a82 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-26 01:46:10 +02:00
Sergii Liebodkin
7145c66b00 wg_engine: fix stroke mitter limit
Change the appliense of stroke mitter limit as in SVG spec

Before/After
2024-06-25 21:53:42 +09:00