platform/core/graphics/tizenvg.git
15 months agoBump up 0.7.4 64/288964/1
jykeon [Mon, 27 Feb 2023 03:37:59 +0000 (12:37 +0900)]
Bump up 0.7.4

Change-Id: I6a39af13ee6a87994f697830e0f18d1bf2e8cc7f
Signed-off-by: jykeon <jykeon@samsung.com>
15 months agosvg_loader: memleak prevention 97/288897/1
Mira Grudzinska [Tue, 18 Jan 2022 17:13:28 +0000 (18:13 +0100)]
svg_loader: memleak prevention

If image href set more than once, the memory was not freed.

Change-Id: Iff8edacb94d4da93dfbd81c7505c535ea675d28c

15 months agosvg_loader: preventing memcpy from a nullptr 96/288896/1
Mira Grudzinska [Sun, 16 Jan 2022 23:14:29 +0000 (00:14 +0100)]
svg_loader: preventing memcpy from a nullptr

In a case when a polygon/polyline had no points, there is nothing
to be copied.

Change-Id: I6644c3984668d1a2f566bc755a0b47e2804d076e

15 months agosvg_loader: fixing cyclic cloning of nodes 95/288895/1
Mira Grudzinska [Sun, 16 Jan 2022 22:34:31 +0000 (23:34 +0100)]
svg_loader: fixing cyclic cloning of nodes

The reference node doesn't have to be placed inside the defs block,
so when refering to it, it is necessary to search the entire node tree.
In case of invalid svg file this can lead to circular references.
Added prevention against such a sutuation.

Change-Id: Ia572dfbe344939d25611d130b636c84a73ba213d

15 months agosvg_loader: fixing memleak 94/288894/1
Mira Grudzinska [Sat, 15 Jan 2022 16:10:24 +0000 (17:10 +0100)]
svg_loader: fixing memleak

Memory was not freed before reallocation (grad->ref can be overwritten
without freeing memory first) - fixed.

Change-Id: I0ab6c931fb29c680b96bbce27f4a6edfdf244104

15 months agosvg_loader: postponed nodes properly cloned 93/288893/1
Mira Grudzinska [Wed, 5 Jan 2022 15:49:43 +0000 (16:49 +0100)]
svg_loader: postponed nodes properly cloned

In case when no defs tag was used, no child node was found.
Also the node attributes should not override those set in the ancestor.

Change-Id: Iff14ce38a17a264bcb71b6a2a2be897e8837ca1f

15 months agoupdated copyright date. 92/288892/1
Hermet Park [Wed, 12 Jan 2022 05:08:48 +0000 (14:08 +0900)]
updated copyright date.

Change-Id: I00af27fbb4170f365bece9e5d2bc218c9a3de9cb

15 months agoBump up 0.7.3 74/288874/1 accepted/tizen/unified/20230227.152725
jykeon [Fri, 24 Feb 2023 02:58:33 +0000 (11:58 +0900)]
Bump up 0.7.3

Change-Id: I2cdb51b9c327911667d202986f1c36bef5d67e6b
Signed-off-by: jykeon <jykeon@samsung.com>
15 months agoMerge "svg_loader: changed the order of if conditions" into tizen
Chun [Fri, 24 Feb 2023 02:00:35 +0000 (02:00 +0000)]
Merge "svg_loader: changed the order of if conditions" into tizen

15 months agoMerge "svg_loader: the color attribute properly inherited" into tizen
Chun [Fri, 24 Feb 2023 02:00:20 +0000 (02:00 +0000)]
Merge "svg_loader: the color attribute properly inherited" into tizen

15 months agoMerge "svg_loader: removing repeated lines" into tizen
Chun [Fri, 24 Feb 2023 02:00:04 +0000 (02:00 +0000)]
Merge "svg_loader: removing repeated lines" into tizen

15 months agoMerge "svg_loader: fix grad update" into tizen
Chun [Fri, 24 Feb 2023 01:59:48 +0000 (01:59 +0000)]
Merge "svg_loader: fix grad update" into tizen

15 months agosvg_loader: changed the order of if conditions 24/288824/1
Mira Grudzinska [Sun, 9 Jan 2022 16:44:24 +0000 (17:44 +0100)]
svg_loader: changed the order of if conditions

The weekest condition should be checked as the last one.
Otherwise CDATA marker was never found.

Change-Id: I42cbbe867484cb88b156e182c0452a8cb59cc53d

15 months agosvg_loader: the color attribute properly inherited 23/288823/1
Mira Grudzinska [Fri, 7 Jan 2022 21:42:00 +0000 (22:42 +0100)]
svg_loader: the color attribute properly inherited

The color attribute hat to be inherited regardles whether it is used
in the child node or not - it may be used i.e. in the grandchild node.

Change-Id: If2895ec64c9ed7f7e176cb32cb4adc8a61f63551

15 months agosvg_loader: removing repeated lines 22/288822/1
Mira Grudzinska [Sat, 8 Jan 2022 22:55:55 +0000 (23:55 +0100)]
svg_loader: removing repeated lines

The clip-path and the mask attributes are both parsed in _attrParseGNode
function, which is called in th _attrParseUseNode.

Change-Id: Ibef6256e25d63d52571949ead21241e3e4346bef

15 months agosvg_loader: fix grad update 21/288821/1
Mira Grudzinska [Fri, 7 Jan 2022 21:54:46 +0000 (22:54 +0100)]
svg_loader: fix grad update

The grad update should be handled after the postponed nodes are cloned.

Change-Id: I7391d416a81a9cb465ea9a01f5360c126abc53a2

15 months agoBump up 0.7.2 19/288819/1
jykeon [Thu, 23 Feb 2023 09:22:14 +0000 (18:22 +0900)]
Bump up 0.7.2

Change-Id: I0d11c0712aa2e1c85ff8e0cb8a10feaf0fb2b64b
Signed-off-by: jykeon <jykeon@samsung.com>
15 months agoMerge "svg_loader: preventing memory leak" into tizen
Chun [Thu, 23 Feb 2023 09:08:53 +0000 (09:08 +0000)]
Merge "svg_loader: preventing memory leak" into tizen

15 months agoMerge "svg_loader: LumaMask used only for masks other than white" into tizen
Chun [Thu, 23 Feb 2023 09:08:45 +0000 (09:08 +0000)]
Merge "svg_loader: LumaMask used only for masks other than white" into tizen

15 months agoMerge "svg_loader: typo fixed" into tizen
Chun [Thu, 23 Feb 2023 09:08:33 +0000 (09:08 +0000)]
Merge "svg_loader: typo fixed" into tizen

15 months agoMerge "svg_loader: mask-type attribute introduced" into tizen
Chun [Thu, 23 Feb 2023 09:08:26 +0000 (09:08 +0000)]
Merge "svg_loader: mask-type attribute introduced" into tizen

15 months agoMerge "svg_loader: ++robustness" into tizen
Chun [Thu, 23 Feb 2023 09:08:20 +0000 (09:08 +0000)]
Merge "svg_loader: ++robustness" into tizen

15 months agosvg_loader: preventing memory leak 17/288817/1
Mira Grudzinska [Sat, 8 Jan 2022 22:47:38 +0000 (23:47 +0100)]
svg_loader: preventing memory leak

A memory leak occured when the 'id' attribute was given multiple times
for a given gradient element. Fixed.

Change-Id: I386565d016c23172dc6b2628ef0f0c158a461417

15 months agosvg_loader: LumaMask used only for masks other than white 16/288816/1
Mira Grudzinska [Sat, 8 Jan 2022 01:17:44 +0000 (02:17 +0100)]
svg_loader: LumaMask used only for masks other than white

For the performance reasons, the LumaMask is used only when
it's necessary - when the mask color is other than white.
Otherwise the AlphaMask is enough.

Change-Id: Ia97fb753854435e2e58eeb1ead40dbb3a5ead7cc

15 months agosvg_loader: typo fixed 15/288815/1
Mira Grudzinska [Fri, 7 Jan 2022 23:31:32 +0000 (00:31 +0100)]
svg_loader: typo fixed

_svgLoaderParerXmlClose -> _svgLoaderParserXmlClose

Change-Id: I24a3fc61e52c74507dc6dd62ddda63f97ed3d05f

15 months agosvg_loader: mask-type attribute introduced 14/288814/1
Mira Grudzinska [Sun, 2 Jan 2022 01:23:11 +0000 (02:23 +0100)]
svg_loader: mask-type attribute introduced

In an svg file the mask-type attribute can be specified.
It takes one of the two values: Luminosity or Alpha.
After the LumaMask is introduced into TVG, this attribute can be
properly read by the svg loader.

Change-Id: I8de1c94aed6bc0e7b31c1026b57f3336f29c2e30

15 months agosvg_loader: ++robustness 13/288813/1
Hermet Park [Thu, 6 Jan 2022 03:40:52 +0000 (12:40 +0900)]
svg_loader: ++robustness

prevent a crash with an exceptional handling.

@Issue: https://github.com/Samsung/thorvg/issues/1131

Change-Id: If45a5ae201165ba97f087cdeb8c6e35d97adca72

15 months agoBump up 0.7.1 10/288810/1
jykeon [Thu, 23 Feb 2023 08:41:58 +0000 (17:41 +0900)]
Bump up 0.7.1

Change-Id: I3410b3abbbebcb42a71a8c24bf392001da65290f
Signed-off-by: jykeon <jykeon@samsung.com>
15 months agosw_engine raster: fix a regression bug. 08/288808/1
Hermet Park [Thu, 6 Jan 2022 03:32:16 +0000 (12:32 +0900)]
sw_engine raster: fix a regression bug.

Picture example were broken by 90fa26b7bb75cb938290170882e65da8d9fc5d9e

the correct condition must be like this change.

Change-Id: Ib3119a832118221c115cbc6ba9cf5f96ab7625b4

15 months agosw_engine SwRaster: Initialize uninitialized transform value 07/288807/1
JunsuChoi [Wed, 5 Jan 2022 01:42:41 +0000 (17:42 -0800)]
sw_engine SwRaster: Initialize uninitialized transform value

Change-Id: I12e6a63cebbd765c19e83194587722a19db06fa2

15 months agosvg_loader: composite node splitted on mask and clip nodes 03/288803/1
Mira Grudzinska [Fri, 31 Dec 2021 11:00:15 +0000 (12:00 +0100)]
svg_loader: composite node splitted on mask and clip nodes

The SvgCompositeNode is replaced by the SvgMaskNode and SvgClipNode.
This is needed for using Luma/AlphaMask in the svg loader and in the future,
when we introduce other mask's features.

Change-Id: Ieb90615da7dedcabe296950af20b59ac5d81e6ba

15 months agoexample: added LumaMasking.cpp (#621) 02/288802/1
Michal Maciola [Thu, 30 Dec 2021 14:56:25 +0000 (15:56 +0100)]
example: added LumaMasking.cpp (#621)

Added an example LumaMasking.cpp that tests CompositeMethod::LumaMask

Change-Id: I30d6fde4a209b8a818ad2240025832f44b8d4f84

15 months agocompositeMethod: introduced LumaMask 01/288801/1
Michal Maciola [Thu, 30 Dec 2021 08:28:27 +0000 (09:28 +0100)]
compositeMethod: introduced LumaMask

Introduced CompositeMethod::LumaMask that converts the source pixels to the
grayscale (luma value) before alpha blending. Thanks to it, mask works more like
typical mask in graphics editor software.
Grayscale is calculated with  weighted method:
(0.0721*B + 0.7154*G + 0.2125*R) * A
Introduced surface->blender.lumaValue function

Change-Id: Ia0258e2f374aa27acaef9b2f4161af5b04400422

15 months agoBump up 0.7.0 78/288778/1 accepted/tizen/unified/20230223.162152
jykeon [Thu, 23 Feb 2023 01:30:44 +0000 (10:30 +0900)]
Bump up 0.7.0

Change-Id: I94c0b425e13a8fae232d1ba9c63cd012ebda157c
Signed-off-by: jykeon <jykeon@samsung.com>
15 months agocommon: Introduced Accessor for traversing the scene-tree. 65/288765/1
Hermet Park [Thu, 23 Dec 2021 02:34:31 +0000 (11:34 +0900)]
common: Introduced Accessor for traversing the scene-tree.

Basically, this Accessor is a utility to debug the Scene structure,
by traversing the scene-tree by users.

You can search specific nodes to read the property information,
figure out the structure of the scene tree and its size.

We actually don't recommend you to touch the property unless you really
know the each paint's position and role because it's not visible, difficult to
understand its anatomy.

Also, You must underatnd that modifying the nodes of the scene will be going
well with both the art-design structure and the prorgram logic.

In this first version, Accessor only supports for the Picture class.

@example:

auto picture = tvg::Picture::gen();
picture->load("test.svg");

//The callback function from lambda expression.
//This function will be called for every paint nodes of the tree.
auto f = [](const tvg::Paint* paint) -> bool
{
    if (paint->identifier() == Shape::identifier()) {
        //override properties?
        uint8_t r, g, b, a;
        paint->fillColor(&r, &g, &b, &a);
        paint->fill(r / 2, g / 2, b / 2, a);
    }

    //You can return false, to stop traversing immediately.
    return true;
};

auto accessor = tvg::Accessor::gen();

picture = accessor->access(move(picture), f);

...

@Issue: https://github.com/Samsung/thorvg/issues/693

Change-Id: I4f46754de46dfab9bb5b14f58cc659237344822a

15 months agoRevert "common: introduce iterator" 64/288764/1
Hermet Park [Thu, 23 Dec 2021 02:29:58 +0000 (11:29 +0900)]
Revert "common: introduce iterator"

This reverts commit e947fef9a4170b601cb92b868ae71dfd675a9173.

Bad... This patch was wrongly applied...

Change-Id: I5af1b3755ff5a0b44028fc664d8fd8c80c3ed3cd

15 months agosw_engine texmap: fix trivial compiler warnings. 63/288763/1
Hermet Park [Thu, 23 Dec 2021 01:40:09 +0000 (10:40 +0900)]
sw_engine texmap: fix trivial compiler warnings.

Change-Id: I3649d84e83c257df6d51429c52a88a1fc9d6fdd1
warning: suggest braces around initialization of subobject [-Wmissing-braces]

15 months agosw_engine texmap: ++safety 62/288762/1
Hermet Park [Wed, 22 Dec 2021 07:40:27 +0000 (16:40 +0900)]
sw_engine texmap: ++safety

Prevent range over just in case.

Change-Id: I27ed449d1292bc8e191d0a6fb751ab27ea3ee125

15 months agoHide the thorvg LZW implementation. 61/288761/1
K. S. Ernest (iFire) Lee [Sat, 18 Dec 2021 00:04:26 +0000 (16:04 -0800)]
Hide the thorvg LZW implementation.

Change-Id: I9fc4049b0d3dd04f22e6327d44c71d663096e366

15 months agosw_engine raster: fix a crash at the texmap clipping. 60/288760/1
Hermet Park [Fri, 17 Dec 2021 08:23:55 +0000 (17:23 +0900)]
sw_engine raster: fix a crash at the texmap clipping.

Handle correctly duplicated spans from the multiple y span data.

Previous logic only expected the one single y span data from the rle.
However rle might have multiple y span data if the anti-aliasing is applied.

This patch also removed the bad design of the common engine
which handles the anti-alising option to ignore the anti-aliasing rle generation.

Just realized, it's difficult to control that condition due to scene-composition.

Change-Id: I0caab0e22b0bb88bf0c7ed25b58229c216579086

15 months agosw_engine raster: ++safety of the scaled image rasterization 92/288392/1 accepted/tizen/unified/20230220.174433
Hermet Park [Fri, 17 Dec 2021 03:43:49 +0000 (12:43 +0900)]
sw_engine raster: ++safety of the scaled image rasterization

Prevent out of buffer boundary access.

@Issues: https://github.com/Samsung/thorvg/pull/1119

Change-Id: I9d007b00f4193448fe2fd05194621190144ad7ce

15 months agocommon: introduce iterator 91/288391/1
Hermet Park [Fri, 22 Oct 2021 12:04:15 +0000 (21:04 +0900)]
common: introduce iterator

+++

auto picture = tvg::Picture::gen();

auto func = [](const tvg::Paint* paint, const tvg::Paint* parent, bool hasChildren) -> int
{
    if (paint->identifier() == Shape::identifier())
        //TODO: override properties.

    //return true to continue, return false to stop.
    return true;
};

picture = tvg::Iteratorv::iterate(move(picture), func);

Change-Id: I2ea956cb46b20547239686969c2e403e23fc8943

15 months agocapi: missing arg description added 84/288384/1
Mira Grudzinska [Thu, 16 Dec 2021 19:13:36 +0000 (20:13 +0100)]
capi: missing arg description added

Change-Id: If9b6a81ac27a0f7f7b52f791e0c6205bf014d9df

15 months agosw_engine texmap: implemented fast span-edge anti-aliasing 83/288383/1
Hermet Park [Tue, 14 Dec 2021 10:26:58 +0000 (19:26 +0900)]
sw_engine texmap: implemented fast span-edge anti-aliasing

This Anti-Aliasing mechanism is originated from Hermet Park's idea.
To understand this AA logic, you can refer this page:
www.hermet.pe.kr/122 (hermetpark@gmail.com)

@Issue: https://github.com/Samsung/thorvg/issues/161

Change-Id: Ibf9a3d14057a781e09e4ae3d72393aa522a2c71b

15 months agosw_engine raster: improve the transformed rle image rasterizer. 76/288376/1
Hermet Park [Fri, 26 Nov 2021 03:10:23 +0000 (12:10 +0900)]
sw_engine raster: improve the transformed rle image rasterizer.

replace the transformed rle rgba image with the texmap raster.

this patch removes the several scattered transformed image rasterizer,
reuse the unified one texmap method instead.

yay, it's much clean and optimal.

Change-Id: Ie5c1a99b28c5242639618e1f4e41f8912c443b4c

18 months agoRevert "svg_loader: the preserveAspectRatio attrib handled" 22/284222/1 accepted/tizen/unified/20221115.022418
Chun [Mon, 14 Nov 2022 01:23:09 +0000 (01:23 +0000)]
Revert "svg_loader: the preserveAspectRatio attrib handled"

This reverts commit 2111930048843b2373907f4e9813f97a3b2d6206.

Change-Id: I608f73c16e8bb9c6caf2a3fb40254e6eca056dcf

20 months agosvg_loader: the preserveAspectRatio attrib handled 35/280035/3 accepted/tizen/unified/20221102.020531
Mira Grudzinska [Mon, 22 Aug 2022 13:53:37 +0000 (15:53 +0200)]
svg_loader: the preserveAspectRatio attrib handled

The preserveAspectRatio attribute handled according
to the svg standard.

Change-Id: Ie7292ba47341994cf703b3634016c267292a22d2

2 years agobump up 0.6.7 23/269623/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.060625 accepted/tizen/7.0/unified/hotfix/20221116.105313 accepted/tizen/unified/20220120.154521 submit/tizen/20220119.090139 tizen_7.0_m2_release
jykeon [Wed, 19 Jan 2022 08:16:29 +0000 (17:16 +0900)]
bump up 0.6.7

Change-Id: Ib07f04d7c74b5f3be2ec6aaf6b76e3a88f2dbe2f
Signed-off-by: jykeon <jykeon@samsung.com>
2 years agosw_engine: fix comparison of integer expressions of different signedness 13/269613/1
Michal Maciola [Fri, 14 Jan 2022 13:19:55 +0000 (14:19 +0100)]
sw_engine: fix comparison of integer expressions of different signedness

Some gcc versions and configurations was giving an error:
error: "comparison of integer expressions of different signedness: 'const SwCoord'
{aka 'const long int'} and 'uint32_t' {aka 'unsigned int'} [-Werror=sign-compare]"
This patch should fix the error

Change-Id: Ie683f35220b130b3548d0059ffe130fa4fc53fdc

2 years agosw_engine: fixed declaration of 'i' shadows a previous local 12/269612/1
Michal Maciola [Fri, 14 Jan 2022 13:06:39 +0000 (14:06 +0100)]
sw_engine: fixed declaration of 'i' shadows a previous local

Some gcc versions and configurations was giving an error: error:
"declaration of 'i' shadows a previous local"
This patch should fix these errors

Change-Id: Ic33bc0095a7ddfd78dd530a7dd4712c000ddd2eb

2 years agobump up 0.6.6 32/269032/1 accepted/tizen/unified/20220110.135939 submit/tizen/20220107.014900
jykeon [Fri, 7 Jan 2022 01:41:57 +0000 (10:41 +0900)]
bump up 0.6.6

Change-Id: I1106ae0d6d5623ca397232964f06bc99aeaadd42
Signed-off-by: jykeon <jykeon@samsung.com>
2 years agosw_engine raster: fix a regression bug. 06/269006/1
Hermet Park [Thu, 6 Jan 2022 03:32:16 +0000 (12:32 +0900)]
sw_engine raster: fix a regression bug.

Picture example were broken by 90fa26b7bb75cb938290170882e65da8d9fc5d9e

the correct condition must be like this change.

Change-Id: Ie3af07bca9d44872073b111874c60575fa4b38f4

2 years agosw_engine SwRaster: Initialize uninitialized transform value 62/268962/1
JunsuChoi [Wed, 5 Jan 2022 01:42:41 +0000 (17:42 -0800)]
sw_engine SwRaster: Initialize uninitialized transform value

Change-Id: I7aac462c6d6e481655c35a10b237970de7dbea76

2 years agobump up 0.6.5 58/268558/1 accepted/tizen/unified/20211228.140411 submit/tizen/20211227.014922 submit/tizen/20211227.021527 submit/tizen/20211227.054708
jykeon [Mon, 27 Dec 2021 01:36:22 +0000 (10:36 +0900)]
bump up 0.6.5

Change-Id: I8431f13558ce30db255650ab2f52f794729e7c57
Signed-off-by: jykeon <jykeon@samsung.com>
2 years agocapi: rename tvg_paint_get_bounds 70/268370/2
JunsuChoi [Wed, 22 Dec 2021 02:30:51 +0000 (18:30 -0800)]
capi: rename tvg_paint_get_bounds

Apply the changed code of 9db4a49

Change-Id: I101ec1b5ac3876a0cba76f4da97e953d0894e8f0

2 years agosw_engine SwShape: Fix coding style
JunsuChoi [Wed, 15 Dec 2021 04:29:01 +0000 (20:29 -0800)]
sw_engine SwShape: Fix coding style

2 years agosw_engine SwShape: Prevent null access
JunsuChoi [Wed, 15 Dec 2021 04:19:14 +0000 (20:19 -0800)]
sw_engine SwShape: Prevent null access

strokeOutline returned strokeExportOutline() is the address of mpool->strokeOutline[idx].
Assuming this value is null, mpoolRetStrokeOutline on line 617 will access mpool->strokeOutline[idx].
Logically, the logic of the mpool* functions does not occur in this case.

2 years agopng_loaders: fix the wrong premultiplying operations.
Hermet Park [Tue, 14 Dec 2021 07:33:17 +0000 (16:33 +0900)]
png_loaders: fix the wrong premultiplying operations.

It should not modify the alpha channel value while premultiplying
that turned out with the wrong visual result.

@Issue: https://github.com/Samsung/thorvg/issues/655

2 years agocommon paint: code refactoring
Hermet Park [Mon, 13 Dec 2021 11:34:43 +0000 (20:34 +0900)]
common paint: code refactoring

Grouping the composite data to add source paint necessarily.

this refactoring is a prerequisite job for the texmap anti-aliasing.

2 years agocommon picture: remove unused variable.
Hermet Park [Mon, 13 Dec 2021 10:26:56 +0000 (19:26 +0900)]
common picture: remove unused variable.

2 years agocommon: revise the identifier() implementation
Hermet Park [Mon, 13 Dec 2021 09:56:25 +0000 (18:56 +0900)]
common: revise the identifier() implementation

Migrate the id property to the base class internals
so that pimpl classes could access the data easier.

This is a sort of prerequisite change for the coming texmap anti-aliasing.

2 years agobump up version 0.6.4 85/267985/1 accepted/tizen/unified/20211215.125638 submit/tizen/20211214.073142
jykeon [Tue, 14 Dec 2021 07:09:26 +0000 (16:09 +0900)]
bump up version 0.6.4

Change-Id: I2f1e645ab71d37430503341c4b16d32e053331f1
Signed-off-by: jykeon <jykeon@samsung.com>
2 years agocapi: removed tizen only code. 72/267472/2
Hermet Park [Mon, 6 Dec 2021 04:37:10 +0000 (13:37 +0900)]
capi: removed tizen only code.

These APIs have been removed in thorvg,
Nowhere used in tizen anymore.

Change-Id: I21940cdc982e226d4f8e2e6fdc1487ec3a434bbd

2 years agosw_engine image: support non-premultiplied alpha images.
Hermet Park [Wed, 1 Dec 2021 05:16:01 +0000 (14:16 +0900)]
sw_engine image: support non-premultiplied alpha images.

Previously, translucent png images are not displayed properly
due to alpha channels premultiplication.

This patch implements that missing part to support it properly
by introducing the Surface data between canvas engine & rasterizer

@Issue: https://github.com/Samsung/thorvg/issues/655

Change-Id: I42d2b8d6854517f61cdc0eaf3ae105a426e0c61b

2 years agosw_engine raster: remove unnecessary functions.
Hermet Park [Wed, 1 Dec 2021 05:31:04 +0000 (14:31 +0900)]
sw_engine raster: remove unnecessary functions.

These alpha/inverse alpha blender table is not useful so far,
we remove them since it just decrease the performance by by-pass addressing.

2 years agosw_engine SwCommon: Change spans's x,y value type
JunsuChoi [Wed, 1 Dec 2021 06:07:54 +0000 (15:07 +0900)]
sw_engine SwCommon: Change spans's x,y value type

The x and y of spans cannot be negative
because they are specified as coordinates inside the buffer.
Change the type to fix warnings and potential problems
that occur in conversion between int16_t and uint32_t.

2 years agosw_engine SWRaster: Explicitly declare type cast to uint32_t
JunsuChoi [Tue, 30 Nov 2021 06:31:12 +0000 (15:31 +0900)]
sw_engine SWRaster: Explicitly declare type cast to uint32_t

2 years agosw_engine SWRaster: Initialize uninitialized local variable
JunsuChoi [Tue, 30 Nov 2021 03:56:46 +0000 (12:56 +0900)]
sw_engine SWRaster: Initialize uninitialized local variable

2 years agobump up version 0.6.3 27/267227/1 accepted/tizen/unified/20211201.123208 submit/tizen/20211130.051541
jykeon [Tue, 30 Nov 2021 04:40:01 +0000 (13:40 +0900)]
bump up version 0.6.3

Change-Id: I7ee8ad468f02ac8b69ce3baf0d7918a5b9e6879a
Signed-off-by: jykeon <jykeon@samsung.com>
2 years agosw_engine raster: fix the regression bug of the image simple scaling rendering.
Hermet Park [Mon, 29 Nov 2021 02:38:29 +0000 (11:38 +0900)]
sw_engine raster: fix the regression bug of the image simple scaling rendering.

Gave up the optimization this logic.

It brings too many digressed code, not good for maintenance...

Change-Id: I6adafcba58e58b0f6d389159a92b7dfd2ea68444

2 years agosw_engine texmap: remove unnecessary conditions.
Hermet Park [Fri, 26 Nov 2021 11:05:48 +0000 (20:05 +0900)]
sw_engine texmap: remove unnecessary conditions.

remove exceptional handling for the performance.

2 years agosvg_loader: a function to establish shapes boundries without a stroke introduced
Mira Grudzinska [Wed, 24 Nov 2021 22:07:35 +0000 (23:07 +0100)]
svg_loader: a function to establish shapes boundries without a stroke introduced

To handle the objectBoundingBox units, the shape's boundaries have to be known.
According to the SVG standard, a stroke shouldn't be taken into account. Since
the bounds() api uses the shape's stroke information, a new function is introduced,
that compensates this and returns boundaries without any strokes.

2 years agosvg_loader: struct used to pass 1 args instead of 4 of them
Mira Grudzinska [Wed, 24 Nov 2021 20:57:40 +0000 (21:57 +0100)]
svg_loader: struct used to pass 1 args instead of 4 of them

The Box struct is introduced to replace the four functions
args: vx, vy, vw, vh, so all of them can be passed at once.

2 years agosw_engine raster: fix the texmap regression bug.
Hermet Park [Fri, 26 Nov 2021 08:14:44 +0000 (17:14 +0900)]
sw_engine raster: fix the texmap regression bug.

Wrong inline function with C-preprocessing doesn't work at all...
Correct them with including the separate files instead.

2 years agoRevert "sw_engine raster: code refactoring."
Hermet Park [Fri, 26 Nov 2021 08:21:27 +0000 (17:21 +0900)]
Revert "sw_engine raster: code refactoring."

This reverts commit 860068301a7992f375a74a1f6b95e96e3bb3eb80.

found a regression bug. this macro doesn't work actually.

Change-Id: Id3c734ed8bae10451227ecf172c4e47bc06b6753

2 years agosw_engine: code refactoring
Hermet Park [Thu, 25 Nov 2021 08:25:25 +0000 (17:25 +0900)]
sw_engine: code refactoring

unified the two color interpolate methods.

Change-Id: I7ff67af280fa78b11d3b083aec790ac043387b1a

2 years agosw_engine texmap: code refactoring.
Hermet Park [Thu, 25 Nov 2021 09:31:00 +0000 (18:31 +0900)]
sw_engine texmap: code refactoring.

Unrolled the blending stages by applying macro magics.

I know this is a bit bad for code readibility
but good for the performance and the optimal LOC.

2 years agosw_engine texmap: introduced texture mapping polygon drawing.
Hermet Park [Thu, 18 Nov 2021 02:03:29 +0000 (11:03 +0900)]
sw_engine texmap: introduced texture mapping polygon drawing.

Introduced the texture-mapping algorithm for the image-scaler.
With this approach, we can support any arbitrary forms of the transformed shapes
while appling the scale factors - x/y separately.

Also this is more efficient when the transformed image is far from the rectangular form
because our current normal image rasterizer based on the given drawing region whereas
our new approach is span-based.

Thus, we applied this mechanism only for the transformed images.

2 years agosw_engien renderer: ++safety
Hermet Park [Thu, 25 Nov 2021 06:04:56 +0000 (15:04 +0900)]
sw_engien renderer: ++safety

+exceptional handling for the drawing region.

2 years agosw_engine raster: fix a regression bug.
Hermet Park [Thu, 25 Nov 2021 05:48:16 +0000 (14:48 +0900)]
sw_engine raster: fix a regression bug.

mistaken by 8ef31f6cd031b1369ec52e18cc0c97b6efaca6ab

2 years agosw_engine raster: fix compiler warnings.
Hermet Park [Thu, 25 Nov 2021 02:47:26 +0000 (11:47 +0900)]
sw_engine raster: fix compiler warnings.

popped up unused-functions when simd enabled.

2 years agobump up version 0.6.2 61/267061/1 accepted/tizen/unified/20211126.111840 submit/tizen/20211125.020113
jykeon [Thu, 25 Nov 2021 01:13:51 +0000 (10:13 +0900)]
bump up version 0.6.2

Change-Id: I3f732e458c85133e3b5d17bd2ca19b5f5cf17254
Signed-off-by: jykeon <jykeon@samsung.com>
2 years agosw_engine raster: fix a mistake by the previous hot refactoring.
Hermet Park [Wed, 24 Nov 2021 11:51:05 +0000 (20:51 +0900)]
sw_engine raster: fix a mistake by the previous hot refactoring.

2 years agosw_engine raster: code refactoring
Hermet Park [Wed, 24 Nov 2021 11:25:47 +0000 (20:25 +0900)]
sw_engine raster: code refactoring

+neat and clean code

2 years agosw_engine image: improvement sequeqnce of the transformed rle rgba image drawing.
Hermet Park [Wed, 24 Nov 2021 10:26:10 +0000 (19:26 +0900)]
sw_engine image: improvement sequeqnce of the transformed rle rgba image drawing.

implement composition by translucent / opaque.

yet this transformed rle rgba image drawing is on the enhancement stage.

2 years agosw_engine image: complete sequeqnce of the scaled rgba rle image drawing.
Hermet Park [Wed, 24 Nov 2021 10:02:07 +0000 (19:02 +0900)]
sw_engine image: complete sequeqnce of the scaled rgba rle image drawing.

implement composition by translucent / opaque

2 years agosw_engine image: improvement sequeqnce of the direct rgba rle image drawing.
Hermet Park [Wed, 24 Nov 2021 09:47:30 +0000 (18:47 +0900)]
sw_engine image: improvement sequeqnce of the direct rgba rle image drawing.

implement composition by translucent / opaque.

+ correct compositor stride reference.

2 years agosw_engine image: improvement sequeqnce of the transformed rgba image drawing.
Hermet Park [Wed, 24 Nov 2021 09:28:13 +0000 (18:28 +0900)]
sw_engine image: improvement sequeqnce of the transformed rgba image drawing.

implement composition by translucent / opaque.

yet this transformed rgba image drawing is on the enhancement stage.

2 years agosw_engine image: complete sequeqnce of the scaled rgb image drawing.
Hermet Park [Wed, 24 Nov 2021 08:47:27 +0000 (17:47 +0900)]
sw_engine image: complete sequeqnce of the scaled rgb image drawing.

implement composition by translucent / opaque.

2 years agosw_engine image: complete sequeqnce of the direct rgb image drawing.
Hermet Park [Wed, 24 Nov 2021 08:29:39 +0000 (17:29 +0900)]
sw_engine image: complete sequeqnce of the direct rgb image drawing.

implement composition by translucent / opaque.

2 years agosw_engine image: refactoring before further development.
Hermet Park [Wed, 24 Nov 2021 06:48:47 +0000 (15:48 +0900)]
sw_engine image: refactoring before further development.

separate internal functions per context
and keep the coding convention.

2 years agoUpdate CONTRIBUTING.md
Hermet Park [Wed, 24 Nov 2021 06:58:49 +0000 (15:58 +0900)]
Update CONTRIBUTING.md

2 years agosw_engine image: support separate logics for scaled rle rgba image
Hermet Park [Tue, 23 Nov 2021 09:29:00 +0000 (18:29 +0900)]
sw_engine image: support separate logics for scaled rle rgba image

+ scaled rle rgba image
+ scaled masked rle rgba image
+ scaled translucent rle rga image

2 years agocommon: nothing was rendered after an empty masked node came across
Mira Grudzinska [Tue, 23 Nov 2021 18:56:35 +0000 (19:56 +0100)]
common: nothing was rendered after an empty masked node came across

The problem was observed for empty masked scenes (except the fastTrack
cases). Solved by imimediate returning from the func without passing 'false'
as its result.

2 years agoexamples: replaced png resource to verify alpha channel.
Hermet Park [Tue, 23 Nov 2021 07:16:09 +0000 (16:16 +0900)]
examples: replaced png resource to verify alpha channel.

alpha blending looks a bit awkward.. need to fix it.

2 years agosw_engine image: apply rgba blending.
Hermet Park [Tue, 23 Nov 2021 06:19:50 +0000 (15:19 +0900)]
sw_engine image: apply rgba blending.

rgba requires the default blending.

2 years agoinfra stylebot: Delete existing comments
JunsuChoi [Tue, 23 Nov 2021 05:06:41 +0000 (14:06 +0900)]
infra stylebot: Delete existing comments

In order to avoid duplication of the already created comment,
already created results will be deleted.

2 years agosw_engine image: code refactoring
Hermet Park [Tue, 23 Nov 2021 03:14:31 +0000 (12:14 +0900)]
sw_engine image: code refactoring

Clarify image sequences by renaming & adding TODO comments.

2 years agosw_engine image: introduced scaled image raster logics.
Hermet Park [Fri, 19 Nov 2021 04:46:25 +0000 (13:46 +0900)]
sw_engine image: introduced scaled image raster logics.

These raster functions are accelerated only for the scaled images.
(no rotation, skrewed)

2 years agoexamples: remove boundary samples.
Hermet Park [Mon, 22 Nov 2021 08:40:06 +0000 (17:40 +0900)]
examples: remove boundary samples.

Removed these tests from the example since it's not so proper showcases
for user scenaro.