Commit graph

83 commits

Author SHA1 Message Date
Hermet Park
0efbc3cce9 infra: --meson deprecated usages
meson.source_root -> meson.project_source_root()
meson.build_root -> meson.project_build_root()
2024-12-19 16:18:49 +01:00
Hermet Park
ba8a764ec3 example: ++gl, wgpu safety
Free the canvas in the reverse order of their creation.
2024-11-27 19:17:20 +09:00
Hermet Park
f42559e613 lottie/slot: revise gradient fill support
Revise gradient fill data parsing by adding support
for the color stop count (p) parameter in slot data.

issue: https://github.com/thorvg/thorvg/issues/2795
2024-11-08 12:46:03 +09:00
Hermet Park
0df35447b3 wg_engine: fixed resource leaks
issue: https://github.com/thorvg/thorvg/issues/2808
2024-10-04 00:34:16 +09:00
Mira Grudzinska
42c4190112 examples: fix mingw build error
M_PI was not declared error solved
2024-10-03 16:39:42 +09:00
Hermet Park
ee19380d50 tvg: updated binary with v0.15 tagging 2024-10-01 12:58:13 +09:00
Hermet Park
ff2cacd25d examples: fixed an incorrect buffer size.
adjusted the size according to the offsets.
2024-09-30 17:00:40 +09:00
Hermet Park
ece0d8c7e1 examples: added SceneEffect
added a showcase with a gaussian blur effect
2024-09-30 16:44:22 +09:00
RuiwenTang
cd4fecf84e example: MultiCanvas show case with GL backend
Change the MultiCanvas code to show how to render the content of
GlCanvas to a given off-screen framebuffer.

issue: https://github.com/thorvg/thorvg/issues/2746
2024-09-30 16:44:22 +09:00
Hermet Park
d3edc0c5f7 api: clean up
promoted offical c++ apis (v0.15)
 - enum class BlendMethod
 - enum class CanvasEngine::Wg
 - virtual Result Canvas::viewport(int32_t x, int32_t y, int32_t w, int32_t h);
 - class Text
 - Result Text::fill(uint8_t r, uint8_t g, uint8_t b)
 - Result Text::fill(std::unique_ptr<Fill> f)
 - static Result Text::unload(const std::string& path)
 - static Result Text::load(const std::string& path)
 - static Result Text::load(const char* name, const char* data, uint32_t size, const std::string& mimeType = "ttf", bool copy = false)
 - static std::unique_ptr<Text> Text::gen()
 - class WgCanvas
 - static std::unique_ptr<WgCanvas> WgCanvas::gen()
 - static const char* Initializer::version(uint32_t* major, uint32_t* minor, uint32_t* micro)
 - class LottieAnimation

promoted official c apis (v0.15)
 - Tvg_Blend_Method
 - Tvg_Result tvg_engine_version(uint32_t* major, uint32_t* minor, uint32_t* micro, const char** version)
 - Tvg_Result tvg_canvas_set_viewport(Tvg_Canvas* canvas, int32_t x, int32_t y, int32_t w, int32_t h)
 - Tvg_Result tvg_paint_set_blend_method(Tvg_Paint* paint, Tvg_Blend_Method method)
 - Tvg_Paint* tvg_text_new(void)
 - Tvg_Result tvg_text_set_fill_color(Tvg_Paint* paint, uint8_t r, uint8_t g, uint8_t b)
 - Tvg_Result tvg_text_set_gradient(Tvg_Paint* paint, Tvg_Gradient* gradient)
 - Tvg_Result tvg_font_load(const char* path)
 - Tvg_Result tvg_font_load_data(const char* name, const char* data, uint32_t size, const char *mimetype, bool copy)
 - Tvg_Result tvg_font_unload(const char* path)
 - Tvg_Animation* tvg_lottie_animation_new(void)

removed experimental apis
 - BlendMethod paint::blend() const
 - bool Shape::strokeTrim(float* begin, float* end) const
 - Tvg_Result tvg_paint_get_blend_method(const Tvg_Paint* paint, Tvg_Blend_Method* method)
 - Tvg_Result tvg_shape_get_stroke_trim(Tvg_Paint* paint, float* begin, float* end, bool* simultaneous)
 - tvg_text_set_linear_gradient(Paint* paint, Tvg_Gradient* gradient)
 - tvg_text_set_radial_gradient(Paint* paint, Tvg_Gradient* gradient)

issue: https://github.com/thorvg/thorvg/issues/1372
2024-09-30 16:44:22 +09:00
Hermet Park
79e5a0f3eb examples: updated a lottie sample 2024-09-30 16:44:22 +09:00
Hermet Park
8f8af68955 examples: replaced ClipPath with clip() 2024-09-30 16:44:22 +09:00
Hermet Park
915acd2ec3 lottie/expressions: ++coverage
Allow direct key[0]/key[1] access for key.value in expression

issue: https://github.com/thorvg/thorvg/issues/2722
2024-09-30 16:44:22 +09:00
Hermet Park
0d028678dc Revert "examples: updated samples"
This reverts commit 1e72e8f3a3.
2024-09-30 16:44:22 +09:00
Hermet Park
7f6eace8e3 examples: updated samples 2024-09-30 16:44:22 +09:00
Hermet Park
6a4a4bba98 examples: updated lottie resources 2024-09-30 16:44:22 +09:00
Hermet Park
371139e220 renderer: blending refactoring++
- reordered the blending types to align with lottie spec.
- removed source over.
2024-09-30 16:44:22 +09:00
Sergii Liebodkin
785a75a1ca wg_engine: external device handles (web integration)
move instance, adapter and device creation from renderer to application
its necessary for web integration, because browser have its own mechanics to create hardware handles
this changes makes webgpu canvas more universal to use in case of system and web applications

issue: https://github.com/thorvg/thorvg/issues/2410
2024-09-30 16:44:22 +09:00
Hermet Park
ca7f837e5c examples: ++svg samples 2024-09-30 16:44:22 +09:00
Hermet Park
62416132ca examples: added image rotation 2024-09-30 16:44:21 +09:00
Mira Grudzinska
e0203a2fa2 examples: capi example ++
Animation is loaded from a memory instead from a file.
2024-09-30 16:44:21 +09:00
Hermet Park
0f17f6c69a common: spec out TexMap
Spec out this incomplete experimental feature,
this is a still promising one, we will reintroduce
this officially after 1.0 release

size: -2kb

issue: https://github.com/thorvg/thorvg/issues/1372
2024-09-30 16:44:21 +09:00
Elliott Sales de Andrade
ee19753f36 build: Remove redundant comparisons
If a Meson option is typed as `boolean`, the `get_option` returns a
boolean, and comparing it with `true` is redundant. Meson also errors if
you try to compare across types, so it couldn't _not_ be a boolean.

Also, Meson is not C, so no need for parentheses around `if` conditions.
2024-09-30 16:44:21 +09:00
Mira Grudzinska
2a342a5463 API: deprecate the appendArc() api
@Issue: https://github.com/thorvg/thorvg/issues/2632
2024-09-30 16:44:21 +09:00
Hermet Park
a25366b283 common: spec out Scene Clipper
Scene Clipper is an unusual feature
that is too unstable and ambiguous in ThorVG.

Users can achieve the same functionality
with multiple composed shapes instead of scene clipping.

size: -2.5kb

issues:
- https://github.com/thorvg/thorvg/issues/1548
- https://github.com/thorvg/thorvg/issues/1549
- https://github.com/thorvg/thorvg/issues/1573
2024-09-30 16:44:21 +09:00
Hermet Park
05d4d05f59 examples/text: hotfix
corrected wrong arguments.
2024-09-30 16:44:21 +09:00
Hermet Park
8de23876d5 examples: added Interaction sample
The Interaction sample demonstrates
how to handle user input with ThorVG Animation.
2024-09-30 15:48:50 +09:00
Hermet Park
21d3cc4eb9 renderer/accessor: revise set() api for animation support
before:
unique_ptr<Picture> Accessor::set(unique_ptr<Picture> picture, function<bool(const Paint* paint)> func)

after:
Result Accessor::set(const Picture* picture, std::function<bool(const Paint* paint, void* data)> func, void* data)
2024-09-30 15:48:18 +09:00
Hermet Park
52a69b9a93 examples: added Lighten/Darken options in MaskingMethods 2024-09-30 15:48:18 +09:00
Hermet Park
90b40912d9 examples/lottie: updated a resource.
polished up for the animation smoothness.
2024-09-30 15:48:18 +09:00
Hermet Park
c9ad7289a6 lottie/expressions: feature enhancement
added groupIndex() support
added property (ix) value support
2024-09-30 15:48:18 +09:00
Hermet Park
859b3f6c39 example: merge Path & PathCopy 2024-09-30 15:37:15 +09:00
Hermet Park
64e8bfddfd renderer: quick skip rendering if the opacity is zero
This also resolves a corner case bug introduced by
lottie render pooling: f06127ab93
2024-09-30 15:37:06 +09:00
Hermet Park
d671f8637b lottie/expressions: ++coverage enhancement
Allow to access layer index globally.
2024-09-30 15:36:24 +09:00
Hermet Park
9749e7fea0 examples: updated lottie samples 2024-09-30 15:36:18 +09:00
Hermet Park
072ce383db examples: added more expressions samples 2024-09-30 15:36:11 +09:00
Hermet Park
0b66cd422e lottie/expressions: added a missing polystar property build. 2024-09-30 15:35:59 +09:00
Hermet Park
7e9febf2c6 examples: ++exception handling
Added handling for engine initialization failure.
2024-09-30 15:34:48 +09:00
Hermet Park
ec00238aed examples: added LottieExpressions 2024-09-30 15:31:55 +09:00
Hermet Park
3d9f7ebbc3 examples: updated lottie samples 2024-09-30 15:30:12 +09:00
Hermet Park
f49bf9e775 examples: added svg samples 2024-09-30 15:29:22 +09:00
Hermet Park
2a6a221b6c example: print non support webgpu msg properly. 2024-09-30 15:20:31 +09:00
Hermet Park
1d7bf0d9a2 example: ++ DirectUpdate to cover more scenarios. 2024-09-30 15:11:16 +09:00
Hermet Park
d8a8f1a01f example: improved to print proper fail msgs. 2024-09-30 13:00:12 +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
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
Josh Soref
e3c66db301 common: fix 178+ spelling errors 2024-09-30 12:41:38 +09:00
Hermet Park
6f0ae1cd3f example: do not scan a given resource folder recursively 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