Commit graph

2143 commits

Author SHA1 Message Date
Hermet Park
ea4f28e5db
Update README.md 2023-07-23 14:32:24 +09:00
Hermet Park
56deda19fd
Update README.md 2023-07-23 14:27:48 +09:00
Hermet Park
0e86cfebba sw_engine raster: ++strict types. 2023-07-19 21:57:04 +09:00
Hermet Park
251c97b2d8
Update README.md 2023-07-19 20:30:56 +09:00
Hermet Park
5f8c79f593
Update README.md 2023-07-19 20:29:45 +09:00
Hermet Park
d99d8a565f common array: fix a wrong size. 2023-07-18 15:09:21 +09:00
Hermet Park
463fc853be examples webp: --compiler warning.
1 warning generated.
[122/183] Compiling C++ object src/examples/PictureWebp.p/PictureWebp.cpp.o
../thorvg-git/src/examples/PictureWebp.cpp:38:18: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
    canvas->push(move(bg));
                 ^
                 std::
../thorvg-git/src/examples/PictureWebp.cpp:53:26: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        if (canvas->push(move(picture)) != tvg::Result::Success) return;
                         ^
                         std::
../thorvg-git/src/examples/PictureWebp.cpp:77:18: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
    canvas->push(move(picture));
                 ^
                 std::
2023-07-18 11:02:26 +09:00
Hermet Park
952bc01c41 sw_engine: fix clang compiler warnings.
[29/73] Compiling C++ object src/libthorvg.a.p/lib_sw_engine_tvgSwStroke.cpp.obj
../src/lib/sw_engine/tvgSwStroke.cpp(258): warning C4244: 'argument': conversion from 'float' to 'int64_t', possible loss of data
[32/73] Compiling C++ object src/libthorvg.a.p/lib_sw_engine_tvgSwRaster.cpp.obj
../src/lib/sw_engine/tvgSwRaster.cpp(259): warning C4244: 'initializing': conversion from 'float' to 'uint32_t', possible loss of data
../src/lib/sw_engine/tvgSwRaster.cpp(260): warning C4244: 'initializing': conversion from 'float' to 'uint32_t', possible loss of data
2023-07-18 10:45:52 +09:00
Hermet Park
cf09ba5abd common sw_engine: code refactoring
Even though this enlarges the binary size by 300bytes,
use the array instead of individual implementations for better maintenance.
2023-07-17 20:14:58 +09:00
Hermet Park
5528eb9831 common array: code chores.
remove duplicated logic
this also changes the default grow size: N*2 -> N+(N/2)
2023-07-17 20:14:58 +09:00
Vincenzo Pupillo
c3af682f68 Refactoring of GlGeometry::decomposeOutline due to an internal change in RenderShape data structure. 2023-07-15 11:13:56 +09:00
Hermet Park
d7058e41e4 common bezier: fix a regression bug.
revert issued code from def6393d82.
2023-07-12 20:50:58 +09:00
Hermet Park
def6393d82 common bezier: Add a function that returns the position.
A utility for common use of the Bezier curve.
2023-07-11 18:35:33 +09:00
Hermet Park
81afba5035 infra: updated git setting.
@Issue: https://github.com/thorvg/thorvg/issues/1519
2023-07-10 12:36:46 +09:00
Hermet Park
3db78984da
Update README.md 2023-07-05 23:12:32 +09:00
Hermet Park
e3b1cd86f9
Update README.md 2023-07-05 23:09:13 +09:00
Hermet Park
46aa29781a common math: enhance matrix functions.
Accumulating matrix value factors would have broader usage.
2023-07-05 15:17:04 +09:00
Hermet Park
b81b23af62 common array: allow it to modify values. 2023-07-05 15:17:04 +09:00
Hermet Park
accb8c5699 svg loader: --compiler warnings
../src/loaders/svg/tvgSvgLoader.cpp: In function ‘void _copyAttr(SvgNode*, const SvgNode*)’:
../src/loaders/svg/tvgSvgLoader.cpp:2911:44: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
 2911 |             if (to->node.polygon.pts.count = from->node.polygon.pts.count) {
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/loaders/svg/tvgSvgLoader.cpp:2917:45: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
 2917 |             if (to->node.polyline.pts.count = from->node.polyline.pts.count) {
2023-07-04 01:17:25 +09:00
Hermet Park
d72d6aa51f loader svg: code cleanup
Use array instead of individual dynamic array implementation.
This also fixes wrong polygon & polyline data access during copy & paste...
2023-07-04 01:09:23 +09:00
Hermet Park
95ebbe4339 common array: + copy constructor
introduce the copy constructor to prevent duplicated code.
2023-07-04 01:09:23 +09:00
Hermet Park
b7dfe661b5 common: --unnecessary null check. 2023-07-03 15:49:16 +09:00
Hermet Park
1c824ed191 common: code refactoring
Replace individual array implementation with a common feature.
2023-07-03 14:20:05 +09:00
Vincenzo Pupillo
5f64baf642 Avx raster refactoring due to an internal change to support blending
methods.
2023-07-01 12:42:24 +09:00
Vincent Torri
dabd15c4c5 tvgArray: return a const reference for const methods 2023-06-30 17:18:04 +09:00
Hermet Park
36b311f0ca
Update README.md 2023-06-29 23:27:49 +09:00
Hermet Park
80f1720821
Update README.md
+codefactor badge
2023-06-29 23:26:55 +09:00
Hermet Park
b876427325 common array: revise the interface.
Implement a pair of access methods: last() and first().
2023-06-29 20:40:16 +09:00
Hermet Park
65f178620e
Update CODEOWNERS 2023-06-29 20:36:37 +09:00
Hermet Park
ec30301aec common shape: +tiny opimization.
don't update a frame, if the color is not changed.
2023-06-27 18:44:02 +09:00
Hermet Park
dce14a8449 common: promote MULTIPLY() to a common helper macro.
it's useful among the modules.
2023-06-27 18:44:02 +09:00
Hermet Park
4482664740 common array: ++enhance the usability.
+ end() which indicates the end of the data pointer.
2023-06-26 14:58:30 +09:00
Hermet Park
bd87f1398c common array: ++enhance the usability.
add last() which indicates the last element pointer.
2023-06-23 16:49:39 +09:00
Hermet Park
3fa33c0315
Update README.md
+ binary size badge
2023-06-20 23:56:46 +09:00
Hermet Park
be1984982e example stack: updated sample.
use paints() method instead of grabbing a manual list.

@Issue: https://github.com/thorvg/thorvg/issues/1501
2023-06-20 15:48:02 +09:00
Hermet Park
caa214e4db sw_engine: code refactoring.
Renamed internal methods; the name 'RGBA' is sometimes confusing
because the channel composition does not accurately reflect it.

Therefore, it should be removed or replaced with 'Pixel'.
2023-06-20 14:57:01 +09:00
Hermet Park
00a87825b9 sw_engine: optimize code.
Considering the fundamental scenario,
the masking feature would likely be used less frequently.

We sacrifice a small amount of performance
by substituting the multiple implementations with blender calls.

However, this trade-off can result in a reduction in binary size.

Bin size: 212089 -> 205907 (-6kb)
2023-06-20 14:57:01 +09:00
Hermet Park
5f4ee24dc6 updated AUTHORS 2023-06-20 11:40:50 +09:00
Hermet Park
3512beab9f test: ++blending 2023-06-20 11:30:18 +09:00
Hermet Park
f36455048a examples: add SceneBlending 2023-06-20 11:30:18 +09:00
Hermet Park
0b65d1fce5 sw_engine raster: ++tiny optimization
Attempt to perform as much computation as possible
before entering the rasterization stage.

This contains the code refactoring as well.
2023-06-20 11:30:18 +09:00
Hermet Park
0cc7833000 example: update blending sample 2023-06-20 11:30:18 +09:00
Hermet Park
c50d2fde5f common sw_engine: support blending methods.
The blending feature allows user to combine colors to create visually appealing effects,
including transparency, lighting, shading, and color mixing, among others.

Its process involves the combination of colors or images from the source paint object
with the destination (the lower layer image) using blending operations.

The blending operation is determined by the chosen @p BlendMethod,
which specifies how the colors or images are combined.

@APIs:
 - enum class BlendMethod::Normal, Add, Screen, Multiply, Overlay, Lighten, Difference, Exclusion, SrcOver, Darken, Lighten, ColorDodge, ColorBurn
 - BlendMethod Paint::blend() const noexcept;
 - Result Paint::blend(BlendMethod method) const noexcept;

@Issue: https://github.com/thorvg/thorvg/issues/307

Co-authored-by: Peter Vullings <peter@projectitis.com>
Co-authored-by: Hermet Park <hermetpark@lottiefiles.com>
2023-06-20 11:30:18 +09:00
Hermet Park
eea54f5fea sw_engine: code chores & fix gradient filling bugs.
renaming internal methods for integrating with upcoming blending features.
this also fixes minor wrong gradient filling blending equations.
2023-06-20 11:30:18 +09:00
Hermet Park
b60a291edc sw_engine: code refactoring
Removed the fake blender structure.
Unified matting and join as Surface methods.
2023-06-20 11:30:18 +09:00
Hermet Park
814d87626c common engines: optimizing data packing for compactness.
Standardized the opacity data type to use 1 byte
across all instances to maintain consistency and reduce scattered usage.
2023-06-15 10:35:34 +09:00
Hermet Park
e1d73b2c2e doc: fix wrong info by mistake 2023-06-14 12:17:50 +09:00
Hermet Park
9a494e0adb doc: update the CompositeMethod. 2023-06-14 12:06:39 +09:00
Hermet Park
4f26a84b53 common: optimize paint data size.
packing the data fields with the appropriate size.

96 -> 24 (-9 bytes per one paint)
2023-06-14 10:46:30 +09:00
Hermet Park
90c9810b97 test: ++coverage of Canvas::paints(), Scene::paints() 2023-06-14 10:46:21 +09:00