platform/core/graphics/tizenvg.git
14 months agoUpdate CONTRIBUTING.md 71/289671/1
Hermet Park [Sat, 20 Aug 2022 04:25:27 +0000 (13:25 +0900)]
Update CONTRIBUTING.md

Change-Id: Ifd9ca62af21cdf6094a00feb1bdc1b1e9dc4f53c

14 months agoBump up 0.8.3 92/289592/1 accepted/tizen/unified/20230314.093351
jykeon [Fri, 10 Mar 2023 05:39:24 +0000 (14:39 +0900)]
Bump up 0.8.3

Change-Id: I18e1dfa786e799e8d128046ab60a66569b4e689c
Signed-off-by: jykeon <jykeon@samsung.com>
14 months agoFix compiler warnings on windows 55/289555/1
projectitis [Sat, 20 Aug 2022 00:32:31 +0000 (12:32 +1200)]
Fix compiler warnings on windows

Change-Id: I86897d1fea2d1b69813bf08b173a11685408cd2a

14 months agocommon picture: support image mesh feature 54/289554/1
projectitis [Fri, 19 Aug 2022 07:56:43 +0000 (19:56 +1200)]
common picture: support image mesh feature

Tvg Picture newly provides mesh() api to support texture mapping.
These apis allows to have a coarse triangle list which have polygon coordinates
and texture uvs those are used for traditional polygon texture mapping.

Note that these apis are beta version.

@API Additions:

Result mesh(const Polygon* triangles, const uint32_t triangleCount) noexcept
uint32_t mesh(const Polygon** triangles) const noexcept

@Examples:

//Mapping with two polygons
Polygon polygon[2];

//First polygon
polygon[0].vertex[0].pt = {0, 0};
polygon[0].vertex[1].pt = {100, 0};
polygon[0].vertex[2].pt = {0, 100};
polygon[0].vertex[0].uv = {0, 0};
polygon[0].vertex[1].uv = {1, 0};
polygon[0].vertex[2].uv = {0, 1};

//Second polygon
polygon[1].vertex[0].pt = {100, 0};
polygon[1].vertex[1].pt = {100, 100};
polygon[1].vertex[2].pt = {0, 100};
polygon[1].vertex[0].uv = {1, 0};
polygon[1].vertex[1].uv = {1, 1};
polygon[1].vertex[2].uv = {0, 1};

//Apply polygons to the picture
picture->mesh(polygon, 2);

@Issues: https://github.com/Samsung/thorvg/issues/1218

Change-Id: I8400a654b392d1d01e01727e0bc0d829cd155080

14 months agoWindows: set TVG_EXPORT to dllexport also for mingw 53/289553/1
Vincent Torri [Fri, 19 Aug 2022 03:49:00 +0000 (05:49 +0200)]
Windows: set TVG_EXPORT to dllexport also for mingw

In addition, remove TVG_EXPORT from enum class. They are types
not symbols

Change-Id: Ia435f86f8bba34093418d7f5699fdc2934f4a21d

14 months agosw_engine: Fix uninitialized variable 52/289552/1
JunsuChoi [Fri, 19 Aug 2022 05:09:50 +0000 (14:09 +0900)]
sw_engine: Fix uninitialized variable

warning message
[35/42] Compiling C++ object src/libthorvg-0.dll.p/lib_sw_engine_tvgSwRaster.cpp.obj
In file included from ../src/lib/sw_engine/tvgSwRasterTexmap.h:96,
                 from ../src/lib/sw_engine/tvgSwRaster.cpp:83:
../src/lib/sw_engine/tvgSwRasterTexmapInternal.h: In function 'void _rasterPolygonImageSegment(SwSurface*, const SwImage*, const SwBBox*, int, int, uint32_t (*)(uint32_t), AASpans*)':
../src/lib/sw_engine/tvgSwRasterTexmapInternal.h:76:9: warning: 'maxx' may be used uninitialized [-Wmaybe-uninitialized]
   76 |         if (x2 > maxx) x2 = maxx;
      |         ^~
../src/lib/sw_engine/tvgSwRasterTexmapInternal.h:33:19: note: 'maxx' was declared here
   33 |     int32_t minx, maxx;
      |                   ^~~~
../src/lib/sw_engine/tvgSwRasterTexmapInternal.h:75:9: warning: 'minx' may be used uninitialized [-Wmaybe-uninitialized]
   75 |         if (x1 < minx) x1 = minx;
      |         ^~
../src/lib/sw_engine/tvgSwRasterTexmapInternal.h:33:13: note: 'minx' was declared here
   33 |     int32_t minx, maxx;
      |             ^~~~

Change-Id: If2f71a4de21d013dc2519d15802889dc2d4d1174

14 months agoWindows: use _fullpath() instead of fullpath(). 51/289551/1
Vincent Torri [Wed, 17 Aug 2022 10:17:21 +0000 (12:17 +0200)]
Windows: use _fullpath() instead of fullpath().

Fix compilation error

Change-Id: Ic55f5da51f834e986d5005e835eb437bc0d3f318

14 months agoloaders raw: fix a compiler warnings on Windows. 50/289550/1
Hermet Park [Thu, 4 Aug 2022 07:54:37 +0000 (16:54 +0900)]
loaders raw: fix a compiler warnings on Windows.

fix the invalid conversion from float to uint32_t.

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

Change-Id: Ibd48c94e23661704ebf6efadfd0b1d098fa87c6a

14 months agofix OpenBSD compile issue 49/289549/1
Omar Polo [Sat, 11 Jun 2022 10:18:48 +0000 (12:18 +0200)]
fix OpenBSD compile issue

Linux seems the only system AFAICS to have alloca.h.  All the BSDs have
the declaration in stdlib.h

Change-Id: I82d18c5ca92bb788eb175a2ce9acf418ac19053c

14 months agoBump Up 0.8.2 15/289515/1 accepted/tizen/unified/20230310.062648
jykeon [Thu, 9 Mar 2023 05:56:00 +0000 (14:56 +0900)]
Bump Up 0.8.2

Change-Id: I185d1dc28c6c5d43af3694bdd9b8b50dd3482cdb
Signed-off-by: jykeon <jykeon@samsung.com>
14 months agoFormat code files with dos2unix, ensure newline at EOF 89/289489/1
Rémi Verschelde [Mon, 23 May 2022 16:35:10 +0000 (18:35 +0200)]
Format code files with dos2unix, ensure newline at EOF

Change-Id: I08dab1f492d295fdb9d9a4fb451578778be5b77a

14 months agoupdated AUTHORS 88/289488/1
Hermet Park [Sun, 5 Jun 2022 06:26:39 +0000 (15:26 +0900)]
updated AUTHORS

Change-Id: I742c4218567fe464afa5f2ac5821f6dbce9a79ca

14 months agoCleanup FreeBSD preprocessor checks (if vs ifdef) 87/289487/1
Rémi Verschelde [Mon, 23 May 2022 17:30:42 +0000 (19:30 +0200)]
Cleanup FreeBSD preprocessor checks (if vs ifdef)

Should be equivalent but checking if the value is defined (`#ifdef`) is cleaner
than checking if it is set to something different from 0 (`#if`).

Change-Id: Ia6ae21fdf9f211ebd9ca1199e77794077c5ac23e

14 months agoFix building with GCC 13. 86/289486/1
Martin Liska [Mon, 23 May 2022 10:11:23 +0000 (12:11 +0200)]
Fix building with GCC 13.

Fixes the following error:
../src/lib/tvgLzw.h:27:5: error: ‘uint8_t’ does not name a type

Change-Id: Ibfc07d633be35634d0662b866c291781c2e7bf6a

14 months agofix FreeBSD compile issue. 85/289485/1
Hermet Park [Tue, 17 May 2022 12:54:40 +0000 (21:54 +0900)]
fix FreeBSD compile issue.

alloca is defined in stdlib.h on [freeBSD](https://www.freebsd.org/cgi/man.cgi?alloca)

additional fix to 75c1314ab0297f59cc26b7876d7b60e751d4d85c

Change-Id: I45f281d100a6daaa911752a9d709da0e504b505d

14 months agoImprove support for clang-cl on windows 84/289484/1
Peter Vullings [Fri, 13 May 2022 15:17:30 +0000 (03:17 +1200)]
Improve support for clang-cl on windows

* Better support for clang-cl on windows
* Fix runtime error caused by removing unwind tables

Change-Id: If794b2d1db46c1353bc3b9c391656ff6fa0c6c32

14 months agoFix on FreeBSD 83/289483/1
mundusnine [Thu, 12 May 2022 16:28:21 +0000 (12:28 -0400)]
Fix on FreeBSD

Fix compile errors on FreeBSD.
- alloca is defined in stdlib.h on [freeBSD](https://www.freebsd.org/cgi/man.cgi?alloca)
Issue in [godot](https://cirrus-ci.com/task/5485473287110656?logs=build#L657)

Change-Id: I074c7cfedb798f4d033e562309498f1b701860be

14 months agoBump up 0.8.1 86/289386/1 accepted/tizen/unified/20230309.161424
jykeon [Tue, 7 Mar 2023 02:09:28 +0000 (11:09 +0900)]
Bump up 0.8.1

Change-Id: I300e33fe476248deb6055d3c9057e203343d278e
Signed-off-by: jykeon <jykeon@samsung.com>
14 months agosvg2png: Add more error message types 40/289340/1
JunsuChoi [Fri, 6 May 2022 00:53:00 +0000 (09:53 +0900)]
svg2png: Add more error message types

Add a message according to the returned Result type.

Change-Id: Ic456f871c48970a7c480e85efa33a219a44ad908

14 months agosvg_loader: Fix invaild '<' nested check 39/289339/1
JunsuChoi [Wed, 4 May 2022 01:23:20 +0000 (10:23 +0900)]
svg_loader: Fix invaild '<' nested check

When Type is DOCTYPE, Child Entities start with '<'.
This condition is valid when general Elements (svg, g, path etc) are used.
Add a Doctype check to if condition.
(There can be various cases related to '<' nested case.
But for now, I only add Doctype considering the side effect.)

Change-Id: I205a900ac4765d6017f6ddc68c52907e932ce333

14 months agoUpdate README.md 38/289338/1
Hermet Park [Thu, 7 Apr 2022 14:04:44 +0000 (23:04 +0900)]
Update README.md

Change-Id: I1ff83a0d72fa00dc9129ca65f381fc9025a3f450

14 months agoFix readme 37/289337/1
projectitis [Wed, 6 Apr 2022 07:24:04 +0000 (19:24 +1200)]
Fix readme

Change-Id: I5886887965217cd3478dbcac42e354f55607f27f

14 months agoUpdated branding 36/289336/1
projectitis [Wed, 6 Apr 2022 07:21:43 +0000 (19:21 +1200)]
Updated branding

Change-Id: I8e56322864b0085aa49dd52eb7e0941d4d82a103

14 months agosvg_loader: clearing the parser stop flags 35/289335/1
mgrudzinska [Sun, 3 Apr 2022 21:33:35 +0000 (23:33 +0200)]
svg_loader: clearing the parser stop flags

Change-Id: I60a2969df2b7105309d58751c1b4f80f34ca7f1d

14 months agosvg_loader: fixing color parsing 34/289334/1
mgrudzinska [Sun, 3 Apr 2022 22:02:43 +0000 (00:02 +0200)]
svg_loader: fixing color parsing

Color given in percentages, ex."rgb(10%,20%,30%)", was incorrectly parsed.

Change-Id: I0f81796c2b4e548564a5cb6ea1d374f706112245

14 months agosvg_loader: fixing segf when passing a nullptr to strcmp 33/289333/1
mgrudzinska [Sun, 3 Apr 2022 20:32:26 +0000 (22:32 +0200)]
svg_loader: fixing segf when passing a nullptr to strcmp

This occurred when a gradient has no 'id' attribute.

Change-Id: I8b4204a657e4ea6fd298bcbfd244a09a46f05d11

14 months agosw_engine: fixing oveflow 32/289332/1
mgrudzinska [Tue, 22 Mar 2022 22:50:24 +0000 (23:50 +0100)]
sw_engine: fixing oveflow

An overflow occurred for big shapes with a dashed stroke,
since a contour end points were stored as the uint16 type
(instead of the uint32 type).

Change-Id: Ibb50aab2dd8114aa615714f05e8a564365f7efe7

14 months agosvg_loader: symbol node without any viewbox/width/height info handled properly 31/289331/1
mgrudzinska [Sun, 20 Mar 2022 17:27:34 +0000 (18:27 +0100)]
svg_loader: symbol node without any viewbox/width/height info handled properly

Change-Id: I60a720306fa6c2ae06aa87e7666abba7289dab6d

14 months agobuild: Add another `<cstring>` include for MinGW compatibility 30/289330/1
Rémi Verschelde [Wed, 16 Mar 2022 14:28:53 +0000 (15:28 +0100)]
build: Add another `<cstring>` include for MinGW compatibility

Change-Id: Ib3179c8997cfbfd0a2bf671cc7481b1b3d40afcf

14 months agoUpdate README.md 29/289329/1
Hermet Park [Thu, 10 Mar 2022 02:46:19 +0000 (11:46 +0900)]
Update README.md

Change-Id: I310899045708d5018422ab205dc989c22dc6ad76

14 months agosvg_loader: width and height attribs of the use element applied 28/289328/1
Mira Grudzinska [Mon, 7 Mar 2022 02:32:02 +0000 (03:32 +0100)]
svg_loader: width and height attribs of the use element applied

Change-Id: Ic08932e9a46498e71259d64ff8ac2ad20d3ab9d5

14 months agoBump up 0.8.0 20/289220/1 accepted/tizen/unified/20230307.101618
jykeon [Fri, 3 Mar 2023 01:27:17 +0000 (10:27 +0900)]
Bump up 0.8.0

Change-Id: I7a0d5530ed1858013036f648b20b2e075224513e
Signed-off-by: jykeon <jykeon@samsung.com>
14 months agojust released v0.8.0 84/289184/1
Hermet Park [Tue, 8 Mar 2022 10:03:21 +0000 (19:03 +0900)]
just released v0.8.0

Change-Id: Ia5e7abe1ee6080cf3bf9ec85653b94b1486ff735

14 months agoexamples - updated a resource usage 83/289183/1
Hermet Park [Tue, 8 Mar 2022 09:38:59 +0000 (18:38 +0900)]
examples - updated a resource usage

Change-Id: I03f6ec33f3891be6c244b8e127469a88c09324cd

14 months agoprepare tvg v0.8 release 82/289182/1
Hermet Park [Tue, 8 Mar 2022 09:25:48 +0000 (18:25 +0900)]
prepare tvg v0.8 release

updated tvg binaries, back up them for backward compatibility test.

Change-Id: I4aaef868ccc4cd807460592e640820441c9b6fd0

14 months agocommon: viewport values improperly rounded 81/289181/1
mgrudzinska [Sun, 27 Feb 2022 01:24:18 +0000 (02:24 +0100)]
common: viewport values improperly rounded

For a very specific scaling factors shapes were to much clipped
because of wrong rounding of the viewport.

Change-Id: Icfd42938c3754c91381565e0b114ca7168f33726

14 months agosvg_loader: use node fixed 80/289180/1
mgrudzinska [Wed, 23 Feb 2022 21:53:41 +0000 (22:53 +0100)]
svg_loader: use node fixed

By mistake the use node was improperly transformed and/or displayed
for a reference node other than a symbol node.

Change-Id: I2b6a4bae1a3027e1726725a7a70773c58928b7a8

14 months agosvg_loader: symbol preserveAspectRatio attribute fixed 79/289179/1
mgrudzinska [Wed, 23 Feb 2022 20:34:15 +0000 (21:34 +0100)]
svg_loader: symbol preserveAspectRatio attribute fixed

The symbol node was properly scaled only for 'preserveAspectRatio=none'.
Now it works also for the default value of this attribute (xMidYMid).

Change-Id: I8f77eac6cd28eb598622ec56e645d6cbea671944

14 months agosvg_loader: preserveAspectRatio fix 78/289178/1
mgrudzinska [Wed, 23 Feb 2022 20:22:55 +0000 (21:22 +0100)]
svg_loader: preserveAspectRatio fix

The default value should be xMidYMid, now it is.

Change-Id: Idb347ed847f4ac19f687f4dfc7c7507a8ca0abbe

14 months agosvg_loader: handle the exception properly. 77/289177/1
Hermet Park [Mon, 21 Feb 2022 02:28:02 +0000 (11:28 +0900)]
svg_loader: handle the exception properly.

viewBox doesn't expect the missing attributes,
it won't have any default values.

So we can decide the fault when the values are missed.

Change-Id: I99a1e97d6d5bd569cf53d1eca2d4d4905a69e08b

14 months agosvg_loader: fixing symbol transformation 76/289176/1
Mira Grudzinska [Thu, 17 Feb 2022 00:47:17 +0000 (01:47 +0100)]
svg_loader: fixing symbol transformation

For a Symbol node, the transformation based on the 'viewBox', 'width'
and 'height' attributes has to be applied before the transformation
based on the 'transformation' attribute.

Change-Id: I72fe990e5c95f0f73aec6c77124d4017e8227a65

14 months agosvg_loader: symbol++ 75/289175/1
Mira Grudzinska [Wed, 16 Feb 2022 00:45:26 +0000 (01:45 +0100)]
svg_loader: symbol++

- The initial value of the overflow attribute was missing
- overflow="visible" was missing scaling

Change-Id: I25b68a37ba154878a6c966b6c38e0214040bbc35

14 months agosvg_loader: symbol tag implemented 74/289174/1
Mira Grudzinska [Tue, 1 Feb 2022 19:55:15 +0000 (20:55 +0100)]
svg_loader: symbol tag implemented

The 'symbol' tag introduced. It can be used to define graphical
template objects which can be instantiated by a 'use' tag.

Change-Id: I48c000156e764c039a9d27e5a205a226909d2edf

14 months agojpeg_loader: resolve the asan bug report. 73/289173/1
Hermet Park [Wed, 16 Feb 2022 03:22:53 +0000 (12:22 +0900)]
jpeg_loader: resolve the asan bug report.

fix the invalid negative shift operations.

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

Change-Id: I36aac7ecc1869464a5be9cbabf69cd3120d894a2

14 months agoexamples: adds a new sample svg 72/289172/1
Hermet Park [Mon, 14 Feb 2022 05:38:03 +0000 (14:38 +0900)]
examples: adds a new sample svg

Change-Id: I541117f38dee2fbf11d3fc9a7fd5c255d0e17ed5

14 months agoBump up 0.7.9 23/289123/1 accepted/tizen/unified/20230303.162746
jykeon [Thu, 2 Mar 2023 01:31:00 +0000 (10:31 +0900)]
Bump up 0.7.9

Change-Id: Iaacfb1959ac48a334562dea752c14af8c530e434
Signed-off-by: jykeon <jykeon@samsung.com>
14 months agosvg_loader: fixing memory leak 77/289077/1
Mira Grudzinska [Wed, 9 Feb 2022 18:25:00 +0000 (19:25 +0100)]
svg_loader: fixing memory leak

The css style node was improperly freed.

Change-Id: I362ea9d30d974a65ddc45e167ef755b260722d56

14 months agoinfra: Disable unit test in window CI 76/289076/1
JunsuChoi [Thu, 10 Feb 2022 01:50:57 +0000 (17:50 -0800)]
infra: Disable unit test in window CI

Symbol file generation for compiling test code in CI fails.
It's not caused by recent patches.
We don't test until we know the exact cause.
However, loader test is added to check the safety of window build.

Error Log

[45/68] Generating symbol file src/thorvg-0.dll.p/thorvg-0.dll.symbols
FAILED: src/thorvg-0.dll.p/thorvg-0.dll.symbols
"C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts\meson" "--internal" "symbolextractor" "D:\a\thorvg\thorvg\build" src/thorvg-0.dll "src\thorvg.lib" src/thorvg-0.dll.p/thorvg-0.dll.symbols

Change-Id: I03401e691d7a21b59ab2f1a2e40ddbdf4062be08

14 months agosvg_loader: preventing invalid log msg 75/289075/1
Mira Grudzinska [Wed, 9 Feb 2022 18:39:08 +0000 (19:39 +0100)]
svg_loader: preventing invalid log msg

Change-Id: I3f93189028debb1c9449bc085d2849c3156c035d

14 months agosvg_loader: proper image transformation 74/289074/1
Mira Grudzinska [Mon, 7 Feb 2022 01:39:48 +0000 (02:39 +0100)]
svg_loader: proper image transformation

One of the image's attributes can be a transformation matrix.
Now it's applied.

Change-Id: I7056aa0a5deff519bf60e5fd99b4786c2a6cb8bf

14 months agosvg_loader: the 'use' node properly transformed 73/289073/1
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

14 months agosvg_loader: fixing the used mask-type 72/289072/1
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

14 months agosvg_loader: code refactoring. 71/289071/1
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

14 months agoexample: just renamed the svg file. 70/289070/1
Hermet Park [Tue, 8 Feb 2022 09:02:20 +0000 (18:02 +0900)]
example: just renamed the svg file.

Change-Id: Ib880280971d5d2d93cab3b59938e94e230b7a4f5

14 months agoexample: cssStyle.svg add 69/289069/1
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

14 months agoBump up 0.7.8 35/289035/1 accepted/tizen/unified/20230302.131059
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>
14 months agosvg_loader: fixing css style for group selectors, clips/masks 34/289034/1
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

14 months agosvg_loader: css style functions moved to a separate file 33/289033/1
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

14 months agosvg_loader: styling++ (no logical changes) 32/289032/1
Mira Grudzinska [Fri, 28 Jan 2022 00:42:02 +0000 (01:42 +0100)]
svg_loader: styling++ (no logical changes)

Change-Id: I8cde1a51aaf567aa65b9cb838bd39242a8e4d61f

14 months agosvg_loader: fixing cdata block reading 31/289031/1
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

14 months agosvg_loader: tvg styling applied to the code 30/289030/1
Mira Grudzinska [Tue, 25 Jan 2022 11:20:22 +0000 (12:20 +0100)]
svg_loader: tvg styling applied to the code

Change-Id: I836926e52873e836c7dfdd64eae8ab56f0e4fe5d

14 months agosvg_loader: custom _strndup added 29/289029/1
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

14 months agosvg_loader: some names changed, no logical changes 28/289028/1
Mira Grudzinska [Wed, 19 Jan 2022 01:34:39 +0000 (02:34 +0100)]
svg_loader: some names changed, no logical changes

Change-Id: I4101cac14d2792f9b2fb85529e3908267362eac6

14 months agosvg_loader: restoring changes from ed3b17b2281df03f2df67ebc34cafa12b2aea737 27/289027/1
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

14 months agosvg_loader: css styling supported also when defs were postponed 26/289026/1
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

14 months agosvg_loader: supporting different target formats in css 25/289025/1
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

14 months agosvg_loader: proper precedence of a styling 24/289024/1
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

14 months agoBump up 0.7.7 20/289020/1
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>
14 months agosvg_loader: remove unnecessary variables 17/289017/1
Mira Grudzinska [Mon, 17 Jan 2022 22:11:24 +0000 (23:11 +0100)]
svg_loader: remove unnecessary variables

Change-Id: If5f1418c3aab366c977db0f5ac4078cc915cb46e

14 months agosvg_loader: buflen arg used in the simpleXmlParseW3CAttribute() 16/289016/1
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

14 months agosvg_loader: additional check while style parsing 15/289015/1
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

14 months agosvg_loader: additional arg added into create...Node() functions 14/289014/1
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

14 months agosvg_loader: intro to the implementation of the css internal style sheets parsing 13/289013/1
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

14 months agosvg_loader: css style node introduced 12/289012/1
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

14 months agosvg_loader: class attribute added 11/289011/1
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

14 months agoBump up 0.7.6 10/289010/1
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>
14 months agoloader png external: fix potential memory leak if read fails 08/289008/1
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

14 months agocommon: styling++ (tabs -> spaces) 07/289007/1
Mira Grudzinska [Mon, 31 Jan 2022 13:05:58 +0000 (14:05 +0100)]
common: styling++ (tabs -> spaces)

Change-Id: I101d1d536e932924cfb0f70d174d51cddc0ff9e5

14 months agoexamples images: updated sample resources 06/289006/1
Hermet Park [Wed, 26 Jan 2022 08:58:01 +0000 (17:58 +0900)]
examples images: updated sample resources

Change-Id: Ifc2a5502a8b3ffb0843d409196ab839db2f59111

14 months agoloader png: fix all memory leaks. 05/289005/1
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

14 months agoloaders jpg: fix all memory leaks. 04/289004/1
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

14 months agoportability: fixing windows warnings 03/289003/1
Mira Grudzinska [Thu, 20 Jan 2022 12:52:57 +0000 (13:52 +0100)]
portability: fixing windows warnings

atan2->atan2f

Change-Id: Ia7572db01a26e0b7d5a6d3ed610cda407a27375f

14 months agoexamples: terminate the same engine as was initialized 02/289002/1
Mira Grudzinska [Fri, 21 Jan 2022 22:45:03 +0000 (23:45 +0100)]
examples: terminate the same engine as was initialized

Change-Id: I3e1b3cbee003fa18fdec8b554588d3420473aa08

14 months agosw_engine: float casted on the unsigned int type 01/289001/1
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

14 months agoBump up 0.7.5 97/288997/1 accepted/tizen/unified/20230228.052747
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>
14 months agosvg_loader: ++robustness 92/288992/1
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

14 months agosw_engine renderer: code refactoring 91/288991/1
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

14 months agosw_engine: Replace non-portable min/max with tvgMath.h macros 90/288990/1
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

14 months agosvg_loader: group tags misinterpreted as parent nodes 89/288989/1
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

14 months agobuild: Add missing <cstring> includes for MinGW compatibility 88/288988/1
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

14 months agotvg_loader: Convert tvgJpgd.h EOL to LF 87/288987/1
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

14 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>
14 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

14 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

14 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

14 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

14 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

14 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

14 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>
14 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