Commit graph

2434 commits

Author SHA1 Message Date
Hermet Park
6ef979f2a0 sw_engine/fill: fix a linear filling scaling issue.
The condition is not valid,
Let it draw the fill as it's requested.

Issue: https://github.com/thorvg/thorvg/issues/1834
2024-01-02 20:34:11 +09:00
Hermet Park
700af87a77 Update README.md 2024-01-02 20:34:11 +09:00
Sergii Liebodkin
5ba19a8a7f wg_engine: shape bbox based rendering (optimization)
Before the current changes, all surfaces were painted using a full-screen overlay, no matter how large the object was rendered. This approach is redundant and required reorganization. At the moment, all objects are rendered using an overlay equal to the box of the object itself, which reduces the cost of filling the surface.
Also surfaces and images were divided into different entities, which reduces the pressure on memory.
Also geometry data for rendering and geometry data for calculations in system memory were logically separated.
2024-01-02 20:34:11 +09:00
Sergii Liebodkin
4164b36c8a wg_engine: Added shape opacity value usage
[issues 1479: Opacity](#1479)

Usage example:

    // prepare a shape (Rectangle + Rectangle + Circle + Circle) with opacity
    auto shape1 = tvg::Shape::gen();
    shape1->appendRect(0, 0, 200, 200);                //x, y, w, h
    shape1->appendRect(100, 100, 300, 300, 100, 100);  //x, y, w, h, rx, ry
    shape1->appendCircle(400, 400, 100, 100);          //cx, cy, radiusW, radiusH
    shape1->appendCircle(400, 500, 170, 100);          //cx, cy, radiusW, radiusH
    shape1->fill(255, 255, 0);                         //r, g, b
    shape1->opacity(128)                               //opacity
    canvas->push(std::move(shape1));
2024-01-02 20:34:11 +09:00
Hermet Park
bcdf877339 loader/svg: optimize the path conversion.
Push the path data into a given shape directly.
This will skip unnecessary memory copies.

Issue: https://github.com/thorvg/thorvg/issues/1848
2024-01-02 20:34:11 +09:00
Hermet Park
a59950ea97 Welcome to our new official ThorVG developer. 2024-01-02 20:34:11 +09:00
Jinny You
501b2b060c web: Add a readme 2024-01-02 20:34:11 +09:00
Jinny You
b8d64c5ecd web: Add config to support npm module 2024-01-02 20:34:11 +09:00
Jinny You
e3f3a97f8d web: Add examples
- `index.html` : basic example
- `benchmark.html` : to check FPS, memory usage, latency(ms)
2024-01-02 20:34:11 +09:00
Jinny You
306a30185f web: Implement features
- define separated model for better readability of interface
- implemented thorvg basic features

added features:
- Add version info
- Support setBgColor
- Support save2gif
- Support bounce mode
- Support intermission
- Support skipping needless animation by dom visible
2024-01-02 20:34:11 +09:00
Jinny You
58f44100bc web: Add wasm loading logic 2024-01-02 20:34:11 +09:00
Jinny You
a88653194b web: Add library build script 2024-01-02 20:34:11 +09:00
Jinny You
8ce484c7df web: Add lit element
- introduce a `lit`(https://lit.dev)
- lit is most popular web component builder
- with lit, we can build high-performance WP with less code
2024-01-02 20:34:11 +09:00
Jinny You
fb63a9a937 web: Set up eslint 2024-01-02 20:34:11 +09:00
Jinny You
0d209b5440 web: Set up typescript 2024-01-02 20:34:11 +09:00
Jinny You
26a3a61a60 web: Add gitignore 2024-01-02 20:34:11 +09:00
Jinny You
c3d5cb1925 web: Add a package manifest info 2024-01-02 20:34:11 +09:00
Jinny You
7838c1d3d1 wasm: Update emscripten build config
enabled options:
- EXPORT_ES6 > to import glue code in es6 module system
- SINGLE_FILE > to build library as a single JS file, single file reduces loading latency
- MODULARIZE > proper option to build es6 module (optimized)
- EXPORTED_RUNTIME_METHODS > allow es6 module based glue code to import FS
2024-01-02 20:34:11 +09:00
Jinny You
87722991f7 wasm: Revise the wasm binding for lottie-player
- removed and replaced `tvgWasm`
2024-01-02 20:34:11 +09:00
Sergii Liebodkin
003464b7e5 wg_engine: refactor context handles
New approach provide:
- instance, adaptor, device and default queue
- device capabilitieas
- command buffer executor
- error handling
2024-01-02 20:34:11 +09:00
Sergii Liebodkin
e797cf63f4 wg_engine: refactor render targets handling
For further development of features, we need to create off-screen buffers that will allow us to implement functionality related to composition and blending, as well as for loading data to system memory from the framebuffer. Separating the framebuffer into a separate entity allows you to create several instances of them, switch between them, and blend them according to given rules.

For current time we have only a single render target instance, that have a handle to drawing into surface surface, like a native window.

New approach allows:
- offscreen rendering
- render pass handling
- switching between render targets
- ability to render images, strokes and shapes into independent render targets
2024-01-02 20:34:11 +09:00
RuiwenTang
d3169ea8fe gl_engine: fix wrong scissor value cause content not fully rendered 2024-01-02 20:34:11 +09:00
Hermet Park
2efdae710d renderer: minor optimization.
reduce the binary size.
2024-01-02 20:34:11 +09:00
RuiwenTang
c8833e970d gl_engine: optimize framebuffer creation and save some runtime memory
since the framebuffer will draw back to parent RenderPass, it can be
reused in next compose rendering.

So instead of create framebuffer every time when beginCompose is called, we
trying to reuse the framebuffer created before in the same stack level
2024-01-02 20:34:11 +09:00
Hermet Park
83e3cb24ff doc: polish up the doxygen.
- applied @retval for those const values.
- applied @return for return value description.
2024-01-02 20:34:11 +09:00
Hermet Park
a6378fc673 wg_engine: apply tvg coding style. 2024-01-02 20:34:11 +09:00
Sergii Liebodkin
9742cfe293 wg_engine: pipelines and bind groups refactoring
- shader and system types synchronized
- pipelens and bind groups description separated
- pipelines description simplified
2024-01-02 20:34:11 +09:00
Hermet Park
f173b45e04 renderer/picture: fixed a regression
reverted a wrong change from the previous code refactoring
in 5643348472
2024-01-02 20:34:11 +09:00
Hermet Park
74a7c45214 common: clean up the code. 2024-01-02 20:34:11 +09:00
Hermet Park
21d2638793 doc: added thorvg-gpt badge (link) 2024-01-02 20:34:11 +09:00
Hermet Park
a4054abffc Update CONTRIBUTING.md 2024-01-02 20:34:11 +09:00
Hermet Park
d9a3a36d98 Update CODEOWNERS
* removed inactive member.
2024-01-02 20:34:10 +09:00
Vincent Torri
7e438a665c include missing headers for strcmp(), strdup() and realloc() 2024-01-02 20:34:10 +09:00
Hermet Park
bbf3cec2cc common/array: code refactoring.
Use a default constructor with reservation.
2024-01-02 20:34:10 +09:00
Hermet Park
79facf3656 renderer/scheduler: --binary size by 2.2kb
replace the stl with own lightweight data structures.
2024-01-02 20:34:10 +09:00
Hermet Park
6f19c581e8 infra: renamed the folders, images -> resources.
these folders might have more than images.
2024-01-02 20:34:10 +09:00
Hermet Park
f594806dd3 renderer/shape: Apply the magic number kappa to achieve rounded corners.
The magic number kappa (0.552284), which is associated with the bezier curve,
has been introduced. This formula is supposed to be applied to the rounded corners
of the rectangle to ensure consistent drawing results.

Issue: https://github.com/thorvg/thorvg/issues/1824
2024-01-02 20:34:10 +09:00
Hermet Park
e928307ced Create CODE_OF_CONDUCT.md 2024-01-02 20:34:10 +09:00
Hermet Park
c0a1f82033 renderer/loader: optimization++
removed the internal unique_ptr usage to reduce the binary size(-553)
2024-01-02 20:34:10 +09:00
Hermet Park
7acb263b66 docs: updated 2024-01-02 20:34:10 +09:00
Hermet Park
6e7b10ea87 docs: updated resource image. 2024-01-02 20:34:10 +09:00
Jinny You
118516f015 lottie/builder: fix crash by null reference 2024-01-02 20:34:10 +09:00
Hermet Park
8e6705d9dc Update README.md 2024-01-02 20:34:10 +09:00
Hermet Park
8e322cfa12 Update README.md 2024-01-02 20:34:10 +09:00
Hermet Park
0cbedfd12b Update README.md 2024-01-02 20:34:10 +09:00
Hermet Park
ba5184e127 doc: updated practices 2024-01-02 20:34:10 +09:00
Jinny You
d173e62530 loader/jpg: Fix warning 2024-01-02 20:34:10 +09:00
Sergii Liebodkin
cb737f174c [Issues 1811: Compiller shadowing warning](https://github.com/thorvg/thorvg/issues/1811)
Godot CI compilation issue fixed
2024-01-02 20:34:10 +09:00
RuiwenTang
269537a411 gl_engine: support advance compose method 2024-01-02 20:34:10 +09:00
Hermet Park
221005bb25 lottie/builder: revert the clipper cache.
This ia a buggy,
We will revisit this optimization with a perfect solution.
2024-01-02 20:34:10 +09:00