Commit graph

1677 commits

Author SHA1 Message Date
Hermet Park
be8cfd5f3f common picture: --code inlining.
dec: 273029 -> 272789
2023-08-08 10:47:43 +09:00
Hermet Park
c0cb8c0ce8 apis: remove a beta api.
- const uint32_t* Picture::data(uint32_t* w, uint32_t* h) const

Returning pixel data is not guaranteed as the picture may contain vector resources.
Remove it unless it's absolutely necessary.

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-08-08 10:47:37 +09:00
Hermet Park
9af89f9f18 common: deleted paints only when they are no longer valid.
Pictures can be shared with Animation instances.
The condition can now be distinguished by checking the `dispose()` return value.
2023-08-07 14:03:42 +09:00
Hermet Park
c97c60b900 binding wasm: fix a memory leak.
clear the buffer memory properly when a canvas size is changed.
2023-08-07 13:22:13 +09:00
Hermet Park
da1b036e4f loader lottie: -- beta tag.
Now, it's quite workable. Include it in our default integration test suite.
2023-08-07 10:56:35 +09:00
Hermet Park
4c5f858aa1 utils: code clean up
removed unnecessary declares.
2023-08-07 01:34:41 +09:00
Hermet Park
0f18e9026b utils str: remove unnecessary definitions.
the compiler would remove the code if nowhere uses the internal functions.
2023-08-05 12:06:34 +09:00
Mira Grudzinska
f0d8ab4274 utils: math functions moved from lib to utils 2023-08-05 11:49:36 +09:00
Mira Grudzinska
6ad4a0b180 lottie_loader: custom strtof and strndup used
The custom version of 'strtof' must be used
because its result is dependent on the current
locale, which is't set in the project.
2023-08-05 11:49:36 +09:00
Mira Grudzinska
480917651a utils: custom strtof and strndup moved into utils
The custom implementations of 'strtof' and 'strndup'
present in the svg loader have been moved into a new
'utils' directory (strToFloat and strDuplicate, respectively).
2023-08-05 11:49:36 +09:00
Mira Grudzinska
07c05b52dc svg_loader: removed unused code
The custom strtof function is defined
in tvgSvgUtil.
2023-08-05 11:49:36 +09:00
Hermet Park
052cfea4b1 binding wasm: tag it as beta version.
wasm interfaces are fragile now.
we dont'guarantee compatibility yet.
2023-08-04 15:09:28 +09:00
Hermet Park
496ec72f2a binding wasm: support the animation. 2023-08-04 15:09:28 +09:00
Hermet Park
cee59dcd0e binding wasm: revise the code.
rewrite the code following the thorvg convention.
2023-08-04 15:09:28 +09:00
Hermet Park
6ab32cae0b infra wasm: migrate wasm into bindings. 2023-08-04 15:09:28 +09:00
Hermet Park
3fe6c7126a infra build: revise the binding builds.
The thorvg lib should not have a dependency on the bindings.
In fact, it's inverted.
2023-08-03 10:52:40 +09:00
Hermet Park
1ed48ccbdb example stress: revise the sample.
use canvas::paints() instead of a local list.
2023-08-02 18:03:53 +09:00
Hermet Park
0e97d21752 common canvas: Alter the concept of the Canvas::clear() API.
We've changed the behavior of Canvas::clear(false).

The canvas::clear(false) now retains the paints, allowing the user to update the next frame
more easily without having to recompose the paint list.

Previously, clear(false) removed the paint list from the canvas,
requiring the user to re-push all of them in the next frame.

Now, we offer the Canvas::paints() API, allowing users to modify the paint list directly instead.

This change will break compatibility with previous versions of Canvas.

Therefore, this update is included in ThorVG 1.0.

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-08-02 17:23:53 +09:00
Mira Grudzinska
dfb1a7e571 webp_loader: libwebp set to be a required depend
While building on windows (MinGW) no 'libwebp' was found,
which resulted in build errors. The building process should
have been stopp	ed earlier for clarity.
2023-08-02 12:20:11 +09:00
Mira Grudzinska
afee0441f6 svg_loader: removed unnecessary header 2023-08-01 14:53:36 +02:00
Mira Grudzinska
4786ffc315 lottie_loader: fixing error with math consts
The math.h was included before the _USE_MATH_DEFINES
was defined (in tvgMath.h) causing an error while
MinGw was used.
Since non of these header is needed directly, the header
is removed.
2023-08-01 14:53:36 +02:00
Hermet Park
5325ebcba5 infra wasm: up-to-date wasm build 2023-07-29 16:50:27 +09:00
Hermet Park
816f179c74 loader lottie: fix the last memory leak. 2023-07-29 16:16:37 +09:00
Hermet Park
921bd94b6f sw_engine renderer: fix a memory leak.
disposed of task memory properly, detected by Memory Sanitizer.
2023-07-29 16:16:37 +09:00
Hermet Park
2b77522d5f sw_engine c: fix compile warnings on windows.
[31/75] Compiling C++ object src/thorvg-0.dll.p/lib_sw_engine_tvgSwRaster.cpp.obj
D:\Projects\thorvg\src\lib\sw_engine\tvgSwRasterC.h(29): warning C4311: 'type cast': pointer truncation from 'PIXEL_T *' to 'long'
        with
        [
            PIXEL_T=uint8_t
        ]
../src/lib/sw_engine/tvgSwRaster.cpp(1900): note: see reference to function template instantiation 'void cRasterPixels<uint8_t>(PIXEL_T *,PIXEL_T,uint32_t,int32_t)' being compiled
        with
        [
            PIXEL_T=uint8_t
        ]
D:\Projects\thorvg\src\lib\sw_engine\tvgSwRasterC.h(29): warning C4302: 'type cast': truncation from 'PIXEL_T *' to 'long'
        with
        [
            PIXEL_T=uint8_t
        ]
D:\Projects\thorvg\src\lib\sw_engine\tvgSwRasterC.h(29): warning C4311: 'type cast': pointer truncation from 'PIXEL_T *' to 'long'
        with
        [
            PIXEL_T=uint32_t
        ]
../src/lib/sw_engine/tvgSwRaster.cpp(1911): note: see reference to function template instantiation 'void cRasterPixels<uint32_t>(PIXEL_T *,PIXEL_T,uint32_t,int32_t)' being compiled
        with
        [
            PIXEL_T=uint32_t
        ]
D:\Projects\thorvg\src\lib\sw_engine\tvgSwRasterC.h(29): warning C4302: 'type cast': truncation from 'PIXEL_T *' to 'long'
        with
        [
            PIXEL_T=uint32_t
        ]
2023-07-29 14:24:53 +09:00
Hermet Park
d96f906ef3 release: up to update tvg resources.
Compatibility test has been successfully passed.
2023-07-29 14:24:37 +09:00
Hermet Park
e0ed2c7ace loader lottie: ++safety.
It shouldn't corrupt, even if it doesn't support certain features.
2023-07-29 10:29:03 +09:00
Hermet Park
24c0b5ecf5 sw_raster c: fix the misaligned memory access.
An issue occurred in the 64-bit accelerated raster version,
involving 8 bytes of misaligned memory access.

This was detected by the memory sanitizer and has now been fixed.
2023-07-29 10:29:03 +09:00
Hermet Park
f551531bb5 examples blending: fix a memory leak. 2023-07-29 10:29:03 +09:00
Hermet Park
65189ab8e8 sw_engine texmap: fixed a memory violation.
A reported out-of-range memory access issue,
as identified by the sanitizer, has been corrected.
2023-07-29 10:29:03 +09:00
Hermet Park
229efd7807 loader lottie: fixed the memory leaks.
All memory leaks detected by the sanitizer have been fixed.
2023-07-29 10:29:03 +09:00
Hermet Park
3e8225a5ba common math: promote matrix functions.
comparing matrices is a common mathmatical operation.
2023-07-28 21:57:40 +09:00
Hermet Park
a74062d5f1 loader tvg: add missing strokeFirst property.
tvg binary missed the stroke order,
this patch implements the missing condition.

@Issue: https://github.com/thorvg/thorvg/issues/1499
2023-07-28 21:57:40 +09:00
Hermet Park
1b7c882be4 sw_engine raster: fixed a wrong composition instruction.
it's a regression bug.

@Issue: https://github.com/thorvg/thorvg/issues/1540
2023-07-28 18:35:51 +09:00
Hermet Park
68b8fce501 loader lottie: ++optimization.
Aggressive parallelization is implemented to perform updates
on every frame in an asynchronous manner.
2023-07-28 16:54:44 +09:00
Hermet Park
023b38ad3c loader lottie: fix a missing initialization.
this breaks 0 frame lottie rendering, now it's fixed.
2023-07-28 16:54:44 +09:00
Mira Grudzinska
4f9f125454 svg_loader: update style in defs
In the defs node the style was not updated, hence
the inheritance wasn't applied causing wrong results.
2023-07-28 12:11:24 +09:00
Hermet Park
5c45e64b93 examples: use tvg::cast(). 2023-07-27 17:53:12 +09:00
Mira Grudzinska
b0e41b2b9f svg_loader: support the '!important' directive
The directive is used to give a specific style property
higher priority, ensuring that it overrides other style
declarations for the same property.

@Issue: https://github.com/thorvg/thorvg/issues/1255
2023-07-27 11:51:45 +09:00
Hermet Park
f4717fb4c3 sw_engine: --redundant comment. 2023-07-27 00:56:22 +09:00
Hermet Park
f93fbc9e59 sw_engine: enforce the drawing of small stroke cubic outlines.
At the construction stage, some stroke points can be skipped
if the distance between the points is too narrow.

Previously, this was assumed to be an error case,
but it's clearly intended to remove unnecessary points introduced in a small area of drawing.

This sometimes leads to a flickering issue when super small-sized vector images are drawn.

Now, it's fixed.
2023-07-27 00:40:37 +09:00
Hermet Park
739bb63f92 examples animation: adds a basic example. 2023-07-27 00:31:27 +09:00
Hermet Park
3311c8d82b examples: do not create contents that is over-counted. 2023-07-27 00:31:27 +09:00
Hermet Park
ca7a9068bd examples lottie: adds a basic example 2023-07-27 00:31:27 +09:00
Hermet Park
193a9833a8 lottie loader: implement the necessary interaces. 2023-07-27 00:31:27 +09:00
Hermet Park
73a8792eae loader lottie: add lottie builder. 2023-07-27 00:31:27 +09:00
Hermet Park
03f878bb2e loader lottie: adds the lottie property, model and parser. 2023-07-27 00:31:27 +09:00
Hermet Park
b060959e0d loader lottie: add a lottie specific interpolator. 2023-07-27 00:31:27 +09:00
Hermet Park
e7a94f5314 common Animation: introduce the Animation class.
This class serves as the base for Animation.
The main purpose of its APIs is to control the animation frames.

Its example will be provided in the upcoming commits.

@APIs:
Result Animation::frame(uint32_t no) noexcept;
Picture* Animation::picture() const noexcept;
uint32_t Animation::curFrame() const noexcept;
uint32_t Animation::totalFrame() const noexcept;
float Animation::duration() const noexcept;
static std::unique_ptr<Animation> Animation::gen() noexcept;

@Issue: https://github.com/thorvg/thorvg/pull/1450
2023-07-27 00:31:27 +09:00
Hermet Park
7e7a561d9f common loader: enable lottie loader
json/lottie extensions are recognized as Lottie file format.
2023-07-27 00:31:27 +09:00