Commit graph

16 commits

Author SHA1 Message Date
Hermet Park
ecabdc5ebc renderer: code refactoring
Replaced the transformation with
a strong associated data field.

This helps to reduce the binary size (-1k).
2024-09-30 15:39:52 +09:00
Hermet Park
157e873e83 common: code refactoring
Trimming the transform data pass,
from RenderTransform to Matrix.

No logical changes.
2024-09-30 15:39:46 +09:00
Hermet Park
4345d6b8a5 API: revise the APIs.
deprecate the `identifier()` APIs by replacing them with `type()`.

ThorVG is going to introduce an instance `id()`,
and this could be confused with the `identifier()` methods.

with this new type() method can reduce the memory size
by removing unncessary type data.

New Experimental C APIs:
- enum Tvg_Type
- Tvg_Result tvg_paint_get_type(const Tvg_Paint* paint, Tvg_Type* type)
- Tvg_Result tvg_gradient_get_type(const Tvg_Gradient* grad, Tvg_Type* type)

New Experimental C++ APIs:
- Type Paint::type() const
- Type Fill::type() const
- Type LinearGradient::type() const
- Type RadialGradient::type() const
- Type Shape::type() const
- Type Scene::type() const
- Type Picture::type() const
- Type Text::type() const

Deprecated C APIs:
- enum Tvg_Identifier
- Tvg_Result tvg_paint_get_identifier(const Tvg_Paint* paint, Tvg_Identifier* identifier)
- Tvg_Result tvg_gradient_get_identifier(const Tvg_Gradient* grad, Tvg_Identifier* identifier)

Deprecated C++ APIs:
- enum class Type
- uint32_t Paint::identifier() const
- uint32_t Fill::identifier() const
- static uint32_t Picture::identifier()
- static uint32_t Scene::identifier()
- static uint32_t Shape::identifier()
- static uint32_t LinearGradient:identifier()
- static uint32_T RadialGradient::identfier()

Removed Experimental APIs:
- static uint32_t Text::identifier()

issue: https://github.com/thorvg/thorvg/issues/1372
2024-09-30 12:55:16 +09:00
Hermet Park
a71fd6652a lottie: fixed a missing slot overriding update.
the Lottie scene should be updated when the slot overriding
is updated. Previously, it only depended on the frame update.

issue: https://github.com/thorvg/thorvg/issues/2303
2024-06-24 14:30:46 +09:00
Hermet Park
636890e20b renderer: code refactoring.
replaced references with pointers to ensure consistency.
no logical changes.
2024-04-05 17:42:42 +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
Jinny You
92288c8291 updated copyright date (#1866) 2024-01-02 20:34:12 +09:00
Hermet Park
49d26691e5 common: Revise internal loader interfaces.
We are introducing the FontLoader, which slightly differs
from the ImageLoader in terms of features. To adequately
support both, we have separated the loader functionalities
into FontLoader and ImageLoader. This allows us to optimally
adapt the LoadModule for each case.
2024-01-02 20:34:11 +09:00
Hermet Park
f173b45e04 renderer/picture: fixed a regression
reverted a wrong change from the previous code refactoring
in 5643348472
2024-01-02 20:34:11 +09:00
Hermet Park
74a7c45214 common: clean up the code. 2024-01-02 20:34:11 +09:00
Hermet Park
c0a1f82033 renderer/loader: optimization++
removed the internal unique_ptr usage to reduce the binary size(-553)
2024-01-02 20:34:10 +09:00
Hermet Park
f64ee28079 Loaders: Introduced a loader cache.
The loader cache is applied to conserve memory.

If the input data is already present in loaders,
the loader cache will promptly return the active loader.

This results in a lot of memory savings for the duplicated resources.

binary diff: -400 bytes
2024-01-02 20:34:10 +09:00
Hermet Park
1fbdf7bbb6 renderer, loader: minor code refactoring.
- sync with its file name
- remove unnecessary section comments
- compact binary size (-300)
- private Task::run() methods from the loaders
2024-01-02 20:34:10 +09:00
Hermet Park
c18643f9b6 renderer: revise the internal paints structure.
Get rid of the polymorphism function table,
use the switch directly instead.

We profiled, both binary & performance is better than before.

Tested on a local machine (single thread):
- Lottie: 2ms improved
- Binary: -0.5kb
2023-12-26 18:01:57 +09:00
Hermet Park
e0d1c947e6 infra: renamed the files for the consistency. 2023-09-04 17:26:43 +09:00
Hermet Park
24711e485c infra: renames the source folders
lib -> renderer
bin -> tools
utils -> common
2023-08-28 13:11:24 +09:00
Renamed from src/lib/tvgPicture.cpp (Browse further)