Commit graph

2408 commits

Author SHA1 Message Date
Hermet Park
24711e485c infra: renames the source folders
lib -> renderer
bin -> tools
utils -> common
2023-08-28 13:11:24 +09:00
Hermet Park
07069f6640 loader/lottie: introduce chaining maskings more effectively. 2023-08-28 11:55:17 +09:00
Hermet Park
21413b1872 sw_engine: optimizing the masking feature
replaced 32-bit operations with 8-bit operations for masking buffers.

We might need a grasycale image support for applying 1-byte channel masking input(Picture).
Some of masking implementation are disabled by this reason.

Also, I don't expecct it's necessary for the thorvg now.
2023-08-28 11:55:10 +09:00
Hermet Park
624b275628 sw_engine: improve the masking methods
Corrected subtract/intersect masking behaviors that were inaccurately functioning
within chain-masking.

This also helps to enhance the masking performance by reducing the
masking region when applying subtract/intersect.

@Issue: https://github.com/thorvg/thorvg/issues/1606
2023-08-28 11:55:01 +09:00
RuiwenTang
7eeba75472 gl_engine: Use advance tessellate algorithm
Introducing a new tessellate algorithm to break polygon into triangles.
2023-08-28 11:36:43 +09:00
Hermet Park
7b40c741ac loader/lottie: correct a polystar transform.
Properly propagate the transform information to the merged shapes.
This corrects the incorrect transformation applied to the subsequent shapes.
2023-08-24 10:57:38 +09:00
Hermet Park
3d5c5ef0fa loader/lottie: support the stroke offset property 2023-08-24 10:56:07 +09:00
Hermet Park
7d797ee548 Yet we don't break apis, this patch reverts the next:
cb36c25aff
8c0fc2b25a
c1e4e0808a

Those reverted changes sholud be in the bucket, the next issue item:

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-08-24 01:00:57 +09:00
Hermet Park
f2e755cdd5 sw_engine: fix dash offset bug.
The latest offset feature has a missing starting point of the cubic bezier.
This fix addresses the issue.
2023-08-24 00:57:26 +09:00
Hermet Park
68f4193378 loader/lottie: support the polystar property. 2023-08-23 13:12:26 +09:00
Hermet Park
001c1c06fc sw_engine: --compiler warning
../src/lib/sw_engine/tvgSwShape.cpp:232:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
  232 |         for (auto i = 0; i < dash.cnt; ++i) patternLength += pattern[i];
      |                          ~~^~~~~~~~~~
../src/lib/sw_engine/tvgSwShape.cpp:239:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
  239 |         for (auto i = 0; i < dash.cnt * (1 + isOdd); ++i, ++offIdx) {
2023-08-23 12:47:10 +09:00
Mira Grudzinska
cb36c25aff test: dashed stroke with offset added 2023-08-23 12:40:27 +09:00
Mira Grudzinska
8c0fc2b25a capi: dashed stroke setter and getter modyfied
tvg_shape_set_stroke_dash() and tvg_shape_get_stroke_dash()
require an extra argument: offset
2023-08-23 12:40:27 +09:00
Mira Grudzinska
478e45f9f3 common: stroke dash offset support added
The feature is supported also in the svg loader.

@Issue: https://github.com/thorvg/thorvg/issues/1591
2023-08-23 12:40:27 +09:00
Mira Grudzinska
c1e4e0808a Revert "api: enhance Shape::stroke() method usage."
This reverts commit 6cbc1de570.
Setting def value for 'a' makes it impossible to overload
the 'stroke' api with 3 values (needed for introducing dash offset).
2023-08-23 12:40:27 +09:00
Hermet Park
899ea77695 exmamples lottie: add a time measurement. 2023-08-22 21:25:59 +09:00
Hermet Park
4127f4ce7a loader/lottie: revised the key-frame searching
Replace the linear search algorithm with binary-search.

The performance enhancement may not yield significant benefits in normal cases.
However, it becomes crucial if the animation comprises an extensive number of frames...
2023-08-22 21:25:51 +09:00
Hermet Park
345b867c38 loader/lottie: optimize the matrix computation.
Do not multiply the matrices if either one is identity.
2023-08-22 21:25:42 +09:00
Hermet Park
b240e781d9 loader/lottie: ++optimization.
Removed intermediate scenes that were nothing more than transformations.
2023-08-22 21:25:37 +09:00
Hermet Park
9ba44dc10b
Update README.md 2023-08-22 19:53:05 +09:00
Hermet Park
f399491557 loader/svg: ++optimization
flush out the used internal memory immediately.
2023-08-22 13:29:49 +09:00
Hermet Park
5d32cf1e3b loader/svg: ++optimization
share the image data to bypass the need for multiple bitmap memory copies.
2023-08-22 13:29:49 +09:00
Hermet Park
3437e4729f examples: remove Stress
we have a good stress test - Lottie
2023-08-21 19:49:05 +09:00
Hermet Park
77de62068c renderer taskscheduler: code refactoring.
removed an unnecessary internal variable.
2023-08-21 17:16:45 +09:00
Hermet Park
8f9bdebd35 renderer task-scheduler: ++thread safety
Currently, tasks are expected to be triggered from the main thread.
This ensures preventing the popping of a thread from a worker thread.

Previously, there was a potential deadlock problem...
2023-08-21 17:16:45 +09:00
Hermet Park
cd71c66703 loader/jpg: fix a sanitizer report.
Bypass the operation involving a negative value shift.

../src/loaders/jpg/tvgJpgd.cpp:434:36: runtime error: left shift of negative value -5
2023-08-21 17:16:45 +09:00
Mira Grudzinska
c2ca01a5c5 common: shape's composition fixed
In the case of a gradient stroke and a valid
fill, the composition wasn't applied correctly,
resulting in an unexpected overlap between
the fill and stroke.

@Issue: https://github.com/thorvg/thorvg/issues/445
2023-08-20 21:39:56 +09:00
Mira Grudzinska
70fff186b2 svg_loader: support other units for mask and clip
Added support for the objectBoundingBox value of
the clipPathUnits and for the userSpaceOnUse value
of the maskContentUnits.

@Issue: https://github.com/thorvg/thorvg/issues/429
2023-08-19 13:10:03 +09:00
Hermet Park
f573e1390f renderer/paint: added an option for stroking when acquiring bounding box size.
The 'Paint' function now includes an internal stroking option,
allowing the bounding box to be calculated with or without the stroke size taken into account.

This feature is particularly useful for SVG loaders,
and we might consider making the interface available for user demands in the future.
2023-08-18 22:15:55 +09:00
Hermet Park
2777d3ed17 doc: updated lottie demo video. 2023-08-18 18:29:18 +09:00
Hermet Park
e3e26abb45
Update README.md 2023-08-18 17:45:48 +09:00
Hermet Park
7e15cfaf15 doc: updated the lottie example video 2023-08-18 17:28:41 +09:00
Hermet Park
664f028c15 loader/lottie: fix all data conversion compiler warnings on windows 2023-08-18 16:36:15 +09:00
Hermet Park
c90962a26c lottie/loader: fix memory leaks 2023-08-18 15:16:34 +09:00
Hermet Park
cf826bee5d lottie/builder: --compiler warning on MacOS 2023-08-18 13:14:06 +09:00
Hermet Park
994c1b99a5 lottie/loader: support the masking features.
Enhancing the basic masking options by providing additional support.
2023-08-17 23:03:37 +09:00
Hermet Park
3b2c040f70 loader/lottie: add the missing solid color layer. 2023-08-17 23:03:37 +09:00
Hermet Park
3f05489b80 infra wasm: update the build script.
Disable the log in default for outside users.
we gonna turn it on manually for the lottie viewer
2023-08-17 23:03:37 +09:00
Hermet Park
e7d29e166b loaders: unify duplicated b64 decoders.
- move the svg/lottie b64 decoders to tvgLzw.
- renames tvgLzw -> tvgCompressor
2023-08-17 21:28:58 +09:00
Hermet Park
846823bd7f utils/math: binary size reduction
reduced the binary size by 2kb by removing the inline code.
2023-08-17 21:28:58 +09:00
Hermet Park
e4b8f70f4f loader/svg: remove the redundant copyright.
The SVG scene builder has undergone significant changes.
It no longer retains the shadow of the original source.
2023-08-17 21:28:58 +09:00
Hermet Park
381dfb06d4 renderer paint: tiny optimization
Skip the unnecessary assignment of the value when the initial values
come.
2023-08-17 21:28:58 +09:00
RuiwenTang
66e533deee gl_engine: Fix mistake in glbuffer id check
`GL_INVALID_VALUE` is generate during `glGenBuffers` and is checked by
calling `glGetError()` inside `GL_CHECK` macro.

While the buffer id is valid if the value is not zero.
2023-08-17 21:28:37 +09:00
Mira Grudzinska
5bafdcbfa3 lottie_loader: return false for frameRate = 0
Loading a png file without giving a mimetype, resulted
in an error from the lottie loader.
2023-08-17 18:47:51 +09:00
Hermet Park
15c09f260f loader/lottie: Fix the incorrect precomp layer frame time
The frame number of the referenced layer should be
reduced by the precomp start frame.
2023-08-17 15:53:12 +09:00
Hermet Park
c5c40885ca
Update README.md
polishing up.
2023-08-17 11:08:18 +09:00
Hermet Park
9ec6ef7650
Update README.md 2023-08-16 16:48:47 +09:00
Mira Grudzinska
b9c71b4e0f common: log msg++ 2023-08-16 00:36:42 +09:00
Hermet Park
5778bda4db loader/lottie: do not build layers if the frame is out. 2023-08-15 15:49:10 +09:00
Hermet Park
86aabb4df0 loader lottie: image optimization
In every frame, the image undergoes a Colorspace conversion attempt.

This approach aims to bypass the step by retaining the pre-converted image data.

I acknowledge that this might not be the best approach,
but it is proving to be quite effective at the moment.
2023-08-15 15:49:05 +09:00