Commit graph

21 commits

Author SHA1 Message Date
Sergii Liebodkin
3805f26aff wg_engine: multicanvas support
Added multicanas support
Issue https://github.com/thorvg/thorvg/issues/2745
2024-11-22 12:34:26 +09:00
Hermet Park
96e8d3d7a2 api: revise the gl target() api.
API modification:
- Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h)
 -> Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h, ColorSpace cs)
- Tvg_Result tvg_glcanvas_set_target(Tvg_Canvas* canvas, int32_t id, uint32_t w, uint32_t h)
 -> Tvg_Result tvg_glcanvas_set_target(Tvg_Canvas* canvas, int32_t id, uint32_t w, uint32_t h, Tvg_Colorspace cs)

issue: https://github.com/thorvg/thorvg/issues/1372
2024-11-20 14:55:40 +09:00
Hermet Park
ed01ef717e api: revise the spec
Remove the requirement for unique_ptr in the function prototypes.
This change will simplify the API usage, making it more streamlined
and user-friendly. However, memory management will now be the
responsibility of the user.

C++ API Modification:
- Result Paint::mask(std::unique_ptr<Paint> target, MaskMethod method) -> Result Paint::mask(Paint* target, MaskMethod method)
- Result Paint::clip(std::unique_ptr<Paint> clipper) -> Result Paint::clip(Paint* clipper)
- virtual Result Canvas::push(std::unique_ptr<Paint> paint) -> virtual Result Canvas::push(Paint* paint)
- std::unique_ptr<LinearGradient> LinearGradient::gen() -> LinearGradient* LinearGradient::gen()
- std::unique_ptr<RadialGradient> RadialGradient::gen() -> RadialGradient* RadialGradient::gen()
- Result Shape::strokeFill(std::unique_ptr<Fill> f) -> Result Shape::strokeFill(Fill* f)
- Result Shape::fill(std::unique_ptr<Fill> f) -> Result Shape::fill(Fill* f)
- std::unique_ptr<Shape> Shape::gen() -> Shape* Shape::gen()
- std::unique_ptr<Picture> Picture::gen() -> Result Picture::push(Paint* paint)
- std::unique_ptr<Scene> Scene::gen() -> Scene* Scene::gen()
- Result Text::fill(std::unique_ptr<Fill> f) -> Result Text::fill(Fill* f)
- std::unique_ptr<Text> Text::gen() -> Text* Text::gen()
- std::unique_ptr<SwCanvas> SwCanvas::gen() -> SwCanvas* SwCanvas::gen()
- std::unique_ptr<GlCanvas> GlCanvas::gen() -> GlCanvas* GlCanvas::gen()
- std::unique_ptr<Animation> Animation::gen() -> Animation* Animation::gen()
- Result Saver::background(std::unique_ptr<Paint> paint) -> Result Saver::background(Paint* paint)
- Result Saver::save(std::unique_ptr<Paint> paint, const char* filename, uint32_t quality = 100) -> Result Saver::save(Paint* paint, const char* filename, uint32_t quality = 100)
- std::unique_ptr<Saver> Saver::gen() -> Saver* Saver::gen()
- std::unique_ptr<Accessor> Accessor::gen() -> Accessor* Accessor::gen()

C++ API removal:
- template<typename T = tvg::Paint> std::unique_ptr<T> cast(Paint* paint)
- template<typename T = tvg::Paint> std::unique_ptr<T> cast(Paint* paint)

issue: https://github.com/thorvg/thorvg/issues
2024-11-09 12:29:15 +09:00
Hermet Park
9bc900206b api: polish the thorvg API usages.
API Modification:
- SwCanvas::Colorspace -> ColorSpace

API Addition:
- ColorSpace::Unknown

issue: https://github.com/thorvg/thorvg/issues/1372
2024-10-12 15:38:03 +09:00
Hermet Park
a72ed0ddfa wg_engine: fixed resource leaks
issue: https://github.com/thorvg/thorvg/issues/2808
2024-10-04 14:20:51 +09:00
Sergii Liebodkin
e2e4fc6964
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-06 13:08:58 +09:00
Hermet Park
92303e91b4 examples: added Interaction sample
The Interaction sample demonstrates
how to handle user input with ThorVG Animation.
2024-08-07 12:02:22 +09:00
Hermet Park
350f7a4357 examples: ++exception handling
Added handling for engine initialization failure.
2024-07-14 12:04:31 +09:00
Hermet Park
b915455e89 examples: added LottieExpressions 2024-07-12 18:57:10 +09:00
Hermet Park
300ced90c1 example: improved to print proper fail msgs. 2024-07-08 11:39:28 +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
Hermet Park
7556253c53 example: do not scan a given resource folder recursively 2024-06-27 14:12:28 +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
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
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
Hermet Park
21f82c08db examples: --unnecessary initial buffer clear 2024-06-24 21:42:39 +09:00
Hermet Park
af1f3cb59d gl_engine: revise the gl portability
- guarantee minimum gl version requirement
- removed glesv2 dependency
- corrected gl ver dependency

issue: https://github.com/thorvg/thorvg/issues/2282
2024-06-24 11:08:28 +09:00
RuiwenTang
b71d9d563a gl_engine: Fix compile error if only has OpenGL library on MacOS
Since GLES headers and library can not be found on MacOS,
use macros to determin if link with OpenGL library.
2024-06-23 19:34:31 +09:00
JunsuChoi
f80e7a2b13 examples: Support window resizable
Add SDL_WINDOW_RESIZABLE to the sdl window property
and call canvas->update() in the resize event.

Afterwards, if the canvas needs to be expanded by the window size by passing the size as an argument
to the update(canvas,elapsed) interface, it can be processed individually.
2024-06-21 17:48:19 +09:00
Hermet Park
1dcd2c4b5f examples: replace the efl toolkit with sdl
see also: https://www.libsdl.org/

issue: https://github.com/thorvg/thorvg/issues/1244
2024-06-20 17:49:18 +09:00