Commit graph

1702 commits

Author SHA1 Message Date
Hermet Park
ee60a04f20 sw_engine image: code refactoring
revert d520da2db8

After considered the scneario seriously,
this doesn't helpful for the performance at all...
just increased code complexity. earlier bad decision... revert it.
2021-11-15 11:27:29 +09:00
Mira Grudzinska
8362ddda74 sw_engine: avxRasterTranslucentRle implemented 2021-11-15 11:16:17 +09:00
Hermet Park
1592443c3e common paint: improve rotation condition precision
cover the four cases: 0, 90, 180, 270 degrees...
2021-11-12 19:45:01 +09:00
Hermet Park
cfe5d80099 common paint: improve rotation condition precision 2021-11-12 17:24:02 +09:00
JunsuChoi
e2c7599769 infra bot: Hotfix memcheck bot for push event 2021-11-12 17:18:05 +09:00
Hermet Park
b1604e2ec7 common paint: fix invalid memory access in unit test
casting the paint to shape is not allowed if the compositor target
is not shape, here it concretely checking the the type before casting....
2021-11-12 16:42:30 +09:00
Hermet Park
d520da2db8 sw_engine image: optimized image rendering.
Applied the fast-track routine for axis-aligned images.
This helps to remove outline generation if no clips.
2021-11-12 16:28:15 +09:00
JunsuChoi
d7973e9330 infra bot: Add Memcheck bot (valgrind)
If the unit test is successful, valgrind memory check is executed based on the test.
If a leak occurs in the test result, the bot notifies the PR as a comment.
This notify may not be directly related to the created current PR.

(Asan is on hold because it is not well tested in the github action CI environment.)
2021-11-12 16:14:00 +09:00
Hermet Park
15412907b8 svg2png: update the error messages.
@Issue: https://github.com/Samsung/thorvg/issues/1031
2021-11-12 12:00:01 +09:00
Hermet Park
ae3dae8c55 sw_engine image: introduce the stride property for the image.
we are considering the larger space of the image buffer,
in this case stride info is necessary.
2021-11-12 10:49:36 +09:00
Hermet Park
44ccfc46d8 common paint: alpha masking optimization
applying fast track approach to the alpha mask when its condition is matched.
(simple rectangle alpha masking which isn't half-translucent)

From time to time, designers brutally use the alpha masking to clip simple region,
thorvg can help the situation by avoiding masking usage internally.

This can reduce the 1-step render pass composition.

@Issue: https://github.com/Samsung/thorvg/issues/344
2021-11-12 10:49:24 +09:00
Hermet Park
91668143e1 sw_engine raster: code refactoring
remove duplicated logic.
2021-11-12 10:49:15 +09:00
Hermet Park
1527f70221 sw_engine raster: allow image interpolation by increasing tolerance.
current image interpolation method is a bit awkward,
because xy scale different scale factor is not allowed.

we must improve the algorithm,

but now considering floating point precision,
we allow the interpolation by less ratio floating fraction.
2021-11-12 10:47:30 +09:00
Mira Grudzinska
ed640630c1 svg_loader: mem properly freed
delete -> free
2021-11-12 10:46:53 +09:00
Mira Grudzinska
f3450e1760 svg_loader: memory properly released
delete->free
2021-11-11 21:49:13 +09:00
Hermet Park
56e2498466 png_loader: correct colorspace
decoding color channels rgba -> bgra

@Issue: https://github.com/Samsung/thorvg/issues/1007
2021-11-11 21:48:22 +09:00
JunsuChoi
24e0133f78 README: Update Badge
This badge is updated when a patch is pushed to the master branch.
2021-11-11 21:37:19 +09:00
JunsuChoi
b83d6c6419 infra: Add build test after patch merged
This test works after the patch is merged into the master branch.
2021-11-11 17:59:20 +09:00
Hermet Park
6c4896b911 sw_engine raster: code refactoring.
keep the code clean & neat.
2021-11-11 14:39:02 +09:00
Hermet Park
e2dd889e1a apis: promote beta apis to the official ones.
these apis are good to open in the next release.
2021-11-11 14:17:43 +09:00
Hermet Park
98e542e2f6 common render: code refactoring.
correct wrong coding convention.
2021-11-11 14:13:00 +09:00
Hermet Park
2f334f3300 common paint: code refactoring
renamed internal variable. no logical changes.
2021-11-11 13:07:13 +09:00
Mira Grudzinska
10e0d18d6e sw_engine: missing implementations added
Rastering functions for masked images that are not rectangular
(clipped) were implemented.
2021-11-11 12:25:13 +09:00
Hermet Park
d8262dd1f8 sw_engine raster: code refactoring
--remove parameter
2021-11-10 19:39:21 +09:00
Hermet Park
f9a7df7a10 sw_engine raster: code refactoring
unify several function paramters with one structure.
2021-11-10 19:29:09 +09:00
Hermet Park
205e463160 sw_engine raster: code refactoring
keep it neat & clean code with descriptions.
2021-11-10 18:26:31 +09:00
Hermet Park
d73ecc5524 sw_engine raster: code refactoring
renamed internal variables, no logical changes.
2021-11-10 17:34:27 +09:00
Hermet Park
cffc87e7b1 sw_engine raster: code refactoring.
keep the code thorvg convention.
2021-11-10 17:03:07 +09:00
Mira Grudzinska
8c4b679fb7 sw_engine: unification of mask and inv mask functions
The function pointers used to pass the proper blending method - mask
or inverse mask.
2021-11-10 13:07:57 +09:00
Hermet Park
097e10fea4 sw_engine renderer: fix the invalid memory access in the corner case.
Tasks can be disposed while the renderer referencing it.
Now, we can delete the tasks with lazy approach by introducing some tags.

@Issue: https://github.com/Samsung/thorvg/issues/995
2021-11-09 20:38:12 +09:00
Mira Grudzinska
14c1562b36 tvg_saver: fix memory leaks
In the cae when Result::InsufficientCondition was retured by the save()
api, the user had to remember to delete the passed paint - fixed.
Also path was not released.
2021-11-09 20:15:06 +09:00
Hermet Park
6ba2bc8eb3 tvg_loader: fix asan report.
revert c31c77c0fb

memory mis-alignment is detected by asan tool.
2021-11-09 17:11:10 +09:00
Hermet Park
cbcb85cd7c sw_engine renderer: code refactoring
free the member resources in the destructor.
2021-11-09 16:09:44 +09:00
Hermet Park
4587a39f46 test capi: fix the memory leak.
target is dangled without any proper deletion...
2021-11-09 15:05:55 +09:00
Hermet Park
de353401a7 Revert "test capi: fix memory leak."
This reverts commit 651a98a2d8.

Applied the alternative solution instead of this patch.
37e39866dd
2021-11-09 14:55:54 +09:00
Hermet Park
74413a989f common paint: fix a memory leak.
delete dangling object properly in the corner case.

Unfortunately, this brings to correct the capi test cases.
we assume the paints is deleted whenever its result is successful or not.

@Issue: https://github.com/Samsung/thorvg/issues/995
2021-11-09 14:51:32 +09:00
Hermet Park
775a0bcb1d test initializer: remove a invalid test case.
This test depends on the machine environment.
it's not guaranteed the same result so we remove it.
2021-11-09 14:28:41 +09:00
Hermet Park
37e39866dd common: ++exception handling.
fix the memory leak in the corner case

detected by tvg test suites

@Issue: https://github.com/Samsung/thorvg/issues/995
2021-11-09 14:16:15 +09:00
JunsuChoi
00bba39b02 test Array: Remove too big size test
On large memory machines, if machine have enough memory,
tests failed because it doesn't return null.
2021-11-09 14:04:42 +09:00
JunsuChoi
6400493859 tvg_saver TvgSaver: Initialize local value
If paint has no path information or stroke information,
it is not referenced inside bounds.
This will access the uninitialized variable at line 759, 760.
2021-11-08 19:39:01 +09:00
Hermet Park
2aa551e222 common array: + exception handling.
properly handle if the realloc() is failed.

@Isssue: https://github.com/Samsung/thorvg/issues/995
2021-11-08 12:28:17 +09:00
Mira Grudzinska
8608238343 tests: capi - buffer was not freed 2021-11-08 12:27:23 +09:00
Hermet Park
651a98a2d8 test capi: fix memory leak.
Delete the paint which is not committed properly.
2021-11-06 01:46:42 +01:00
Hermet Park
fd74e0fae8 test: fix memory leak.
these duplicates are not unique_ptr, should be taken care.

@Issue: https://github.com/Samsung/thorvg/issues/995
2021-11-05 21:48:24 +09:00
Hermet Park
b956b0a7e0 sw_engine raster: fix build break.
trivial mistake by cdf7019b19
2021-11-05 20:59:54 +09:00
Michal Maciola
545d3ead67
WASM: unpremultiplyBuffer fixes (#999) 2021-11-05 10:32:41 +01:00
Hermet Park
45f521618c sw_engine image: ++missing logs. 2021-11-05 17:43:08 +09:00
Hermet Park
cdf7019b19 sw_raster image: add error logs to notify issues. 2021-11-05 17:42:19 +09:00
Michal Maciola
551d83add0
WASM: revert cpp_*args into properties (#998) 2021-11-05 09:40:59 +01:00
Mira Grudzinska
7bc7ab83d0 sw_engine: functions supporting a masking of the clipped images are missing
To preserve the naming convention function '_rasterTranslucentImageRle'
is reanmed to '_translucentImageRle'. The '_rasterTranslucentImageRle'
function is though created - it checks the composition method and calls
the corresponding function. Missing functions are marked, but not implemented
(separate commit).
2021-11-05 17:36:25 +09:00