Mira Grudzinska
8ed4c2f302
sw_engine: move trimming logic to TrimPath
...
The trim handling from sw_engine has been removed.
Instead the common logic from the TrimPath structure
is used.
On the sw_engine side, the dashed outline is now
used for both: dashed and/or trimmed strokes.
@Issue: https://github.com/thorvg/thorvg/issues/2854
2025-02-06 22:39:11 +09:00
Mira Grudzinska
669d6dc580
common: introduce TrimPath struct
...
The first step towards unifying trimming across engines.
@Issue: https://github.com/thorvg/thorvg/issues/2854
2025-02-06 22:39:11 +09:00
Hermet Park
0dd0a3b45c
common: neat code++
...
introduced common BBox structure
2025-02-06 15:40:32 +09:00
Sergii Liebodkin
857f1404e1
wg_engine: gaussian blur basic implementation
...
Introduce blur effect for webgpu renderer
Issue: https://github.com/thorvg/thorvg/issues/3054
2025-02-06 14:44:08 +09:00
Hermet Park
f4a2c922be
lottie: minor optimization
...
use a reusable buffer for intermediate path generation.
2025-02-06 12:21:16 +09:00
Hermet Park
4edaf311c6
lottie: ++compact & neat code
...
introduced RenderPath to minimize the path parameters.
2025-02-05 19:55:12 +09:00
Mira Grudzinska
580019b64b
gl_engine: fix color burn/dodge edge cases
...
Aligned with sw_engine implementation.
2025-02-03 15:06:39 +09:00
Mira Grudzinska
e7e168a28b
wg_engine: fix color burn/dodge edge cases
...
Aligned with sw_engine implementation.
2025-02-03 15:06:39 +09:00
Mira Grudzinska
41f10b9702
sw_engine: fix color burn/dodge edge cases
...
Dodge d / (1 - s):
- handle d = 0 first to avoid 0/0 when s = 1
- for d != 0 and s = 1, the formula results in d/0 (infinity),
which maps to 1 in the 0-1 range (or 255 in the 0-255 range)
Burn 1 - (1 - d) / s:
- handle d = 1 first to avoid 0/0 when s = 0
- for d != 1 and s = 0, the formula results in 1 - 0/0 -> 1 - inf = -inf
Negative infinity in the 0-1 range corresponds to the minimum possible
value, which is 0 (255 if we operate in 0-255 range).
2025-02-03 15:06:39 +09:00
Mira Grudzinska
9c864f3e99
common: more accurate clipped viewport rounding
...
Replaced ceil and direct casts with nearbyint to improve
viewport size calculation. This ensures consistent
approach with the fastTrack case in sw_engine.
@Issue: https://github.com/thorvg/thorvg/issues/3148
2025-02-03 14:54:03 +09:00
Hermet Park
746ca7f58b
renderer: hotfix a nullptr memory copy
2025-01-30 23:18:28 +09:00
Sergii Liebodkin
0ecd2c0fd4
engine: introduce scene effect dispose render method
...
to correctly remove RenderDate from effects it must be removed in the renderer
a new method has been added to the RenderMethod interface
2025-01-26 10:13:28 +09:00
Sergii Liebodkin
83eb89c5c9
wg_engine: fix segmentation fault on windows with SVG examples
...
Some SVG files fails during tesselation on windows.
Fixed
2025-01-24 20:48:08 +09:00
Hermet Park
b8f2e3815a
sw_engine: ++reference info
2025-01-23 12:32:31 +09:00
Mira Grudzinska
758aa932d7
gl_engine: add support for stroke/fill ordering
2025-01-22 16:24:29 +09:00
Hermet Park
fdd760a34f
api: revised the animation segment specification
...
Changed the unit of the segment from a normalized value to frame numbers,
ensuring alignment with other frame control interfaces.
Note that This change may break backward compatibility.
issue: https://github.com/thorvg/thorvg/issues/3116
2025-01-22 13:03:48 +09:00
Abdelrahman Ashraf
53487421b5
chore(build): exclude webgpu_native for emscripten build
...
- Add platform check to exclude webgpu_native in meson.build
- Avoid requiring -Dbindings=wasm_beta for Emscripten builds
2025-01-21 22:55:15 +09:00
Hermet Park
b79d12a04d
gl_engine: hotfix memory leak
...
issue: https://github.com/thorvg/thorvg/issues/3140
2025-01-20 21:27:06 +09:00
Mira Grudzinska
5752e75ff9
wg_engine: fix bug introduced in 07e73a9
...
Fixed loop condition.
2025-01-20 21:25:22 +09:00
Hermet Park
44075aa0f0
sw_engine: Improved the blur performance by 12%
...
Applied the compromised approach for the gaussian blur
since the effect is a bit burdensome for cpu processing
as animatable effects.
- Optimized performance and quality with negligible observable differences.
- Disabled the border option until specific use cases are identified.
2025-01-20 17:46:53 +09:00
Hermet Park
ef41f3f79c
sw_engine/texmap: tuning the blending logic
...
Compromed the translucent/opaque logic by unifying them,
for code size and maintenance.
2025-01-18 15:10:07 +09:00
Mira Grudzinska
abdb96b8a0
sw_engine: fix bug introduced in 07e73a9
...
The value of the variable 'i' was not modified
after the refactor, resulting in a reference to
an incorrect array element.
2025-01-17 18:33:19 +09:00
Hermet Park
df0658e2da
renderer: improved engine for scalable effects
...
RenderMethod effects methods would have changes:
+ update() //update the effects if any
- prepare() -> region() //update the effect drawing region
- effect() -> render() //draw the effect
2025-01-17 16:11:29 +09:00
Hermet Park
dfa05a5c43
common: neat & clean code++
2025-01-17 00:46:03 +09:00
Jinny You
61028747c6
sw_engine: Fix buffer overflow in texture mapping rasterizer
...
Fix heap buffer overflow in texture mapping rasterizer by adding proper
bounds checking for texture coordinates. This prevents accessing memory
outside of the allocated image buffer during texture sampling and
interpolation.
Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
issue: https://github.com/thorvg/thorvg/issues/3102
2025-01-16 14:43:17 +09:00
Jinny You
4aba0caaad
wasm: fix build issue in sw/wg build only case
...
- resolved EMSCRIPTEN_WEBGL_CONTEXT_HANDLE declaration problem.
- currentContext() should be also called after `mContext` is initialized.
2025-01-15 21:27:00 +09:00
Hermet Park
07e73a9e6f
common: code refactoring
...
use ARRAY_FOREACH() for neat code and
accessing the memory efficiently than normal indexing.
2025-01-15 18:03:46 +09:00
Hermet Park
8f98681ea7
renderer: minor code clean++
2025-01-15 12:24:32 +09:00
Hermet Park
ce3f0a75e2
gl_engine: corrected ColorDodge, ColorBurn equation
...
issue: https://github.com/thorvg/thorvg/issues/3072
2025-01-14 12:19:18 +09:00
Hermet Park
48c8094d19
api: path api revision for v1.0
...
Unify the Path commands & pts getters.
C++ API modiciation:
- uint32_t Shape::pathCommands(const PathCommand** cmds) const
- uint32_t Shape::pathCoords(const PathCommand** cmds) const
-> Result Shape::path(const PathCommand** cmds, uint32_t* cmdsCnt, const Point** pts, uint32_t* ptsCnt)
C API modification:
- Tvg_Result tvg_shape_get_path_coords(const Tvg_Paint* paint, const Tvg_Point** pts, uint32_t* cnt)
- Tvg_Result tvg_shape_get_path_commands(const Tvg_Paint* paint, const Tvg_Path_Commands** cmds, uint32_t* cnt)
-> Tvg_Result tvg_shape_get_path(const Tvg_Paint* paint, const Tvg_Path_Command** cmds, uint32_t* cmdsCnt, const Tvg_Point** pts, uint32_t* ptsCnt)
issue: https://github.com/thorvg/thorvg/issues/3116
2025-01-14 11:47:28 +09:00
Hermet Park
f5aa347a70
api: renamed api for consistency
...
API modification:
- Shape::fillColor() -> Shape::fill()
issue: https://github.com/thorvg/thorvg/issues/3116
2025-01-13 16:53:14 +09:00
Hermet Park
a31eceeafa
sw_engine: assign the stride omitted
...
This fixes a wrong compositor access
during the rasterization
issue: https://github.com/orgs/thorvg/discussions/3109
2025-01-13 15:07:57 +09:00
faxe1008
912752906c
renderer: Fix loader logic for mimetype check
...
Fixes the logic of the mimetype check before trying to load with the
given mimetype.
2025-01-11 13:53:24 +09:00
faxe1008
0c09580cd4
common: Use explicit floating-point value types.
...
Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
2025-01-10 12:16:13 +09:00
faxe1008
9a8173cc22
drenderer: include alloca.h for Zephyr
...
Changes the conditional for to also include the alloca.h header in case
it is build for the zephyr rtos.
2025-01-10 11:27:59 +09:00
Hermet Park
3d6fe5ffae
sw_engine: ++portability on macOS
...
fixed a runtime error report of the sanitizer
at data casting.
issue: https://github.com/thorvg/thorvg/issues/3102
2025-01-09 00:43:30 +09:00
Sergii Liebodkin
222e8a25a1
wg_engine: fix context handle passimg by ref
...
Use reference insted of value for context passing
2025-01-08 17:21:57 +09:00
Hermet Park
d2d93792df
wg_engine: corrected ColorDodge, ColorBurn equation
...
issue: https://github.com/thorvg/thorvg/issues/3072
2025-01-08 13:54:09 +09:00
Hermet Park
084c7ff214
sw_engine: corrected blendings
...
corrected wrong ColorDodge, ColorBurn, Exclusion, SoftLight blendings
issue: https://github.com/thorvg/thorvg/issues/3072
2025-01-08 13:27:58 +09:00
Hermet Park
a12accbc93
updated copyright
2025-01-03 14:32:31 +09:00
Mira Grudzinska
acc614ab2f
sw_engine: prevent warning
...
Remove unused version of SUBPIXELS().
2025-01-03 10:24:46 +09:00
Hermet Park
2fb925a2d7
sw_engine: corrected the rle cell building
...
Properly build the cell cover value
when a new cell value is just overlapped.
This fixes certain weird visual artifacts at a corner case.
issue: https://github.com/thorvg/thorvg/issues/2929
2025-01-02 17:49:28 +09:00
Hermet Park
47524300bb
sw_engine: minor code clean up
2025-01-02 17:49:28 +09:00
RuiwenTang
3c6d686795
gl_engine: fix fbo and texture leak
...
GlRenderTarget contains framebuffer and render target objects,
these GPU resources need to be released before reusing the structure and calling init with the new size.
2024-12-31 16:25:11 +09:00
Hermet Park
76203c3dbb
gl_engine: ensure the gl context switching
...
This only covers emscripten environment,
need to cover other system.
issue: #3023
Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
2024-12-31 12:07:52 +09:00
Jinny You
596de01b12
gl_engine: revise target API for context managing
...
Issue: #3024
2024-12-31 12:07:52 +09:00
Hermet Park
1cbc11cadd
renderer: revamped engine interfaces
...
Introduced updated pre/post calls
for proper preparation of the drawing process.
2024-12-31 12:07:52 +09:00
Hermet Park
ccf5a8158f
gl_engine: ++binary optimization
...
- removed unique_ptr, shared_ptr
- replaced std::vector with tvg::Array
- reduced binary size by -10kb
2024-12-30 22:24:53 +09:00
Mira Grudzinska
82dc41479e
sw_engine: fix clipping
...
A shape with both fill and stroke, where clipping left
only a fragment of one (either fill or stroke), was not
rendered at all. Now fixed.
2024-12-30 12:01:24 +09:00
Hermet Park
0e9bc74603
api: renamed FillRule::Winding to NonZero
...
aligned the name with the web standard.
2024-12-27 21:16:27 +09:00