Commit graph

14 commits

Author SHA1 Message Date
Hermet Park
889d1d1fa2 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-07-05 21:25:58 +09:00
Hermet Park
7b5de2fdb3 renderer: optimize the ClipPath fast-track.
this optimization applies when the clipper is
not an axis-aligned rectangle under the following conditions:

a. Coverage where the clipper is a regional superset of the viewport.
b. Coverage where the clipper is completely outside of the viewport.

issue: https://github.com/thorvg/thorvg/issues/2332
2024-06-10 11:18:53 +09:00
Hermet Park
fc754f3f6b renderer: code clean up 2024-06-10 11:18:53 +09:00
Hermet Park
a1818cf62b common: code refactoring
Replace the math functions with operator overloading.
This should potentially reduce the code size.
2024-05-27 10:48:46 +09:00
Hermet Park
06cc9709e6 renderer: Fix a crash issue related to the clipper
Fixed a crash that occurred when a given clipper had no data.
Properly handle this exceptional case to prevent the crash.

issue: https://github.com/thorvg/thorvg/issues/2083
2024-03-26 09:41:24 +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
Jinny You
2c6c8d3b21
updated copyright date (#1866) 2023-12-28 10:43:25 +09:00
Hermet Park
0f69eef8ed 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
2023-12-25 12:40:12 +09:00
Hermet Park
baee5ec767 renderer/paint: added a blend update flag.
Keep track of the update changes accurately.
We can utilize this value change in the backend engine.
2023-10-27 12:13:00 +09:00
Hermet Park
989b995189 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-10-27 11:24:44 +09:00
Hermet Park
21911fa1c8 apis: remove deprecated
- Result Picture::bounds(float* x, float* y, float* w, float* h) const
- Result Picture::load(const char* data, uint32_t size, bool copy = false)
- Result Canvas::reserve(uint32_t size)
- Result Scene::reserve(uint32_t size)

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-10-26 15:03:13 +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/tvgPaint.cpp (Browse further)