Commit graph

2049 commits

Author SHA1 Message Date
Hermet Park
6a59e1b715 loader: avoid attempting forceful loading when the given MIME type is not correct.
Loading images when the MIME type is incorrect is unnecessary
and often results in failure, adding unnecessary processing overhead.

Pictures should have a clear MIME type assigned by users.
2023-08-11 15:00:09 +09:00
Hermet Park
374a125280 loader/lottie: enhance stability
Addressed corner cases to prevent memory violations.
2023-08-11 15:00:09 +09:00
Hermet Park
03976b02b3 infra/build: enable the lottie feature by default.
Lottie animation is a powerful feature in vector ux,
We can make this one of mandatory guidelines.
2023-08-11 15:00:09 +09:00
Hermet Park
1b020f70c4 loader lottie: support for stroke dash style
However, dash offset is still missing.
The TVG canvas needs to add the stroke offset feature.
2023-08-11 11:41:28 +09:00
RuiwenTang
9960cc4794 gl_engine: use vertex array buffer and index buffer when render primitive
VAO is new object in modern GL API, which can split and manage vertex
buffer and attribute state. This is optional in GLES and is mandatory in
GL.

Also index buffer is faster then pass cpu data in GL draw call.
2023-08-11 11:39:54 +09:00
RuiwenTang
7a35ff4d4b gl_engine: upgrade min gl version
most device supported morden gl which is:
GLES 3.0 for mobile GPU
GL 3.3 for desktop GPU
2023-08-09 23:23:57 +09:00
Hermet Park
345ef54e26 loader/lottie: add the rounded corner feature
The rounded rectangle property should be propagated to the root
through the lottie model scene-tree.
2023-08-09 21:30:25 +09:00
Hermet Park
8f4f3d6f1b loader/lottie: Add radial gradient support
This allows for the creation of basic radial gradients,
without support for focal points.
2023-08-09 21:30:25 +09:00
Hermet Park
d7c70c5371 loader/lottie: fix a missing layer timeremap.
The frame count should have been multiplied with the timeStretch property.
also newly implemented the TimeRemap(tm) property
2023-08-09 21:30:25 +09:00
Hermet Park
6f8504d3b9 loader/lottie: ++safety
- add an execeptional hanlding at parsing the assets.
- The precomp layer failed to prepare its instance in the parsing stage. This corrects the mistake.
2023-08-09 21:30:25 +09:00
RuiwenTang
9db9e003ba common: add new method to get mat4x4 directly from mat3x3
The 3x3 matrix already contains the geometric transformation
information required for 2D rendering.

We can directly convert from the 3x3 matrix to
the 4x4 matrix to facilitate subsequent GPU rendering.
2023-08-09 11:09:41 +09:00
RuiwenTang
0d4f45014a utils: add sort method in tvgArray
Add a new method in tvg::Array to support sort with custom comparer
2023-08-09 11:08:11 +09:00
Hermet Park
1e2051ded3
examples lottie: add an image test sample 2023-08-08 23:52:30 +09:00
Hermet Park
10cb09dbda examples/lottie: updated for wider coverage. 2023-08-08 23:47:58 +09:00
Hermet Park
f757eb6a71 loader/lottie: Support image property
This change makes it possible to use Lottie animations
that contain images from embedded/external resources.
2023-08-08 23:47:58 +09:00
Hermet Park
f31076a67e utils/str: Supplements functions.
Added strDirname(), which returns the directory path name from the given string.
Added str2int(), which converts from the string to the integer.

These functions are used to supplement the existing string manipulation functions in the utils/str module.
2023-08-08 23:47:58 +09:00
Hermet Park
cf1cb04752
Update README.md 2023-08-08 23:41:31 +09:00
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
42251ecbe7
Update CONTRIBUTING.md 2023-08-06 12:31:10 +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
3eca77b280 infra wasm: remove useless wasm test.
the test hasn't been maintained properly,
and we won't be maintaining it anymore.

please use thorvg.viewer intead. it's much more accurate.
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
1267a9d718 infra wasm: update the build script.
revise the compile options to optmize the binary size.
also remove all compile warnings.

size: 552616 -> 446847
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
Mira Grudzinska
5bb2eb06b4 docs: bounds api desc ++ 2023-08-01 14:53:12 +02:00
Mira Grudzinska
c5a02b90df tests: bounds test ++
The 'transformed' arg of the 'bounds' api
wasn't tested. Added.
2023-08-01 14:53:12 +02:00
Hermet Park
0aba8322c7
Update CONTRIBUTING.md 2023-08-01 10:32:48 +09:00
JunsuChoi
4498414dd5 common: Update image path(CONTRIBUTING.md)
https://github.com/thorvg/thorvg/issues/1554
2023-08-01 10:32:20 +09:00
Hermet Park
15c5bfacec infra github: updated the main branch name. 2023-08-01 02:08:36 +09:00
Hermet Park
2a85fbf76d
Update README.md
master to main
2023-08-01 01:55:26 +09:00
Hermet Park
dad34360de
Update README.md 2023-07-31 17:58:07 +09:00
Hermet Park
4346f63da3
Update README.md 2023-07-30 14:02:44 +09:00
Hermet Park
2e7a4ea8bb
Update README.md 2023-07-30 13:57:16 +09:00