Commit graph

2631 commits

Author SHA1 Message Date
Hermet Park
9e55eefe13 common: code refactoring
refactor common code to consolidate Bezier and line
function implementations into a single location.
2024-02-20 17:19:15 +09:00
Hermet Park
31b4428dd8 Revert "Revert "sw_engine: Increasing accuracy for dashed curves""
This reverts commit e49f9125b2.
2024-02-20 12:33:00 +09:00
Hermet Park
e49f9125b2 Revert "sw_engine: Increasing accuracy for dashed curves"
This reverts commit a8c0030d80.
2024-02-20 12:23:55 +09:00
Mira Grudzinska
a8c0030d80 sw_engine: Increasing accuracy for dashed curves
Dashed curves require greater precision in calculating
their lengths and while splitting Bezier curves.
Otherwise, it results in visual discrepancies compared
to the expected outcomes.
Approximate functions 'bezLengthApprox' and 'bezAtApprox'
used for calculations in the lottie loader.

issue: https://github.com/thorvg/thorvg/issues/1686
2024-02-20 12:11:43 +09:00
Mira Grudzinska
6377257f8c sw_engine: fixing stroke outline
In the case of non-uniform scaling for
thick strokes, artifacts were visible.
The calculations took into account the angle
resulting from the already transformed points,
whereas the untransformed points should have
been considered - the transformation is taken
into account in the next step.

@issue: https://github.com/thorvg/thorvg/issues/1915
2024-02-20 11:27:22 +09:00
Sergii Liebodkin
b150d71912 wg_engine: meson script fixed
[issues 1991: Basic steps to compile for linux (wg_beta, examples)](#1991)
2024-02-20 10:56:40 +09:00
JunsuChoi
8e899df130 examples/picture/svg: Adjust size ratio
Adjust the image size and position to fit the window size.
2024-02-19 23:54:06 +09:00
Hermet Park
fb19e2cabd lottie/parser: clean up the exception handling mechanisms.
Since the parser has become stable enough,
remove the exceptions and instead rely on parser error handling.
2024-02-19 21:26:58 +09:00
Hermet Park
043b6b9f4f common/array: code refactoring
Make the array interface pair begin()/end() for consistency.
2024-02-19 19:09:30 +09:00
Hermet Park
6d98e16cae
Update CODEOWNERS 2024-02-19 11:46:55 +09:00
Hermet Park
91c776affa loader/webp: do not expose webp apis.
this reduces the bin size around -1.5kb
2024-02-15 16:35:42 +09:00
Sergii Liebodkin
21b1ef6f5f wg_engine: animation optimizations (part 1)
[issues 1479: update](#1479)

gpu vertex buffer reallocations optimization
2024-02-15 12:03:27 +09:00
Hermet Park
11ddfdb193 lottie: remove the duplicated binary search logic. 2024-02-15 10:29:31 +09:00
JunsuChoi
53e2ecd81c loader/svg: Fix empty id to null
empty id is invalid. Therefore, set it to null and make it is not used.

issue: https://github.com/thorvg/thorvg/issues/1977
2024-02-15 10:29:13 +09:00
Jinny You
d8891187cd web: code refactoring
improved code consistency:
- removed double-quotes on string literal.
- removed double-equals (==)
- updated comments
2024-02-09 14:12:06 +09:00
Martin Capitanio
a9b6907e41 Portability: Fix compiler shadowing warning 2024-02-08 09:16:50 +09:00
Hermet Park
5fb0012ff4 webp: removed non-existing symbol methods. 2024-02-07 20:32:05 +09:00
Hermet Park
5fe9b432ec loaders: enhance decoding efficiency
enhance decoding efficiency by determining the desired canvas format
during image loading. This allows loaders to preemptively decode
the image in the specified format, to not convert the format again.
2024-02-07 20:32:05 +09:00
Hermet Park
8a4862bc37 loaders: decode the image with premultiplied alpha.
basically, the renderer requires images with premultiplied alpha.
2024-02-07 20:32:05 +09:00
Hermet Park
f0c69f5bbb Revert "lottie: compatibility++"
This reverts commit c89f6253bf.

No more valid by 3f235d9e3f
2024-02-07 20:22:05 +09:00
Hermet Park
20fcb5b1c2 renderer/loader: enhance picture format compatibility
Attempt to load a given file/data using candidate formats
when the desired loader fails. This approach will enhance
the compatibility with various file formats in unexpected scenarios.

Previously, we had removed this feature, but have since
recognized its necessity due to the impact on file data
in specific corner cases.
2024-02-07 20:22:05 +09:00
Hermet Park
42a5366735 renderer/canvas: fix a regression error.
just figured out & fixed a side effect by this change:
9e69089524
2024-02-07 19:22:32 +09:00
Hermet Park
9db82db7d7 infra: remove codeql.
Currently, CodeQL is not functioning, but we have applied another tool:
https://www.codefactor.io/repository/github/hermet/thorvg
2024-02-07 16:28:20 +09:00
RuiwenTang
be278dfc67 gl_engine: add stencil and cover render task
* 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
2024-02-07 15:13:40 +09:00
Hermet Park
6c8ab8fe49 Update CODEOWNERS 2024-02-07 12:44:48 +09:00
Hermet Park
9fd5385689 Update CONTRIBUTING.md 2024-02-07 12:44:37 +09:00
Junsu Choi
df4f93e79f loader/webp: Support static webp loader
Built to libwebp code in to support the static option of webp loader.
Code from :https://github.com/jacklicn/libwebp

This forking version only contains the minimal webp decoding feature.

Binary Size: +68kb

Co-authored-by: Hermet Park <hermet@lottiefiles.com>

issue: https://github.com/thorvg/thorvg/issues/1427
2024-02-07 10:58:25 +09:00
JunsuChoi
509181bf2a infra/window: Remove version fix of meson
Version 0.58 find missing libraries and causes an error.
(ex: libwebp 1.0).
There is no need to fix the current version, so always use the latest version.
2024-02-06 10:52:58 +09:00
Hermet Park
9e69089524 renderer/canvas: Optimize logic by removing paint verification.
Allow direct updates to the paint object without prior validation.
The verification process is deemed inefficient;
users are expected to ensure the paint is updated using a canvas
that contains it.

This might break the backward compatibility.
2024-02-06 01:30:19 +09:00
Hermet Park
f03a3a87ff sw_engine: Improve image up-scaler quality
Adjusted the sampling position basis by -0.5 pixel
to enhance edge line interpolation quality.

This change addresses an issue with the image up-scaling process,
resulting in clearer and more accurate visuals.

issue: https://github.com/thorvg/thorvg/issues/1949
2024-02-05 22:21:28 +09:00
Hermet Park
85c858cbda renderer: ensure canvas rendering continues despite invalid scene parts
Previously, the logic was set to halt rendering when any part of the paints,
particularly bitmap-based images, failed to render.

This update modifies the behavior to continue drawing the scene,
allowing for the successful rendering of other elements.

issue: https://github.com/thorvg/thorvg/issues/1951
2024-02-05 20:58:51 +09:00
RuiwenTang
3f9b0eff22 gl_engine: enhance the tessellation algorithm
* merge vertices that are close enough before tessellation
* append return branch in tessellation to prevent dead loop caused by floating point precision
2024-02-05 18:41:37 +09:00
Hermet Park
a3e2189afa doc: updated dependencies section. 2024-02-05 11:11:55 +09:00
JunsuChoi
2d0c10e27f examples/picture/svg: Add PictureSvg example
This is the simplest example using tvg::Picture's SVG loader.
2024-02-05 10:53:42 +09:00
Sergii Liebodkin
e1f6572bde wg_engine: clenup shader sources
Remove unused composition/blending shader sources
2024-02-05 10:46:01 +09:00
Hermet Park
f8b1564d61 renderer: ++todo 2024-02-04 17:53:25 +09:00
Hermet Park
0b0ff3fc0f infra: removed old tvg packs
TVG picture binaries were maintained for compatibility checks.
These are generally not used by ThorVG developers.

Migrated those binaries to another repository to streamline
the ThorVG main repository.
2024-02-04 11:40:49 +09:00
Hermet Park
865f87d15e infra: remove unused resources.
thorvg will revisit this later.
2024-02-04 11:40:49 +09:00
Hermet Park
9a6eff8ce2 examples: updated DirectUpdate sample
Properly guide a sample usage to guarantee the sync call.
2024-02-02 17:59:57 +09:00
Hermet Park
a65d3ae37a lottie/parser: shutdown a compiler warning.
corrected a data type.
2024-02-02 17:59:47 +09:00
Hermet Park
21252632b3 lottie: fixed a parsing error in assets
An unused key in assets parsing corrupted the sequence.
This change now ensures they are tightly ignored.
2024-02-02 11:42:26 +09:00
Hermet Park
a2defaf694 lottie: fix a simple mistake. 2024-02-02 11:42:26 +09:00
Hermet Park
a1c43a9518 renderer: code refactoring.
removed unnused return value.
2024-02-02 03:02:56 +09:00
Hermet Park
46b26a07b3 renderer: destroy engines safely.
Introduced a reference count to destroy it safely.
2024-02-02 03:02:56 +09:00
Hermet Park
14048cbe19 renderer: revise the internal logic.
dispose of the resources at the end of the paint deletion.
This will help retain the resources of the retained paints
and reuse them after reconstructing the next scene.
2024-02-02 03:02:56 +09:00
Hermet Park
22b8b014e2 renderer: code refactoring.
replaced references with pointers to ensure consistency.
no logical changes.
2024-02-02 03:02:56 +09:00
Hermet Park
f006551f52 lottie: minor optimization.
remove an unnecessary scene in the lottie render tree.
2024-02-02 01:29:16 +09:00
Hermet Park
c89f6253bf lottie: compatibility++
retry image loading with the given candidates,
even if the suggested format is mismatched.
2024-02-01 12:14:42 +09:00
Sergii Liebodkin
6b6947f679 wg_engine: introduced blending
[issues 1479: blending](#1479)

Supported blend settings:

    Normal
    Add
    Screen
    Multiply
    Overlay
    Difference
    Exclusion
    SrcOver
    Darken
    Lighten
    ColorDodge
    ColorBurn
    HardLight
    SoftLight
2024-01-30 11:49:20 +09:00
Hermet Park
fb4ad7d239 lottie: corrected text height alignment issues.
enhanced support for a wider range of text use cases.
2024-01-30 10:34:12 +09:00