Mira Grudzinska [Fri, 4 Feb 2022 17:59:00 +0000 (18:59 +0100)]
svg_loader: the 'use' node properly transformed
The translation of the use node shouldn't overwrite its transformation.
Change-Id: Ibc6761404bc98bd5a82ac1c2d76bf664a98e5d91
Mira Grudzinska [Tue, 1 Feb 2022 22:34:41 +0000 (23:34 +0100)]
svg_loader: fixing the used mask-type
For the performance reasons, regardless of the set/default
mask-type value, if the mask is white, the alpha masking is
used. To qualify a mask as white, not only its fill has to be
checked, but its stroke as well. The second was missing.
Change-Id: I407ec17f1b8dfd8fda5948319cf11bd609e7ab91
Hermet Park [Tue, 8 Feb 2022 09:43:03 +0000 (18:43 +0900)]
svg_loader: code refactoring.
follow strict coding-style.
no logic changes.
Change-Id: Iab335dbafe4a32f321244f7df8068176f069d2c9
Hermet Park [Tue, 8 Feb 2022 09:02:20 +0000 (18:02 +0900)]
example: just renamed the svg file.
Change-Id: Ib880280971d5d2d93cab3b59938e94e230b7a4f5
Mira Grudzinska [Tue, 25 Jan 2022 11:38:49 +0000 (12:38 +0100)]
example: cssStyle.svg add
For now it's a simple file used to check the styling precedence
and overall correctness.
After the css stylling will be fully introduced a more complex file
can be used,
Change-Id: I10fe2b7d4c201e29893ab6a919d132a2e2a47e24
jykeon [Mon, 27 Feb 2023 10:12:37 +0000 (19:12 +0900)]
Bump up 0.7.8
Change-Id: Ib9bd24a04afecb67ba77e560119dddc7b0b2219a
Signed-off-by: jykeon <jykeon@samsung.com>
Mira Grudzinska [Sat, 29 Jan 2022 22:08:53 +0000 (23:08 +0100)]
svg_loader: fixing css style for group selectors, clips/masks
The css styling has to be applied as the first step of the node
updates. Whereas the updateStyle function should be called
as the last step, after all other node updates are made.
Change-Id: I59d11f6d372ff4f32c22b067edff90b552900ef8
Mira Grudzinska [Fri, 28 Jan 2022 23:40:09 +0000 (00:40 +0100)]
svg_loader: css style functions moved to a separate file
Change-Id: I6ea53062f358e0128a3b8eafba4e6217b7b9666e
Mira Grudzinska [Fri, 28 Jan 2022 00:42:02 +0000 (01:42 +0100)]
svg_loader: styling++ (no logical changes)
Change-Id: I8cde1a51aaf567aa65b9cb838bd39242a8e4d61f
Mira Grudzinska [Thu, 27 Jan 2022 21:58:52 +0000 (22:58 +0100)]
svg_loader: fixing cdata block reading
The CData block is read if it's inside the style tag.
In a case when the CData block was just after the style
block, the data was still read, although it shouldn't be.
Fixed.
Change-Id: I3cd242d0738475c0cc986f6dc8a375e3b9d5b7a5
Mira Grudzinska [Tue, 25 Jan 2022 11:20:22 +0000 (12:20 +0100)]
svg_loader: tvg styling applied to the code
Change-Id: I836926e52873e836c7dfdd64eae8ab56f0e4fe5d
Mira Grudzinska [Thu, 20 Jan 2022 01:07:30 +0000 (02:07 +0100)]
svg_loader: custom _strndup added
For the compatibility reasons a custom version of strndup is
introduced.
Change-Id: I8c1d0581eed8e708d7d3d5af121a7933b33ab77c
Mira Grudzinska [Wed, 19 Jan 2022 01:34:39 +0000 (02:34 +0100)]
svg_loader: some names changed, no logical changes
Change-Id: I4101cac14d2792f9b2fb85529e3908267362eac6
Mira Grudzinska [Wed, 19 Jan 2022 01:30:01 +0000 (02:30 +0100)]
svg_loader: restoring changes from
ed3b17b2281df03f2df67ebc34cafa12b2aea737
(preventing memcpy from a nullptr)
Change-Id: If5e0628815d375d93334003f4d4e71da1c9f7b51
Mira Grudzinska [Tue, 18 Jan 2022 13:33:55 +0000 (14:33 +0100)]
svg_loader: css styling supported also when defs were postponed
Defs can be defined at the end of the file. In such a case each
node with a defined class attribute has to be marked and checked
at the final stage of processing - the proper style node has to be found
and its style has to be applied.
Change-Id: If464fa8970e13c71820553b04caecc5c3512edc9
Mira Grudzinska [Tue, 18 Jan 2022 01:36:26 +0000 (02:36 +0100)]
svg_loader: supporting different target formats in css
Css styling supports now targets defined only by tag or only by name
(tag.name was already supported before).
Also proper precedence of a styling is fixed - flags were not set.
Change-Id: I757fa8ac54ccd38603f250691add141d0bacad21
Mira Grudzinska [Mon, 17 Jan 2022 23:06:21 +0000 (00:06 +0100)]
svg_loader: proper precedence of a styling
The attribute values should be copied from a style node only if they
were set in the destination node using the attributes (in opocity to
a style attribute). A proper copyCssStyleAttr() function is introduced.
Change-Id: Iaaa0c2b561c2bea276617bfd87dc26ed80bb4bbd
jykeon [Mon, 27 Feb 2023 09:07:26 +0000 (18:07 +0900)]
Bump up 0.7.7
Change-Id: I7a248987ab997c664910bc3d16e4cb9bef775048
Signed-off-by: jykeon <jykeon@samsung.com>
Mira Grudzinska [Mon, 17 Jan 2022 22:11:24 +0000 (23:11 +0100)]
svg_loader: remove unnecessary variables
Change-Id: If5f1418c3aab366c977db0f5ac4078cc915cb46e
Mira Grudzinska [Mon, 17 Jan 2022 21:55:02 +0000 (22:55 +0100)]
svg_loader: buflen arg used in the simpleXmlParseW3CAttribute()
While parsing the css internal style sheets the buflen has to be passed.
Change-Id: Iad755186b4ed2e73a93b8d4ed82fb9098a75bbeb
Mira Grudzinska [Mon, 17 Jan 2022 21:32:19 +0000 (22:32 +0100)]
svg_loader: additional check while style parsing
This check is needed so the function can be used to parse
not only the inline styles, but also the css internal style sheet.
Change-Id: I6e325d81781326deaccdad8170f11f1acf5f43f2
Mira Grudzinska [Mon, 17 Jan 2022 18:35:05 +0000 (19:35 +0100)]
svg_loader: additional arg added into create...Node() functions
A function pointer added as an additional arg in order to make it
possible to use these functions to create a normal nodes and also
nodes defined inside a style tag. These two cases need to be parsed
using different functions: simpleXmlParseAttributes() and
simpleXmlParseW3CAttribute().
Change-Id: Ic039b5b21172326bea15060195b2cb14153036a4
Mira Grudzinska [Wed, 12 Jan 2022 15:23:22 +0000 (16:23 +0100)]
svg_loader: intro to the implementation of the css internal style sheets parsing
Function simpleXmlParseCSSAttribute() used to parse the data inside the style tag.
For now the supported formats are: tag {}, .name {}, tag.name{}
_svgLoaderParserXmlStyle() used to deal with the results of the above - to create
the proper nodes. Will work after create...Node() are changed.
Note:
The geometric attributes are not copied from the node defining the style
to the node using it. The SVG2 standard has to be checked to decide
whether it should be supported.
Change-Id: I0b910bbb88d1142909f997219621c9011ed4e39c
Mira Grudzinska [Sun, 9 Jan 2022 20:31:24 +0000 (21:31 +0100)]
svg_loader: css style node introduced
For now it is assumed that only one style element is defined
in an svg file, although it can be easily changed if needed.
The style node will be used to define the style applied to a node
of a given type or in a case when a class attrib was used.
Change-Id: I53e95dadfbf8a1a48903bc9f07bd2cbec82a4eda
Mira Grudzinska [Sat, 8 Jan 2022 19:59:50 +0000 (20:59 +0100)]
svg_loader: class attribute added
It's the first step in introducing the css inline style sheets into tvg.
For now the class attribute is set only for SvgNodes (not for grads),
it's not used yet.
Change-Id: Ib81c47b38f5f1355125dc0bff44f07cfbd7c12af
jykeon [Mon, 27 Feb 2023 08:40:43 +0000 (17:40 +0900)]
Bump up 0.7.6
Change-Id: I767a52803a91fc74456ea5d25196ffd7a1864882
Signed-off-by: jykeon <jykeon@samsung.com>
Michal Maciola [Fri, 4 Feb 2022 13:50:12 +0000 (14:50 +0100)]
loader png external: fix potential memory leak if read fails
Change-Id: I09cc563cbd7144112c5d8f593b3608a9bcdb7e40
Mira Grudzinska [Mon, 31 Jan 2022 13:05:58 +0000 (14:05 +0100)]
common: styling++ (tabs -> spaces)
Change-Id: I101d1d536e932924cfb0f70d174d51cddc0ff9e5
Hermet Park [Wed, 26 Jan 2022 08:58:01 +0000 (17:58 +0900)]
examples images: updated sample resources
Change-Id: Ifc2a5502a8b3ffb0843d409196ab839db2f59111
Hermet Park [Mon, 24 Jan 2022 12:21:17 +0000 (21:21 +0900)]
loader png: fix all memory leaks.
These were detected by asan with PicturePng example,
fixed them all.
Change-Id: I4a113656a0b7c06333ced36f9a8ff1d9715d83f9
Hermet Park [Mon, 24 Jan 2022 11:48:54 +0000 (20:48 +0900)]
loaders jpg: fix all memory leaks.
These were detected by asan with PictureJpg example,
fixed them all.
Change-Id: Ie63bcef3aa40945aa511db6df3fab9cc650c595b
Mira Grudzinska [Thu, 20 Jan 2022 12:52:57 +0000 (13:52 +0100)]
portability: fixing windows warnings
atan2->atan2f
Change-Id: Ia7572db01a26e0b7d5a6d3ed610cda407a27375f
Mira Grudzinska [Fri, 21 Jan 2022 22:45:03 +0000 (23:45 +0100)]
examples: terminate the same engine as was initialized
Change-Id: I3e1b3cbee003fa18fdec8b554588d3420473aa08
Mira Grudzinska [Thu, 20 Jan 2022 12:55:05 +0000 (13:55 +0100)]
sw_engine: float casted on the unsigned int type
uint32_t -> int32_t
Change-Id: I33a7ba842a19acafc2cbe9bfa4bc8f6f79ba7658
jykeon [Mon, 27 Feb 2023 07:53:00 +0000 (16:53 +0900)]
Bump up 0.7.5
Change-Id: I0ce3f00a49467ffd990eeeaf0179171401280177
Signed-off-by: jykeon <jykeon@samsung.com>
Hermet Park [Thu, 20 Jan 2022 03:04:19 +0000 (12:04 +0900)]
svg_loader: ++robustness
Prevent recursive calls by counting just in case.
The size is arbitrary value, we can adjust it experimentally.
@Issue: https://github.com/Samsung/thorvg/issues/1161
Change-Id: I30571e5de085c65980a240b14c592bc0b47a7860
Hermet Park [Thu, 20 Jan 2022 02:27:28 +0000 (11:27 +0900)]
sw_engine renderer: code refactoring
remove unnecessary header inclusion.
Change-Id: Ic58763dd5a1f95169208eb09c85929a140c8994d
Rémi Verschelde [Wed, 19 Jan 2022 09:59:34 +0000 (10:59 +0100)]
sw_engine: Replace non-portable min/max with tvgMath.h macros
This would fail building with Visual Studio 2017, at least downstream in Godot
where we undefine old Windows compilers' non-standard `min`/`max` macros (see
`minmax.h`/`NOMINMAX`).
Change-Id: I593db53fb75b8eaac98f578fb49fa8f923cb7fb9
Mira Grudzinska [Tue, 18 Jan 2022 22:59:14 +0000 (23:59 +0100)]
svg_loader: group tags misinterpreted as parent nodes
Group tags in a format <tag .../> finds no application
to the rest of the svg file and should be skipped.
Change-Id: I77f7a5acdccdbb3239670d8cdbf6d0f8e8416d48
Rémi Verschelde [Tue, 18 Jan 2022 11:20:35 +0000 (12:20 +0100)]
build: Add missing <cstring> includes for MinGW compatibility
Change-Id: I046d4bd18604b5b21696f290d75e1aea069bf314
Rémi Verschelde [Tue, 18 Jan 2022 11:24:11 +0000 (12:24 +0100)]
tvg_loader: Convert tvgJpgd.h EOL to LF
This makes it consistent with the rest of the codebase.
Change-Id: I2d27b15b7ca6983cefbdb453c9f56fba5eb7b4a9
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>
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
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
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
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
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
Hermet Park [Wed, 12 Jan 2022 05:08:48 +0000 (14:08 +0900)]
updated copyright date.
Change-Id: I00af27fbb4170f365bece9e5d2bc218c9a3de9cb
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>
Chun [Fri, 24 Feb 2023 02:00:35 +0000 (02:00 +0000)]
Merge "svg_loader: changed the order of if conditions" into tizen
Chun [Fri, 24 Feb 2023 02:00:20 +0000 (02:00 +0000)]
Merge "svg_loader: the color attribute properly inherited" into tizen
Chun [Fri, 24 Feb 2023 02:00:04 +0000 (02:00 +0000)]
Merge "svg_loader: removing repeated lines" into tizen
Chun [Fri, 24 Feb 2023 01:59:48 +0000 (01:59 +0000)]
Merge "svg_loader: fix grad update" into tizen
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
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
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
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
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>
Chun [Thu, 23 Feb 2023 09:08:53 +0000 (09:08 +0000)]
Merge "svg_loader: preventing memory leak" 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
Chun [Thu, 23 Feb 2023 09:08:33 +0000 (09:08 +0000)]
Merge "svg_loader: typo fixed" into tizen
Chun [Thu, 23 Feb 2023 09:08:26 +0000 (09:08 +0000)]
Merge "svg_loader: mask-type attribute introduced" into tizen
Chun [Thu, 23 Feb 2023 09:08:20 +0000 (09:08 +0000)]
Merge "svg_loader: ++robustness" into tizen
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
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
Mira Grudzinska [Fri, 7 Jan 2022 23:31:32 +0000 (00:31 +0100)]
svg_loader: typo fixed
_svgLoaderParerXmlClose -> _svgLoaderParserXmlClose
Change-Id: I24a3fc61e52c74507dc6dd62ddda63f97ed3d05f
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
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
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>
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
JunsuChoi [Wed, 5 Jan 2022 01:42:41 +0000 (17:42 -0800)]
sw_engine SwRaster: Initialize uninitialized transform value
Change-Id: I12e6a63cebbd765c19e83194587722a19db06fa2
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
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
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
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>
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
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
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]
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
K. S. Ernest (iFire) Lee [Sat, 18 Dec 2021 00:04:26 +0000 (16:04 -0800)]
Hide the thorvg LZW implementation.
Change-Id: I9fc4049b0d3dd04f22e6327d44c71d663096e366
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
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
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
Mira Grudzinska [Thu, 16 Dec 2021 19:13:36 +0000 (20:13 +0100)]
capi: missing arg description added
Change-Id: If9b6a81ac27a0f7f7b52f791e0c6205bf014d9df
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
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
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
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
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>
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
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
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>
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
JunsuChoi [Wed, 5 Jan 2022 01:42:41 +0000 (17:42 -0800)]
sw_engine SwRaster: Initialize uninitialized transform value
Change-Id: I7aac462c6d6e481655c35a10b237970de7dbea76
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>
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
JunsuChoi [Wed, 15 Dec 2021 04:29:01 +0000 (20:29 -0800)]
sw_engine SwShape: Fix coding style
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.
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
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.