platform/core/graphics/tizenvg.git
3 years agotvg_loader: code refactoring.
Hermet Park [Mon, 14 Jun 2021 05:32:05 +0000 (14:32 +0900)]
tvg_loader: code refactoring.

renamed internal functions, no logical changes.

3 years agoloader_mgr: FileTypes order changed
Michal Maciola [Fri, 11 Jun 2021 14:34:05 +0000 (16:34 +0200)]
loader_mgr: FileTypes order changed

FileType order was changed in tvgLoaderMgr.h to move Tvg at the beginning.

When raw data loading [LoaderMgr::loader(data, size)], loaders are tried
one by one (in order according to the FileType enum) until the correct loader
is found.
When using EFL and load edj, multiple loader(data, size) with tvg data may be
called. This change should improve performance in that case.

3 years agotvg_loader: added tvg format verification
mmaciola [Mon, 14 Jun 2021 05:18:10 +0000 (07:18 +0200)]
tvg_loader: added tvg format verification

TVG format verification was added on TvgLoader:open()

3 years agotests capi: revise the show-case & infrastructure.
Hermet Park [Fri, 11 Jun 2021 17:01:18 +0000 (02:01 +0900)]
tests capi: revise the show-case & infrastructure.

Change-Id: I0ea2ba3d7099bcb2a4bce052259e3e6a266eb6dc

3 years agoutc capi: Added shape fill utc.
Michal Szczecinski [Fri, 4 Jun 2021 08:11:11 +0000 (10:11 +0200)]
utc capi: Added shape fill utc.

3 years agotvg_loader: Fixed missing 'this->' keyword
Michal Maciola [Fri, 11 Jun 2021 13:55:24 +0000 (15:55 +0200)]
tvg_loader: Fixed missing 'this->' keyword

Fixed missed 'this->' in tvgTvgLoader.cpp

3 years agofix build break.
Hermet Park [Fri, 11 Jun 2021 12:02:36 +0000 (21:02 +0900)]
fix build break.

regression by - 15b56a66de8fb5872afc4bda4986cae6967ddb56

3 years agocapi: picture load data
Michal Maciola [Mon, 31 May 2021 09:44:59 +0000 (11:44 +0200)]
capi: picture load data

Added 'tvg_picture_load_data' capi.

3 years agotvg_loader: code refactoring.
Hermet Park [Fri, 11 Jun 2021 06:08:40 +0000 (15:08 +0900)]
tvg_loader: code refactoring.

revise it under the tvg coding convention.

3 years agotests: add SwCanvasBase unit tests
Hermet Park [Fri, 11 Jun 2021 06:14:35 +0000 (15:14 +0900)]
tests: add SwCanvasBase unit tests

3 years agoexamples tvg: clean up for tvg consistency.
Hermet Park [Fri, 11 Jun 2021 03:58:15 +0000 (12:58 +0900)]
examples tvg: clean up for tvg consistency.

no logical changes.

3 years agoTVG Loader/Saver module: tvg loader example
mmaciola [Fri, 11 Jun 2021 03:51:35 +0000 (05:51 +0200)]
TVG Loader/Saver module: tvg loader example

3 years agoTVG Loader/Saver: tvg loader introduced
mmaciola [Fri, 11 Jun 2021 03:49:37 +0000 (05:49 +0200)]
TVG Loader/Saver: tvg loader introduced

This patch introduces tvg loader module for loading .tvg binary files.
This allows to load and reuse pregenerated scene.

tvg file format:
.tvg is a binary file format designed for saving/restoring the scene content.
It allows to save scenes and reuse them in other apps or to restore state of
the application.

@Example:
   auto picture = tvg::Picture::gen();
   picture->load(EXAMPLE_DIR"/tvg_file.tvg");
   canvas->push(move(picture));

@API Additions:
   Result paint(std::unique_ptr<Paint> paint) noexcept;

@Issue: Issue ticket is #375.

Change-Id: Ic9c8c2d78a368f50ab1f040778cdb15b8d917cb1

3 years agoexamples: updated samples.
Hermet Park [Thu, 10 Jun 2021 11:00:55 +0000 (20:00 +0900)]
examples: updated samples.

one of children paint can not be updated immediately with a canvas.

the root paint must be passed, otherwise requesting whole canvas is the best idea.

Change-Id: Ia9ffd76054effadccc651bac6ffbdb8988d3e334

3 years agoexamples: revise examples
Hermet Park [Thu, 10 Jun 2021 03:44:20 +0000 (12:44 +0900)]
examples: revise examples

remove the show-cases that accessing the raw memory from the unique_ptr

we don't like to use those cases without any inevitable excuse.

Change-Id: I3417ce563285a58e063640123f15436c7319fc85

3 years agocommon canvas: ++ case cover exception scenarios.
Hermet Park [Thu, 10 Jun 2021 06:50:56 +0000 (15:50 +0900)]
common canvas: ++ case cover exception scenarios.

Do not update the paint if it's not pushed in the canvas.

Change-Id: I5cfd0e107389eac0e2b0947593bef1f6bc7215f5

3 years agosvg_loader: support stroke gradient
Mira Grudzinska [Wed, 9 Jun 2021 21:52:12 +0000 (23:52 +0200)]
svg_loader: support stroke gradient

The loader was ready to handle the gradient stroke, but there was no API to support
it when the loader was introduced. We've had this API for a while already, so
its call has been added.

Change-Id: Ifbda04027b79e84524cf166f05e331c9a33901e9

3 years agocommon canvas: ++ exception handling.
Hermet Park [Thu, 10 Jun 2021 02:33:57 +0000 (11:33 +0900)]
common canvas: ++ exception handling.

canvas update won't be performed if it's on drawing condition nor zero paints.

Change-Id: Ifb05ed0dc27e052d3d35c45c1a4a75cab3c31446

3 years agoexamples stacking: ++ scene stacking.
Hermet Park [Wed, 9 Jun 2021 12:07:13 +0000 (21:07 +0900)]
examples stacking: ++ scene stacking.

Change-Id: I368bddde7f058a1752ba55227205ff4dc30cb687

3 years agocommon canvas: supplement corner cases.
Hermet Park [Wed, 9 Jun 2021 11:07:28 +0000 (20:07 +0900)]
common canvas: supplement corner cases.

filled up corner cases to return the result properly.

Canvas newly has a drawing condition to prevent usage-violation.

Change-Id: I634d301e8754382eacbe2fd4f8ed0fa1b9b516a6

3 years agotest SwCanvas: ++ case cover.
Hermet Park [Wed, 9 Jun 2021 09:11:23 +0000 (18:11 +0900)]
test SwCanvas: ++ case cover.

All prerequiste condition must be passed successfully.
Each test case should verify them before actual unit-test.

Change-Id: I7cbba9b299dd9808ccdd80e1d892435e283abe30

3 years agotest SwCanvas: -- out of spec, don't guratee the result.
Hermet Park [Tue, 8 Jun 2021 08:30:00 +0000 (17:30 +0900)]
test SwCanvas: -- out of spec, don't guratee the result.

Change-Id: I7b50c4d8b48c1f494ceb5d42817cc0cfa6cdaa1f

3 years agotest SwCanvas: ++case cover
Hermet Park [Tue, 8 Jun 2021 08:26:36 +0000 (17:26 +0900)]
test SwCanvas: ++case cover

Change-Id: I7be382dc1175cc27ddeb244b910283af54bcb95c

3 years agosw_engine: added check whether surface width <= surface stride
Mira Grudzinska [Tue, 8 Jun 2021 00:06:35 +0000 (02:06 +0200)]
sw_engine: added check whether surface width <= surface stride

In a case width > stride segf occured. Such a case should be treated
as an invalid arg.

Change-Id: I662a697d0a99b20510a164d5c02515537dc76475

3 years agotests: add SwCanvas unit tests
Hermet Park [Fri, 4 Jun 2021 10:40:18 +0000 (19:40 +0900)]
tests: add SwCanvas unit tests

Change-Id: I2736062a6f64606faebef43a2e5281dc220e0def

3 years agosw_engine: fixing the composition for canvas width != canvas stride
Mira Grudzinska [Mon, 7 Jun 2021 13:48:52 +0000 (15:48 +0200)]
sw_engine: fixing the composition for canvas width != canvas stride

When canvas width was smaller than its stride and a composition is used,
the plots were drawn incorrectly. This is fixed by setting the image width
(image from a compositor) to be equal to the surface stride, instead of its width.
The image data are now allocated accordingly the fixed image width.

Change-Id: I9faa3374bf8efb85d7f6c429c41e5fd182982ed9

3 years agoRevert "tests: add SwCanvas base part unit tests" accepted/tizen/unified/20210615.120307 submit/tizen/20210611.033305 submit/tizen/20210614.083948 submit/tizen/20210614.084105
Hermet Park [Mon, 7 Jun 2021 11:08:53 +0000 (20:08 +0900)]
Revert "tests: add SwCanvas base part unit tests"

This reverts commit ce6348a5047a94ebf5e1c790c0cbd96a8c785249.

This isn't intended pushing...

3 years agocommon canvas: return FailedAllocation if it really failed at memory allocation.
Hermet Park [Mon, 7 Jun 2021 11:04:39 +0000 (20:04 +0900)]
common canvas: return FailedAllocation if it really failed at memory allocation.

This fixes SwCanvasBase Reservation Unit Test.

3 years agotests: add SwCanvas base part unit tests
Hermet Park [Mon, 7 Jun 2021 10:57:52 +0000 (19:57 +0900)]
tests: add SwCanvas base part unit tests

3 years agosw_engine mempool: tiny optimization.
Hermet Park [Mon, 7 Jun 2021 10:39:10 +0000 (19:39 +0900)]
sw_engine mempool: tiny optimization.

don't mempool anything if the option is same.

3 years agosvg_loader SceneBuilder: Remove incorrect calculation for radial gradient
JunsuChoi [Mon, 7 Jun 2021 03:09:58 +0000 (12:09 +0900)]
svg_loader SceneBuilder: Remove incorrect calculation for radial gradient

We are doing enough calculations in the parser if the unit is user space.
This causes the cx,cy coordinates of radial gradient to be calculated incorrectly.
So remove it.

3 years agosvg_loader SceneBuilder: Remove incorrect calculation for linear gradient
JunsuChoi [Fri, 4 Jun 2021 07:07:59 +0000 (16:07 +0900)]
svg_loader SceneBuilder: Remove incorrect calculation for linear gradient

Calculation of objectBoundingBox case in linear gradient is incorrect code.
This causes the x,y coordinates of the linear gradient to be calculated incorrectly.
So remove it.

3 years agosw_engine renderer: fix to success SwCanvas Unit Test.
Hermet Park [Mon, 7 Jun 2021 09:09:35 +0000 (18:09 +0900)]
sw_engine renderer: fix to success SwCanvas Unit Test.

render init count shouldn't be counted when it's in a fail-case.

3 years agocanvas: fix for SwCanvas Unit Test
Hermet Park [Mon, 7 Jun 2021 09:01:26 +0000 (18:01 +0900)]
canvas: fix for SwCanvas Unit Test

Fixed to fail canvas generation if engines are not initialized.

3 years agodoc: correct the beginning year
Hermet Park [Mon, 7 Jun 2021 08:38:49 +0000 (17:38 +0900)]
doc: correct the beginning year

3 years agocommon: fix typo
Hermet Park [Mon, 7 Jun 2021 08:36:19 +0000 (17:36 +0900)]
common: fix typo

3 years agoTVG Loader/Saver: tvg helper file ('tvgTvgHelper.h') introduced
Michal Maciola [Fri, 21 May 2021 11:30:58 +0000 (13:30 +0200)]
TVG Loader/Saver: tvg helper file ('tvgTvgHelper.h') introduced

This patch introduces tvgTvgHelper.h file that contains base definitions used
for .tvg loader and saver modules. Indicators, flags and sizes are defined
and base tvgBlock struct is declared here.
'tvgTvgHelper.h' file is essential only for .tvg loader/saver module and it
doesn't affect any other file. Loader and saver modules itself are introduced
in other, further patches.

.tvg is a binary file format designed for saving/restoring the scene content.
It allows to save scenes and reuse them in other apps or to restore state of
the application.

3 years agocommon taskScheduler: fix wrong thread indexing due to duplicated variable names.
Hermet Park [Mon, 7 Jun 2021 03:55:44 +0000 (12:55 +0900)]
common taskScheduler: fix wrong thread indexing due to duplicated variable names.

That mistake could invoke inproper threads....

3 years agosvg_loader: initializing uninitialized variables
Mira Grudzinska [Sun, 6 Jun 2021 22:14:37 +0000 (00:14 +0200)]
svg_loader: initializing uninitialized variables

The 'loader->svgParse->global' variable was uninitialized when no viewBox attribute
was set. If gradient was applied, the division by zero occured and no gradient was drawn.

3 years agobump up v0.2.0 76/259376/1 accepted/tizen/unified/20210607.124314 submit/tizen/20210607.034911
Hermet Park [Mon, 7 Jun 2021 03:26:38 +0000 (12:26 +0900)]
bump up v0.2.0

Change-Id: I93f0dc0796e714968a3bf43b829f4545aa6d685f

3 years agoinfra: just released v0.2.0
Hermet Park [Sun, 6 Jun 2021 08:36:48 +0000 (17:36 +0900)]
infra: just released v0.2.0

Change-Id: Ie86e9e31edd768fbc229344d8acd823cbad39c52

3 years agoinfra: set higher version to try the devel symbols with higher priority than released...
Hermet Park [Sun, 6 Jun 2021 08:12:41 +0000 (17:12 +0900)]
infra: set higher version to try the devel symbols with higher priority than released ones.

Change-Id: I77773874c509ed74ae07dbce588f9b39c2bb28db

3 years agocommon gradient: Fix possible crash in color setter
Michal Szczecinski [Fri, 4 Jun 2021 11:24:29 +0000 (13:24 +0200)]
common gradient: Fix possible crash in color setter

Memcpy is not allowed on nullptr. If colorStops is invalid colors are
cleared.

Change-Id: I3f6655a008a0ee7a0ce8abcb20c7692630b45282

3 years agocapi: include <stdint.h> into thorvg_capi.h
Michal Maciola [Fri, 4 Jun 2021 09:27:33 +0000 (11:27 +0200)]
capi: include <stdint.h> into thorvg_capi.h

Change-Id: Idcf75fdf8461895ae684e9241d40cb373c5b133f

3 years agoUpdate CONTRIBUTING.md
Hermet Park [Fri, 4 Jun 2021 08:46:04 +0000 (17:46 +0900)]
Update CONTRIBUTING.md

fix typos.

Change-Id: Ie31d4fb456fd116c41ec2a11ea81c6ccf1140cbd

3 years agoUpdate CONTRIBUTING.md
Hermet Park [Fri, 4 Jun 2021 08:43:04 +0000 (17:43 +0900)]
Update CONTRIBUTING.md

++ self-test & verification

Change-Id: Iee8406098b57670c02b723bf024876a2e946ba3a

3 years agocapi: add tvg_paint_get_transform() api.
Hermet Park [Thu, 3 Jun 2021 12:01:54 +0000 (21:01 +0900)]
capi: add tvg_paint_get_transform() api.

Change-Id: Iac271fc25e0ec409a17296c359a4a34c9bdb0e6e

3 years agotests: introduce catch2 unit tests infrastructure.
Hermet Park [Fri, 4 Jun 2021 07:46:34 +0000 (16:46 +0900)]
tests: introduce catch2 unit tests infrastructure.

Catch2 is a multi-paradigm test framework for C++.
It is primarily distributed as a single header file,
very easy and simple to adopt this to thorvg project.

This patch introduces catch2 infrastsructure and one prototype as a sample.

You can refer "testInitializer.cpp", how to add unit test!
while ignoring else files such as "catch2.hpp", "testMain.cpp"

Also, enable Unit-tests with meson option when you change any thorvg code.

$meson build -Dtests=true.

launch tvgUnitTest in the build result then verify 100% coverage
before submitting any patches.

Change-Id: Icc09d4402dc38c8a92a1cebb2cb502728c092f36

3 years agocommon initializer: correct the result value.
Hermet Park [Thu, 3 Jun 2021 11:48:02 +0000 (20:48 +0900)]
common initializer: correct the result value.

When memory is not allocated successully, it must return the FailedAllocation as the return value.
Previous initializer wrongly returns the value that case, this corrects it.

Change-Id: I244900ed9bce20c74a0ef5fce4e199b7ffa4e67a

3 years agoinfra: install capi header file only its binding option is enabled.
Hermet Park [Wed, 2 Jun 2021 11:27:05 +0000 (20:27 +0900)]
infra: install capi header file only its binding option is enabled.

decouple the capi header from the default headers by replacing it in capi folder.
now it's also installed optionally.

Change-Id: I11f6ebc238cfd1e4086026846560464aab44ec98

3 years agotest: remove gtest & its infra.
Hermet Park [Thu, 3 Jun 2021 04:54:54 +0000 (13:54 +0900)]
test: remove gtest & its infra.

thorvg is going to use catch2 framework, this is a cleanup work
before introducing catch2 utc.

See Catch2:
https://github.com/catchorg/Catch2/tree/v2.x

Change-Id: I78a0054d4307b4664353dd0e5376518f3861bb71

3 years agosw_engine rle: code refactoring.
Hermet Park [Thu, 3 Jun 2021 02:45:59 +0000 (11:45 +0900)]
sw_engine rle: code refactoring.

keep it neat code, --loc

Change-Id: I0125c712899a8bdf96e4fb0486683d04422cd63f

3 years agosw_engine: data optimization.
Hermet Park [Wed, 2 Jun 2021 12:15:58 +0000 (21:15 +0900)]
sw_engine: data optimization.

changed alpha channel data type to 32 bits from 8 bits,
since subsequent data operations requires 32 bits values.

this 8 bits (since channel range is up to 255) doesn't helpful
for saving memory size because it would generate additional data casting by compiler.

I compared the binary size and this patch saves about 600bytes.

Change-Id: Ieeab3a1361fe0a5c58be493d7b3ff70e1b801562

3 years agosw_engine common: improving the alpha blending algorithm
Mira Grudzinska [Wed, 2 Jun 2021 12:01:12 +0000 (14:01 +0200)]
sw_engine common: improving the alpha blending algorithm

Calculations accuracy in ALPHA_BLEND function has been
improved. Until now blending resulted in a slight hue change
(all color channels affected). The chosen method of calculation
is a compromise between the accuracy and the performance.

Change-Id: Ic4dad4c73ab74b6071b69c32f34394474ade6e5a

3 years agocapi: fix usage after this - 2c37191584b18a532cd01e7986fc5f53ebeea80d.
Hermet Park [Wed, 2 Jun 2021 11:14:10 +0000 (20:14 +0900)]
capi: fix usage after this - 2c37191584b18a532cd01e7986fc5f53ebeea80d.

Change-Id: Iaf6fdb2ab1afdbda0ba6599cadc20cb83d63f561

3 years agocommon: added API to get the transformation matrix of the object
Mira Grudzinska [Fri, 28 May 2021 01:32:00 +0000 (03:32 +0200)]
common: added API to get the transformation matrix of the object

Change-Id: Ia71ba62f44d342b4d353c7de9dc1377949ab914d

3 years agoapi: --inproper const syntax.
Hermet Park [Wed, 2 Jun 2021 07:38:21 +0000 (16:38 +0900)]
api: --inproper const syntax.

compoiste() requires internal data change, its api syntax should not contain "const"

though this changes the api spec, but won't affect build break
since it allows wider usage.

@API Modification

from:
Result Paint::composite(std::unique_ptr<Paint> target, CompositeMethod method) const noexcept

to:
Result Paint::composite(std::unique_ptr<Paint> target, CompositeMethod method) noexcept

Change-Id: Iece971c4635b0f636a066fa1292c59697cd24d46

3 years agodocs: -- beta tag. accepted/tizen/unified/20210602.122549 submit/tizen/20210601.080645 submit/tizen/20210601.084003
Hermet Park [Fri, 28 May 2021 07:22:54 +0000 (16:22 +0900)]
docs: -- beta tag.

Scene::clear() is ready to public.

Change-Id: Ice4dd6b22a1588fecba4e32f549daf6ba847bfa4

3 years agocommon: fix a potential memory leak after clear()
Hermet Park [Fri, 14 May 2021 11:19:03 +0000 (20:19 +0900)]
common: fix a potential memory leak after clear()

Paints must clear canvas engine data if they were dismissed from the canvas,

1. Canvas::clear(free = false) must retain all the paints from the paints hierarchy
so that user keeps the all dangled paints lifecycle.
In this scenario, it could leak the engine data of paints, this patch fixes it.

2. Previously, t just keeps the immediate paints lives of canvas, but not them of children of scene nor picture.
This patch changes a policy which was not considered seriously,
Now it keeps the all paints lives through the tree-hieararchy.

3. Also changed the Scene::clear() behavior identical to Canvas::clear() for consistency.

@API Modification:

Change-Id: I58708f7c759f48be30853364da87b70d63adbe22
From: Result Scene::clear() noexcept;
To: Result Scene::clear(bool free = true) noexcept;

3 years agosvg_loader: the viewBox clipping composite layer added independently of the shapes...
Mira Grudzinska [Thu, 27 May 2021 11:05:42 +0000 (13:05 +0200)]
svg_loader: the viewBox clipping composite layer added independently of the shapes bounds

For now the bounding box of all the shapes was established and if it was larger
than the viewBox of the SVG, the clipping layer was added. The bounds api
returns the rectangle that encloses the shapes before any transformations.
So comparing it with the viewBox doesn't make sense. The comparison is removed
and the clipping layer is always added.

Change-Id: Id007587362616e3d646b2ca8f4a17581c4eba74a

3 years agosw_engine renderer: fix aliasing problem.
Hermet Park [Fri, 28 May 2021 05:22:52 +0000 (14:22 +0900)]
sw_engine renderer: fix aliasing problem.

a corner case is detected that anti-aliasing is missing at shapes
if the shape has the dash-style stroke.

By adding the condition, it applies anti-aliasing properly.

@Issues: 394

Change-Id: Idc9ab48b3200643ce98abe3a10d67de09a9c74c7

3 years agoRevert "svg_loader: clipping composite layer is added independently on the bounds...
Mira Grudzinska [Fri, 28 May 2021 02:30:09 +0000 (04:30 +0200)]
Revert "svg_loader: clipping composite layer is added independently on the bounds of the shapes"

This reverts commit c38e4e40a7e0a573200e03ea57941a30f88b9939.
It was pushed by mistake. The same changes are currently under rev in PR #399

Change-Id: I7d0e3f473d4c0b185cd01ea782d8aeacb05b273f

3 years agosvg_loader: clipping composite layer is added independently on the bounds of the...
Mira Grudzinska [Thu, 27 May 2021 10:54:08 +0000 (12:54 +0200)]
svg_loader: clipping composite layer is added independently on the bounds of the shapes

Change-Id: Ia9fd2315d8e7ba9b335ca70bbc0015fed226a451

3 years agocommon Initializer: Fix init count
JunsuChoi [Thu, 27 May 2021 05:26:23 +0000 (14:26 +0900)]
common Initializer: Fix init count

Calling init repeatedly doesn't increment count.
This leads to unwanted termination due to mismatch of the pair.

3 years agocommon scene: fixing the initial values of variables in the bounds getter
Mira Grudzinska [Thu, 27 May 2021 00:49:10 +0000 (02:49 +0200)]
common scene: fixing the initial values of variables in the bounds getter

The values of the most bottom right corner of the scene bounding box
should be initialized with the biggest negative values.
Also an empty line removed.

3 years agosw_engine: refactoring of the radial gradient rle rastering function
Mira Grudzinska [Wed, 26 May 2021 00:54:15 +0000 (02:54 +0200)]
sw_engine: refactoring of the radial gradient rle rastering function

The translucent rastering function is split into 3 other (instead of if/else statement).
An additional function is introduced to decide which one of the 3 should be called.
This refactoring is done to preserve the convention used for all other rastering functs.

3 years agosw_engine: refactoring of the radial gradient rect rastering function
Mira Grudzinska [Wed, 26 May 2021 00:39:38 +0000 (02:39 +0200)]
sw_engine: refactoring of the radial gradient rect rastering function

The translucent rastering function is split into 3 other (instead of if/else statement).
An additional function is introduced to decide which one of the 3 should be called.
This refactoring is done to preserve the convention used for all other rastering functs.

3 years agosw_engine: refactoring of the linear gradient rect rastering function
Mira Grudzinska [Wed, 26 May 2021 00:10:32 +0000 (02:10 +0200)]
sw_engine: refactoring of the linear gradient rect rastering function

The translucent rastering function is split into 3 other (instead of if/else statement).
An additional function is introduced to decide which one of the 3 should be called.
This refactoring is done to preserve the convention used for all other rastering functs.

3 years agodocs: fixed relative thorvg image path to the absolute one.
Hermet Park [Tue, 25 May 2021 06:31:07 +0000 (15:31 +0900)]
docs: fixed relative thorvg image path to the absolute one.

3 years agoinfra Documentation: Update main page and remove treeview
JunsuChoi [Tue, 25 May 2021 05:44:35 +0000 (14:44 +0900)]
infra Documentation: Update main page and remove treeview

3 years agoinfra Documentation: Introduce ThorVG documentation page.
JunsuChoi [Tue, 25 May 2021 05:08:47 +0000 (14:08 +0900)]
infra Documentation: Introduce ThorVG documentation page.

This is a documentation page based on doxygen.

CSS: https://jothepro.github.io/doxygen-awesome-css/

3 years agosw_engine: refactoring the linear gradient rle rastering function
Mira Grudzinska [Mon, 24 May 2021 23:50:59 +0000 (01:50 +0200)]
sw_engine: refactoring the linear gradient rle rastering function

The translucent rastering function is split into 3 other (instead of if/else statement).
An additional function is introduced to decide which one of the 3 should be called.
This refactoring is done to preserve the convention used for all other rastering functs.

3 years agosw_engine: gradient shapes with opacity < 255 rastered properly
Mira Grudzinska [Tue, 18 May 2021 11:30:28 +0000 (13:30 +0200)]
sw_engine: gradient shapes with opacity < 255 rastered properly

The cases with gradient shapes with composition are handled
in the same function as gradint shapes with opacity < 255.
Parts of the code from _rasterOpaque... grad functions moved to
_rasterTranslucent... grad functions.

3 years agoUpdate README.md
Hermet Park [Sat, 22 May 2021 07:14:12 +0000 (16:14 +0900)]
Update README.md

Change-Id: I88f2fd48865176e00d7179b72039002c1cb04c1a

3 years agosw_engine rle: ++ precise alpha in anti-aliasing
Hermet Park [Fri, 21 May 2021 10:56:39 +0000 (19:56 +0900)]
sw_engine rle: ++ precise alpha in anti-aliasing

could loss 1 pixel since it divides 255 values by 256.

Change-Id: Ifee20d58ee55b58fd2c09932e2f4e21b55273da7

3 years agosw_engine: fixing wrong 'if else' statement handling when gradient shapes rastered
Mira Grudzinska [Tue, 18 May 2021 00:57:48 +0000 (02:57 +0200)]
sw_engine: fixing wrong 'if else' statement handling when gradient shapes rastered

The cases when composition was applied were handled only for AlphaMask and
InvAlphaMask. When opacity value was to be < 255, there was no code
to handle this.

Change-Id: If2f66230faa9b15ef9741461c92a64a279906d73

3 years agosw_engine: 'inv2a' variable from the SwRadial struct replaced by 'inva'
Mira Grudzinska [Mon, 17 May 2021 00:50:17 +0000 (02:50 +0200)]
sw_engine: 'inv2a' variable from the SwRadial struct replaced by 'inva'

This change reduces the number of multiplications in the fillFetchRadal function.

Change-Id: I84a8ff16ec8cd657ae48833f141c0554ca4829fc

3 years agores: remove icon
Hermet Park [Mon, 17 May 2021 04:58:52 +0000 (13:58 +0900)]
res: remove icon

Change-Id: Ie2cb5ca100208328a78338d680df85b75de9a2ac

3 years agoUpdate README.md
Hermet Park [Sun, 16 May 2021 14:59:02 +0000 (23:59 +0900)]
Update README.md

Change-Id: I84aa9a97504e3919178b6bcf3c349739b75449c7

3 years agoUpdate README.md
Hermet Park [Sat, 15 May 2021 14:14:52 +0000 (23:14 +0900)]
Update README.md

Change-Id: Ibe9f3738bce444884074775f2315172f1bb430d0

3 years agoUpdate README.md
Hermet Park [Sat, 15 May 2021 12:56:31 +0000 (21:56 +0900)]
Update README.md

Change-Id: I351664fa69342f4b6f6543effd0a5851e5e51041

3 years agoAdd files via upload
Hermet Park [Sat, 15 May 2021 11:19:34 +0000 (20:19 +0900)]
Add files via upload

Change-Id: I2350cc753c5e4d5a737ad8b6d2cc3c3cae1a04c9

3 years agoapi doc: replace beta api desc to beta tag
Hermet Park [Fri, 14 May 2021 10:49:28 +0000 (19:49 +0900)]
api doc: replace beta api desc to beta tag

Change-Id: I9b1c1cfe2a8ae53373dfc9bffe15c46daabb907a

3 years agolog SvgLoader: Enhance log message
JunsuChoi [Mon, 26 Apr 2021 06:25:45 +0000 (15:25 +0900)]
log SvgLoader: Enhance log message

- Change tag name "Doc" to "Svg"
- Fix "Mask" tag name.
- Add element to skip output
 - title
- Add attribute to skip output
 - id, data-name, version, overflow=visible, xmlns*, xml:space

Change-Id: I2d5900e46d810c243602cc93c35d25e1224e98d5

3 years agodoc: linguistic changes in C++ API docs
Mira Grudzinska [Sun, 2 May 2021 21:04:54 +0000 (23:04 +0200)]
doc: linguistic changes in C++ API docs

Change-Id: If465d27859480d73c8457c18d216111217e7c342

3 years agoUpdate README.md
Hermet Park [Thu, 13 May 2021 10:47:37 +0000 (19:47 +0900)]
Update README.md

Change-Id: I89687821eeba8f6aa7aae678c076399987d41614

3 years agoUpdate README.md
Hermet Park [Thu, 13 May 2021 10:41:17 +0000 (19:41 +0900)]
Update README.md

Change-Id: I039a1980f28a0aa294ea31eb5309355611c5206e

3 years agosw_engine: fix invalid data sharing at multi-threading.
Hermet Park [Fri, 7 May 2021 10:45:07 +0000 (19:45 +0900)]
sw_engine: fix invalid data sharing at multi-threading.

We have encountered that multi-threading usage that user creates,
multiple canvases owned by multiple user threads.

Current sw_engine memory pool has been considered only for multi-threads,
spawned by tvg task scheduler.

In this case it's safe but when user threads introduced, it can occur race-condition.

Thus, Here is a renewal policy that non-threading tvg(initialized threads with zero),
takes care of multiple user threads bu changing its policy,
each of canvases should have individual memory pool to guarantee mutual-exclusion.

@API additions

enum MempoolPolicy
{
    Default = 0, ///< Default behavior that ThorVG is designed to.
    Shareable,   ///< Memory Pool is shared among the SwCanvases.
    Individual   ///< Allocate designated memory pool that is only used by current instance.
};

Result SwCanvas::mempool(MempoolPolicy policy) noexcept;

All in all, if user calls multiple threads, set memory pool policy to Individual.

3 years agoinfra: remove PULL REQUEST TEMPLATE.
Hermet Park [Tue, 11 May 2021 13:12:14 +0000 (22:12 +0900)]
infra: remove PULL REQUEST TEMPLATE.

By far, this is not so useful since commit message template and PR is very simliar.

It just bring messing up the PR contents.

Rather than it, we don't allow violating commit message rules. So... its unnecessary.

See CONTRIBUTING.md

3 years agoUpdate CONTRIBUTING.md
Hermet Park [Tue, 11 May 2021 13:23:35 +0000 (22:23 +0900)]
Update CONTRIBUTING.md

3 years agocapi: added check against null pointer before dereferencing
Mira Grudzinska [Wed, 5 May 2021 23:57:20 +0000 (01:57 +0200)]
capi: added check against null pointer before dereferencing

TVG_RESULT_INVALID_ARGUMENT returned in case a nullptr passed as an argument
(does not apply to color getters).
The change is addressed in the docs file.

3 years agobump up v0.1.5 submit/tizen/20210510.051321
Hermet Park [Mon, 10 May 2021 05:05:12 +0000 (14:05 +0900)]
bump up v0.1.5

Change-Id: I7b22b76cfc6551077bd5e8eeb655844601dc8462

3 years agodocs: polishing up the C API docs
Mira Grudzinska [Sun, 2 May 2021 23:56:31 +0000 (01:56 +0200)]
docs: polishing up the C API docs

Change-Id: Ifd061b706147ef6e20f5717bf30e768979d0ab85

3 years agoUpdate README.md
Hermet Park [Mon, 3 May 2021 12:14:52 +0000 (21:14 +0900)]
Update README.md

3 years agoUpdate README.md
Hermet Park [Mon, 3 May 2021 10:25:30 +0000 (19:25 +0900)]
Update README.md

3 years agoloader SvgLoader: Fix memory leak
JunsuChoi [Mon, 3 May 2021 07:19:06 +0000 (16:19 +0900)]
loader SvgLoader: Fix memory leak

Add memory release for style->comp.url, which is the leaking memory.

[Valgrind Test Result]
==21595== 32 bytes in 1 blocks are definitely lost in loss record 29 of 152
==21595==    at 0x4C3217F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21595==    by 0x5C248C6: _idFromUrl(char const*) (tvgSvgLoader.cpp:272)
==21595==    by 0x5C24DE1: _handleClipPathAttr(SvgLoaderData*, SvgNode*, char const*) (tvgSvgLoader.cpp:860)
==21595==    by 0x5C260CC: _attrParseGNode(void*, char const*, char const*) (tvgSvgLoader.cpp:953)
==21595==    by 0x5C2ABA9: simpleXmlParseAttributes(char const*, unsigned int, bool (*)(void*, char const*, char const*), void const*) (tvgXmlParser.cpp:272)
==21595==    by 0x5C26F6E: _createGNode(SvgLoaderData*, SvgNode*, char const*, unsigned int) (tvgSvgLoader.cpp:1063)
==21595==    by 0x5C27A04: _svgLoaderParserXmlOpen(SvgLoaderData*, char const*, unsigned int, bool) (tvgSvgLoader.cpp:2168)
==21595==    by 0x5C27CE9: _svgLoaderParser(void*, SimpleXMLType, char const*, unsigned int) (tvgSvgLoader.cpp:2226)
==21595==    by 0x5C2AC8C: simpleXmlParse(char const*, unsigned int, bool, bool (*)(void*, SimpleXMLType, char const*, unsigned int), void const*) (tvgXmlParser.cpp:378)
==21595==    by 0x5C27E09: SvgLoader::run(unsigned int) (tvgSvgLoader.cpp:2571)
==21595==    by 0x5C1A7C1: operator() (tvgTaskScheduler.h:68)
==21595==    by 0x5C1A7C1: tvg::TaskSchedulerImpl::run(unsigned int) (tvgTaskScheduler.cpp:138)
==21595==    by 0x5EED6DE: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)

3 years agoUpdate README.md
Mira Grudzinska [Sun, 2 May 2021 19:43:33 +0000 (21:43 +0200)]
Update README.md

Fixed example and minor linguistic changes

3 years agoUpdate README.md
Hermet Park [Sat, 1 May 2021 15:19:14 +0000 (00:19 +0900)]
Update README.md

updated contents

3 years agoUpdate README.md
Hermet Park [Sat, 1 May 2021 14:50:07 +0000 (23:50 +0900)]
Update README.md

+ Practices: Tizen, Rive

3 years agoUpdate README.md
Hermet Park [Sat, 1 May 2021 05:58:30 +0000 (14:58 +0900)]
Update README.md