joogab.yun [Thu, 13 Jul 2023 06:59:17 +0000 (15:59 +0900)]
Version up 0.8.13
Change-Id: I458c03b0f44b981683c7108ce4f9d564a5ea3cb7
joogab.yun [Thu, 13 Jul 2023 06:46:18 +0000 (15:46 +0900)]
common taskscheduler:
There is a report of the thread sanitizer.
It could be a false-positive as far as I reviewed,
but we hate to be bothered by it. So let's revert it.
@Issue: https://github.com/thorvg/thorvg/issues/1409
Change-Id: I74d0968a8a9682def132569770e588f7c2ac64bf
joogab.yun [Thu, 4 May 2023 09:50:26 +0000 (18:50 +0900)]
Bump up 0.8.12
Change-Id: I065732ad15fbb2d3aabe7f95063e943924ea3a4f
Patryk Kaczmarek [Thu, 4 May 2023 09:17:29 +0000 (11:17 +0200)]
[Tizen] Revert "svg_loader: preserveAspectRatio attrib handled according to the svg standard (#1249)"
This reverts commit
69a417076a436065a20b54925031aa6f6a7fa526.
Change-Id: I45e4c6ef332d42d08cef47ff3b4c85b3538881ef
Hermet Park [Tue, 25 Apr 2023 07:27:41 +0000 (16:27 +0900)]
common taskscheduler: fix a potential crash issue.
Guarantee the tasks are not deleted until the taskscheduler finished them.
@Issue: https://github.com/thorvg/thorvg/issues/1370
Change-Id: I9304539f5960a05405ac3993f39894d46a4ff57b
Hermet Park [Mon, 24 Apr 2023 09:06:26 +0000 (18:06 +0900)]
sw_engine rle: The out-of-range memory access has been fixed.
@Issue: https://github.com/thorvg/thorvg/issues/1370
Change-Id: Iaba662619f6c307c4a4917866b24cff958890074
Hermet Park [Mon, 24 Apr 2023 08:18:32 +0000 (17:18 +0900)]
sw_engine mempool: fixed to address a potential memory corruption issue.
The previous memory pool was being shared by both the main and first threads,
which could lead to corruption if any threading changes occurred.
@Issue: https://github.com/thorvg/thorvg/issues/1370
Change-Id: I1bfb6948eb3bfe3d222f5955f877a7c9ad4f4f78
Hermet Park [Fri, 14 Apr 2023 04:32:20 +0000 (13:32 +0900)]
sw_engine rle: fix RLE intersect.
IntersectSpansRegion() wasn't working correctly,
as it didn't take care of some corner cases.
This fix makes the algorithm more accurate.
Change-Id: I7405676290951f6f7ee7ac29f6cbc19473cda84d
Patryk Kaczmarek [Thu, 4 May 2023 09:22:32 +0000 (11:22 +0200)]
Revert "[Tizen] Revert "svg_loader: preserveAspectRatio attrib handled according to the svg standard (#1249)""
This reverts commit
295dd97bc2fbdf8885f4bd18f6100ef2274816ed.
Change-Id: I06fc20c73ed257756c1e80db86bc5c62db953608
jykeon [Tue, 18 Apr 2023 03:05:41 +0000 (12:05 +0900)]
Bump up 0.8.11
Change-Id: I495d8bfb3c94b75277a2af38443403521705fe60
Signed-off-by: jykeon <jykeon@samsung.com>
Hermet Park [Wed, 5 Apr 2023 16:10:36 +0000 (01:10 +0900)]
sw_engine: fix the inproper stroke raster.
We have an incorrect value comparison when the stroke corner center
is adjusted. All coordinates in the stroke raster have been scaled by
the given values (sx, sy), while the stroke width remains at its
original size due to it not being clear how it should be scaled.
This brings wierd rendering results at times. Now fix it.
@Issue: https://github.com/thorvg/thorvg/issues/1336
Change-Id: If7a76a5fe5ddb52292903b68cfde951f95e3e5f2
Signed-off-by: jykeon <jykeon@samsung.com>
Hermet Park [Thu, 6 Apr 2023 10:47:56 +0000 (19:47 +0900)]
test capi: ++coverage
added jpg, tvg tests
Change-Id: I31e5a0ff51bd3c142a586d7a40c2d9fc43e27150
Signed-off-by: jykeon <jykeon@samsung.com>
Hermet Park [Thu, 6 Apr 2023 10:34:07 +0000 (19:34 +0900)]
test: fix broken plugin support.
The thorvg test should not attempt to perform features
that were not enabled, as this will cause them to fail.
@Issues: https://github.com/thorvg/thorvg/issues/1251
Change-Id: I6a63d9370bc5f08a8d42ec77fb970d5834d8d82d
Signed-off-by: jykeon <jykeon@samsung.com>
Mira Grudzinska [Mon, 3 Apr 2023 20:45:26 +0000 (22:45 +0200)]
examples: preventing undef behavior
Calling get() on a unique pointer after
it has been moved is the undefined behavior.
Change-Id: I6878daf840079b59c6584c5741171d1affc71666
Signed-off-by: jykeon <jykeon@samsung.com>
Mira Grudzinska [Sat, 1 Apr 2023 15:14:04 +0000 (17:14 +0200)]
svg_loader: fixing svgs without viewbox attr
For svgs without any viewbox and width/height
whole image is drawn. Before it was forced
to set x=y=0.
Change-Id: Iaa84f8a19901aac180704e6674d47dfcea128cd0
Signed-off-by: jykeon <jykeon@samsung.com>
Mira Grudzinska [Sat, 1 Apr 2023 15:21:41 +0000 (17:21 +0200)]
picture: remove unnecessary reloads
After #1338 is applied there is no need to reload
the pictures while aksing about its viewbox or its size.
Change-Id: I63ec1899f6b4ee6bd44a6c21e8fedcf6ee192217
Signed-off-by: jykeon <jykeon@samsung.com>
jykeon [Fri, 31 Mar 2023 07:59:51 +0000 (16:59 +0900)]
Bump up 0.8.10
Change-Id: I317e6f47471d4ed0d692b8b5bbeceedc081c20ce
Signed-off-by: jykeon <jykeon@samsung.com>
joogab.yun [Fri, 31 Mar 2023 01:35:04 +0000 (10:35 +0900)]
[Tizen] Revert "svg_loader: preserveAspectRatio attrib handled according to the svg standard (#1249)"
This reverts commit
795978177ab26c6ced98fd493f13e99a27c36397.
There is a problem with the preserveAspectRatio patch,
so it is temporarily reverted.
This patch will go away once the preserveAspectRatio issue is resolved.
Change-Id: I7287ee79b55a524859934d9e11b749f3b117688d
Mira Grudzinska [Sat, 25 Mar 2023 23:16:40 +0000 (00:16 +0100)]
sw_engine: fix safety check
An incorrect check introduced in
bf07eb11f25909d2c73aa7e5baeb01a80af384d0
as a solution of the #1327 issue. As a consequence rotated images
were not drawn. Fixed.
Change-Id: I23a9842aff5c2b8463e9ee005932257eda6cb843
Signed-off-by: jykeon <jykeon@samsung.com>
Hermet Park [Sat, 25 Mar 2023 01:56:59 +0000 (10:56 +0900)]
common/accessor: fix uninitialized field.
--warnings.
Change-Id: I94f6e5892985aa2093b9dbc9b89e0ac267370884
Signed-off-by: jykeon <jykeon@samsung.com>
Mira Grudzinska [Tue, 21 Mar 2023 22:27:00 +0000 (23:27 +0100)]
svg_loader: invalid strokes' width set to zero
In case the "stroke" attrib is set to "none",
the width of the stroke is set to zero. Thanks
to that it isn't taken into account while
establishing the bounds of the shape.
Change-Id: I65cfd52075b72bebe9f9f4d24d54cde2e1dca99c
Signed-off-by: jykeon <jykeon@samsung.com>
Mira Grudzinska [Wed, 15 Mar 2023 23:47:11 +0000 (00:47 +0100)]
svg_loader: handling zero width/height viewbox
For svgs with the width and/or height value set to zero
rendering was disabled - the load api return Result:Unknown
and draw - Result::InsufficientCondition.
Now an empty scene is added, so that both, load and draw,
return Result::Success.
Change-Id: I3b47acea33f49eca8d0d213a47d88cd57146027b
Signed-off-by: jykeon <jykeon@samsung.com>
Mira Grudzinska [Wed, 1 Feb 2023 22:46:48 +0000 (23:46 +0100)]
svg_loader: handling svgs without viewBox/viewPort
Additionally:
- cases of inforrect viewBox values are handled
- cases of zero width/height of a viewBox and/or viewPort
@Issue: https://github.com/Samsung/thorvg/issues/1239
Change-Id: I7f6b557ae451db27d1a2033eb2976ed87e0e7f7d
Signed-off-by: jykeon <jykeon@samsung.com>
jykeon [Thu, 16 Mar 2023 01:16:57 +0000 (10:16 +0900)]
Bump up 0.8.9
Change-Id: I9c28a1e14fa3cb2bcad516b119f82316b730b130
Signed-off-by: jykeon <jykeon@samsung.com>
Hermet Park [Tue, 14 Mar 2023 14:39:48 +0000 (23:39 +0900)]
sw_engine - ++safety
Prevent any potential crash.
@Issues: https://github.com/thorvg/thorvg/issues/1327
Change-Id: I57e6582f17a3beae475d85261439aa78ca5f6919
JunsuChoi [Fri, 10 Feb 2023 04:46:06 +0000 (13:46 +0900)]
png_loader(static): Move the colortype check code to open()
Change-Id: I6711b294b24e3e89bf93f96e0c78f8026ac75375
JunsuChoi [Fri, 10 Feb 2023 01:50:16 +0000 (10:50 +0900)]
png_loader(static): Fix the colorspace of an image with an alpha channel
Set colorspace to ABGR when colortype of lodepng is LCT_RGBA.
Since an image without an alpha channel becomes an ARGB colorspace with LCT_RGB,
it is the same as the default colorspace.
Change-Id: Ia33ca50ab3340fe72f1b7af2ced35850854fc835
JunsuChoi [Fri, 20 Jan 2023 04:13:01 +0000 (13:13 +0900)]
loader: Support ABGR colorspace
Since the color space is set at the time of specifying the target buffer of the canvas,
there is no way to know the color space when the picture is loaded.
So, check the color space applied to SwCanvas at the time of reload()
and change the color space.
There is an issue of BGR color space support for each loader.
The external_jpg loader resets the TJPF color space and calls read() to get a new buffer.
In the case of external_png, we need to change the color value directly
because it have to start over from begin_read_*.
This solution can affect performance as much as it access again image buffer
that have already been `read()` done. However, this only happens once.
Change-Id: Ib7f25b5bc5871cfe59ad3963d26536269b48a3f5
Hermet Park [Sun, 5 Feb 2023 02:44:59 +0000 (11:44 +0900)]
common shape: code refactoring.
keep name consistency.
Change-Id: I902d163f50457e7e82180ad9259e8952257cd302
Hermet Park [Sun, 5 Feb 2023 02:42:37 +0000 (11:42 +0900)]
gl_engine: -- compiler warnings
../src/lib/gl_engine/tvgGlRenderer.cpp: In member function ‘virtual bool GlRenderer::renderShape(tvg::RenderData)’:
../src/lib/gl_engine/tvgGlRenderer.cpp:171:30: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized]
171 | drawPrimitive(*sdata, r, g, b, a, i, RenderUpdateFlag::Stroke);
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/lib/gl_engine/tvgGlRenderer.cpp:171:30: warning: ‘b’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../src/lib/gl_engine/tvgGlRenderer.cpp:171:30: warning: ‘g’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../src/lib/gl_engine/tvgGlRenderer.cpp:171:30: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../src/lib/gl_engine/tvgGlRenderer.cpp: In member function ‘virtual void* GlRenderer::prepare(const tvg::RenderShape&, tvg::RenderData, const tvg::RenderTransform*, uint32_t, tvg::Array<void*>&, tvg::RenderUpdateFlag, bool)’:
../src/lib/gl_engine/tvgGlRenderer.cpp:215:21: warning: ‘alphaS’ may be used uninitialized in this function [-Wmaybe-uninitialized]
215 | uint8_t alphaF, alphaS;
Change-Id: I65d6cc0b6449342232287f295c06ef640e50b389
Hermet Park [Sun, 15 Jan 2023 11:20:43 +0000 (20:20 +0900)]
common shape: code refactoring & data optimization.
re-design the shape data structure so that render backends
are able to access them directly.
This also let us remove tvgShape member data from the Shape::Impl.
To achieve this, migrate shape/stroke/path
from the canvas interface to the render interface.
Change-Id: Iac398dedec39c6bc88fa4c1c3cfdb3f5db4c25e2
Hermet Park [Sat, 28 Jan 2023 02:44:40 +0000 (11:44 +0900)]
common paint: keep clean apis and small size.
these are no more necessary.
Change-Id: I315b39c77c413da1bc6102cabd5d797a1931eb9b
Hermet Park [Sat, 28 Jan 2023 02:36:54 +0000 (11:36 +0900)]
common: enhance clipping behavior.
If a paint is used as a clipper, it must be determined in the paint behavior.
Propagate its decision to the immediate derived classes so that
not only shapes but also scenes must be dealt as a clipper properly.
This revised this change
0de3872be33793d2c8db03d5b85da38670410626
for better a solution.
Change-Id: I5525cc3ce952b74eec2a52f3bdc769f5ed600f58
Hermet Park [Sun, 22 Jan 2023 00:53:27 +0000 (09:53 +0900)]
svg loader: correct clipper usage.
that has been changed by
0de3872be33793d2c8db03d5b85da38670410626
Change-Id: If0b014910235253416ca8585b6fd5fe336538f4c
Mira Grudzinska [Tue, 27 Dec 2022 15:21:42 +0000 (16:21 +0100)]
common: ignoring color/alpha/opacity of a clip object
According to the svg specs clip's fill and opacity
should be ignored. Till now setting the alpha/opacity
value to zero resulted in the shape's rendering abort.
@Issue: https://github.com/Samsung/thorvg/issues/1192
Change-Id: I76c10068d6d35dc171be3c936c5429ea1a3becf1
Mira Grudzinska [Tue, 17 Jan 2023 12:11:43 +0000 (13:11 +0100)]
svg_loader: overwrite the clip's opacity/alpha
According to the svg standard the clips opacity
doesn't affect the final rendering. In order to
avoid any confusion the opacity values are
overwritten by the max possible value.
Change-Id: I96699a2f74e97fae0a940e18d834f258a8c4cd86
jykeon [Wed, 15 Mar 2023 03:35:26 +0000 (12:35 +0900)]
Bump up 0.8.8
Change-Id: Ia2288194406d03caa4149af22e5d1ce495a41f64
Signed-off-by: jykeon <jykeon@samsung.com>
Chun [Wed, 15 Mar 2023 03:23:47 +0000 (03:23 +0000)]
Merge "updated copyright." into tizen
Chun [Wed, 15 Mar 2023 03:23:43 +0000 (03:23 +0000)]
Merge "doc: updated the header description." into tizen
Chun [Wed, 15 Mar 2023 03:23:36 +0000 (03:23 +0000)]
Merge changes Id77eb8df,I4e07b5bf,Ia2ea6f99,I03369fe9,Ife206ab7 into tizen
* changes:
svg loader: correct clipper usage.
example: correct clipper usage.
examples: ClipPath's modified
common: ignoring color/alpha/opacity of a clip object
svg_loader: overwrite the clip's opacity/alpha
Chun [Wed, 15 Mar 2023 03:23:29 +0000 (03:23 +0000)]
Merge "updated copyright." into tizen
Chun [Wed, 15 Mar 2023 03:23:24 +0000 (03:23 +0000)]
Merge "svg_loader: fixing crash for to big buffer" into tizen
Chun [Wed, 15 Mar 2023 03:21:32 +0000 (03:21 +0000)]
Merge "all: Trailing spaces removed" into tizen
Hermet Park [Sat, 28 Jan 2023 02:36:54 +0000 (11:36 +0900)]
updated copyright.
Change-Id: I6b3ff60849bdb849ce09555624593145e07af7d3
Hermet Park [Sun, 22 Jan 2023 01:15:03 +0000 (10:15 +0900)]
doc: updated the header description.
Change-Id: Ib5fc0343dce8adef2ffdeefca583219aeafe1d90
Hermet Park [Sun, 22 Jan 2023 00:53:27 +0000 (09:53 +0900)]
svg loader: correct clipper usage.
that has been changed by
0de3872be33793d2c8db03d5b85da38670410626
Change-Id: Id77eb8df0063ef4ddd42ed7cf94a05a076486ed8
Hermet Park [Sun, 22 Jan 2023 00:55:10 +0000 (09:55 +0900)]
example: correct clipper usage.
it has been changed by
0de3872be33793d2c8db03d5b85da38670410626
Change-Id: I4e07b5bf178f13387dad526772d2ab6c68c57f14
Mira Grudzinska [Sun, 15 Jan 2023 15:39:25 +0000 (16:39 +0100)]
examples: ClipPath's modified
The opacity/alpha value doesn't need to be set
for clips any more.
Change-Id: Ia2ea6f99f1d9c666348e3ef1cfb57629972296c9
Mira Grudzinska [Tue, 27 Dec 2022 15:21:42 +0000 (16:21 +0100)]
common: ignoring color/alpha/opacity of a clip object
According to the svg specs clip's fill and opacity
should be ignored. Till now setting the alpha/opacity
value to zero resulted in the shape's rendering abort.
@Issue: https://github.com/Samsung/thorvg/issues/1192
Change-Id: I03369fe91f811e7d6950dab1b594824cbfb7f9fe
Mira Grudzinska [Tue, 17 Jan 2023 12:11:43 +0000 (13:11 +0100)]
svg_loader: overwrite the clip's opacity/alpha
According to the svg standard the clips opacity
doesn't affect the final rendering. In order to
avoid any confusion the opacity values are
overwritten by the max possible value.
Change-Id: Ife206ab742023bd3e4d2f0952f0a51ce2b53e75a
Hermet Park [Sat, 14 Jan 2023 04:27:22 +0000 (13:27 +0900)]
updated copyright.
Change-Id: I3072e2bc6c6be08d97a94492e29929c60e667086
Mira Grudzinska [Fri, 6 Jan 2023 23:04:31 +0000 (00:04 +0100)]
svg_loader: fixing crash for to big buffer
Crash observed on macOS for the image-embeded-*.svg files.
Since the alloca function was used the stack allocation failure
could not be handled.
Change-Id: Ibc38ef8f8f407145e7490c221a24786b99ed2d04
Mira Grudzinska [Fri, 6 Jan 2023 23:47:59 +0000 (00:47 +0100)]
all: Trailing spaces removed
Change-Id: I09f10f1b342b352c39cce734a2fce5d93091a9d0
jykeon [Tue, 14 Mar 2023 09:21:59 +0000 (18:21 +0900)]
Bump up 0.8.7
Change-Id: I97bb1f3bdb6978d3e8ccc56e734177657c55ec48
Signed-off-by: jykeon <jykeon@samsung.com>
Chun [Tue, 14 Mar 2023 09:19:35 +0000 (09:19 +0000)]
Merge changes I6d68fe18,Ieabe9819,I7eeea6c2,Ib5e5d6ac,I96dc2387, ... into tizen
* changes:
svg_loader: fixing name
examples: fixing the crash for disabled loaders
examples: keep aspect ratio of svg images.
paint: fastTrack should return false for the skew transformations
common Util: Move to before decimal part calculation
common Util: Skip if there is a space after the dot
svg_loader: Change SVG viewbox variable type from int to float
test picture: add picture mesh api unit test
Chun [Tue, 14 Mar 2023 09:18:45 +0000 (09:18 +0000)]
Merge "common picture: +exception handling." into tizen
Chun [Tue, 14 Mar 2023 09:18:27 +0000 (09:18 +0000)]
Merge "saver/loader tvg: support picture mesh properties." into tizen
Mira Grudzinska [Fri, 6 Jan 2023 23:53:23 +0000 (00:53 +0100)]
svg_loader: fixing name
_parserColor -> _parseColor
Change-Id: I6d68fe18ff6a8029627bd42b409be1048ef3516a
Mira Grudzinska [Fri, 6 Jan 2023 22:33:42 +0000 (23:33 +0100)]
examples: fixing the crash for disabled loaders
ImageScaleUp/ImageScaleDown fixed.
Change-Id: Ieabe9819f2eb9ec8378544ce3a9c5da142a570b3
Hermet Park [Fri, 6 Jan 2023 17:19:42 +0000 (02:19 +0900)]
examples: keep aspect ratio of svg images.
changed by
3939b61770c14602d7e349ba0baa21d9f4d97a44
Change-Id: I7eeea6c23439b07b9f298080ef80b28ef48cac7d
Mira Grudzinska [Tue, 27 Dec 2022 17:32:43 +0000 (18:32 +0100)]
paint: fastTrack should return false for the skew transformations
Change-Id: Ib5e5d6aca3d732963ac9855b0a79e1055dcf3d7c
JunsuChoi [Tue, 13 Dec 2022 02:53:50 +0000 (11:53 +0900)]
common Util: Move to before decimal part calculation
Change-Id: I96dc238736eec22f62831850628548ed60d0a08f
JunsuChoi [Mon, 12 Dec 2022 06:08:06 +0000 (15:08 +0900)]
common Util: Skip if there is a space after the dot
Some SVG parsers allow parsing of "0."
If there is a space after the dot, skip to the next step.
Change-Id: Ic1c455e2d5b8bf1e344af903f9721885c9fa1d37
jykeon [Tue, 14 Mar 2023 08:55:49 +0000 (17:55 +0900)]
Bump up 0.8.6
Change-Id: I6edfda6fec874391f3859b114caf75cfcbed3fec
Signed-off-by: jykeon <jykeon@samsung.com>
JunsuChoi [Mon, 12 Dec 2022 04:38:43 +0000 (13:38 +0900)]
svg_loader: Change SVG viewbox variable type from int to float
The viewbox and size(width, height) defined in SVG can be of type float.
This prevents matrix calculation errors caused by this.
Change-Id: I85dd502b63dc9a13e969bd459e1f98975c0ef6ed
Hermet Park [Thu, 8 Dec 2022 14:47:57 +0000 (23:47 +0900)]
test picture: add picture mesh api unit test
@Issue: https://github.com/Samsung/thorvg/issues/1241
Change-Id: I52234dd9136428a01526301e94241c26507a997d
Hermet Park [Thu, 8 Dec 2022 14:44:04 +0000 (23:44 +0900)]
common picture: +exception handling.
invalid arguments won't be allowed.
Change-Id: Ia70a3d112e8e8cee36ee1cb05085c95b0402f546
Hermet Park [Wed, 7 Dec 2022 07:20:47 +0000 (16:20 +0900)]
saver/loader tvg: support picture mesh properties.
this mesh properites newly introduced in v0.8
(see:
3dd65dfed00849f0bd9d0bb0ade177fa961cd7a5)
tvg saver/loader should implement mesh support to
properly capture/replay the scene snapshot.
@Issue: https://github.com/Samsung/thorvg/issues/1242
Change-Id: Id48e50be8093c2f13d3f3b4e1112151974597928
Chun [Tue, 14 Mar 2023 08:49:10 +0000 (08:49 +0000)]
Merge "common Accessor: removed deprecated api." into tizen
Chun [Tue, 14 Mar 2023 08:48:59 +0000 (08:48 +0000)]
Merge "Update README.md" into tizen
Chun [Tue, 14 Mar 2023 08:48:48 +0000 (08:48 +0000)]
Merge "common Accessor: Add access API using std::function" into tizen
Chun [Tue, 14 Mar 2023 08:48:21 +0000 (08:48 +0000)]
Merge "common Accessor: Add access api that with data parameter" into tizen
Chun [Tue, 14 Mar 2023 08:48:10 +0000 (08:48 +0000)]
Merge "[svg2png] size limitation while converting the file" into tizen
Chun [Tue, 14 Mar 2023 08:48:00 +0000 (08:48 +0000)]
Merge "SwRaster: Remove comment" into tizen
Chun [Tue, 14 Mar 2023 08:47:47 +0000 (08:47 +0000)]
Merge "SwRaster: Prevent memory issue" into tizen
Hermet Park [Sat, 26 Nov 2022 09:47:55 +0000 (18:47 +0900)]
common Accessor: removed deprecated api.
the old version of Accessor::access() is redundant,
we replaced it with set().
It's still under the beta, we can remove it immediately.
Note that we've planned to promote them official APIs in v0.9.
Newly changed, tagging beta again...w
Change-Id: I1afa8424c81daabe214f5dd704678aa35da610ba
Hermet Park [Sat, 26 Nov 2022 04:41:36 +0000 (13:41 +0900)]
Update README.md
added godot practice.
Change-Id: I5caa77cfb7377123cf3cb26a61690b4b1285cb9c
JunsuChoi [Thu, 24 Nov 2022 04:46:44 +0000 (20:46 -0800)]
common Accessor: Add access API using std::function
Change-Id: I50eb9443137f40d329105fea24739a549dd0ea41
JunsuChoi [Fri, 18 Nov 2022 08:09:35 +0000 (00:09 -0800)]
common Accessor: Add access api that with data parameter
It supports data parameters that
can pass user data to the callback function.
Change-Id: I7b5ea2a2861a741bf7da205c495e8c192c7aeb8c
std::unique_ptr<Picture> access(std::unique_ptr<Picture> picture, bool(*func)(const Paint* paint, void* data), void* data) noexcept;
Mira Grudzinska [Sun, 20 Nov 2022 19:46:50 +0000 (20:46 +0100)]
[svg2png] size limitation while converting the file
In case the svg file size is too large, a heap overflow occurred
when conversting to png. To prevent this a size limitation
has been added - the resolution of the resulting png file cannot
be higher than 8k (7680 x 4320).
Change-Id: Iba8cf11a3afc47a0594b2ff07862fc8ee410002f
JunsuChoi [Tue, 4 Oct 2022 01:08:52 +0000 (10:08 +0900)]
SwRaster: Remove comment
Change-Id: If45195fcba8dda3d2e08a3884428e365ec6f6f9f
JunsuChoi [Thu, 29 Sep 2022 02:11:34 +0000 (11:11 +0900)]
SwRaster: Prevent memory issue
If vv goes out of buffer, it can cause potential memory problems.
Therefore, an `if condition` is added so that it does not exceed the height of the image.
This is temporary fix.
Test)
meson -Db_sanitize=address,undefined -Dexamples=true . build
$ ./build/src/examples/Texmap
==6298==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f37fd6c2180 at pc 0x7f380d884599 bp 0x7fffb02b2db0 sp 0x7fffb02b2da0
READ of size 4 at 0x7f37fd6c2180 thread T0
#0 0x7f380d884598 in _rasterPolygonImageSegment ../src/lib/sw_engine/tvgSwRasterTexmapInternal.h:107
#1 0x7f380d887694 in _rasterPolygonImage ../src/lib/sw_engine/tvgSwRasterTexmap.h:271
#2 0x7f380d88a598 in _rasterTexmapPolygonMesh ../src/lib/sw_engine/tvgSwRasterTexmap.h:639
#3 0x7f380d89828d in _transformedRGBAImageMesh ../src/lib/sw_engine/tvgSwRaster.cpp:701
#4 0x7f380d89828d in rasterImageMesh(SwSurface*, SwImage*, tvg::Polygon const*, unsigned int, tvg::Matrix const*, SwBBox const&, unsigned int) ../src/lib/sw_engine/tvgSwRaster.cpp:1585
#5 0x7f380d89bf16 in tvg::SwRenderer::renderImageMesh(void*) ../src/lib/sw_engine/tvgSwRenderer.cpp:369
#6 0x7f380d830e7e in tvg::Paint::Impl::render(tvg::RenderMethod&) ../src/lib/tvgPaint.cpp:178
#7 0x7f380d823bd2 in tvg::Canvas::Impl::draw() (/home/junsu/dev/os/thorvg/build/src/examples/../libthorvg.so.0+0x265bd2)
#8 0x7f380d821e79 in tvg::Canvas::draw() ../src/lib/tvgCanvas.cpp:60
#9 0x557d07b2d5b6 in drawSwView(void*, _Eo_Opaque*) ../src/examples/Texmap.cpp:103
#10 0x7f380cb7d2aa in evas_process_dirty_pixels ../src/lib/evas/canvas/evas_object_image.c:1894
#11 0x7f380cb7d2aa in _evas_image_pixels_get ../src/lib/evas/canvas/evas_object_image.c:2318
#12 0x7f380cb7d85e in _evas_image_render ../src/lib/evas/canvas/evas_object_image.c:2468
#13 0x7f380cb7ea0c in evas_object_image_render ../src/lib/evas/canvas/evas_object_image.c:2271
#14 0x7f380cbe51db in evas_render_mapped ../src/lib/evas/canvas/evas_render.c:2290
#15 0x7f380cbe6f15 in evas_render_updates_internal_loop ../src/lib/evas/canvas/evas_render.c:3158
#16 0x7f380cbe9912 in evas_render_updates_internal ../src/lib/evas/canvas/evas_render.c:3631
#17 0x7f380cbeb31c in _evas_canvas_render_async ../src/lib/evas/canvas/evas_render.c:4094
#18 0x7f380cb6634a in evas_canvas_render_async ../src/lib/evas/canvas/evas_canvas_eo.c:168
#19 0x7f380cb6fce5 in evas_render_async ../src/lib/evas/canvas/evas_canvas_eo.legacy.c:179
#20 0x7f37f3a81555 in _ecore_evas_x_render ../src/modules/ecore_evas/engines/x/ecore_evas_x.c:761
#21 0x7f3809677e42 in _ecore_evas_idle_enter ../src/lib/ecore_evas/ecore_evas.c:295
#22 0x7f38098a89a4 in _ecore_call_task_cb ../src/lib/ecore/ecore_private.h:456
#23 0x7f38098a89a4 in _ecore_factorized_idle_process ../src/lib/ecore/ecore_idler.c:35
#24 0x7f3809b29081 in _event_callback_call ../src/lib/eo/eo_base_class.c:2114
#25 0x7f3809b29081 in _efl_object_event_callback_call ../src/lib/eo/eo_base_class.c:2186
#26 0x7f3809b22d22 in efl_event_callback_call ../src/lib/eo/eo_base_class.c:2189
#27 0x7f38098aae44 in _ecore_main_loop_iterate_internal ../src/lib/ecore/ecore_main.c:2466
#28 0x7f38098ab689 in _ecore_main_loop_begin ../src/lib/ecore/ecore_main.c:1231
#29 0x7f38098b05e0 in _efl_loop_begin ../src/lib/ecore/efl_loop.c:57
#30 0x7f38098af77c in efl_loop_begin src/lib/ecore/efl_loop.eo.c:28
#31 0x7f38098ab755 in ecore_main_loop_begin ../src/lib/ecore/ecore_main.c:1316
#32 0x7f380d14ba1f in elm_run ../src/lib/elementary/elm_main.c:1359
#33 0x557d07b2d298 in main ../src/examples/Texmap.cpp:176
#34 0x7f380b533c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#35 0x557d07b2d3c9 in _start (/home/junsu/dev/os/thorvg/build/src/examples/Texmap+0xb3c9)
Change-Id: I732019b5ac8aa01d200c1036e56d5a7143544c30
jykeon [Tue, 14 Mar 2023 08:05:15 +0000 (17:05 +0900)]
Bump up 0.8.5
Change-Id: I8be041ac09cf457cc85d976ac2093b1886b45497
Signed-off-by: jykeon <jykeon@samsung.com>
Hermet Park [Fri, 2 Sep 2022 03:02:39 +0000 (12:02 +0900)]
svg loader: remove unused logic.
Please keep it simple and easy.
Don't leave a chance compiler warn it.
Change-Id: I48e7928131172ff50c223fb450e57fb18d237437
Mira Grudzinska [Fri, 2 Sep 2022 02:59:49 +0000 (04:59 +0200)]
svg_loader: preserveAspectRatio attrib handled according to the svg standard (#1249)
* svg_loader: preserveAspectRatio attrib handled according to the svg standard
* svg_loader: symbol fixed
The correct width/height values used in the _useBuildHelper function.
Bug was propageted while the preserveAspectRatio attrib was handled,
now fixed.
* svg_loader: refactoring code regarding the preserveAspectRatio attrib
To avoid copy/paste a new function is introduced to handle the proper
scaling.
* svg_loader: initialize the svg loader members
The 'align' and 'meetOrSlice' svg loader members were not initialized.
* svg_loader: resize function forces any transformation
The resize function is called after the svg image is read and scaled
taking into account the proper preserveAspectRatio value. While resizing
the preserveAspectRatio isn't checked any more and the image can be
freely transformed.
Change-Id: I5ec14b7676063f60c1fc3b12262cc06f85f64e97
Mira Grudzinska [Wed, 31 Aug 2022 23:15:59 +0000 (01:15 +0200)]
svg_loader: deeper search for postponed nodes
Till now the proper node was searched only among children,
now all the nodes are checked.
Change-Id: I46b9fa1de2de3cc5c53e327f0e6bb6b6dd415fc9
Mira Grudzinska [Thu, 1 Sep 2022 18:53:39 +0000 (20:53 +0200)]
svg_loader: prevent stack-overflow for nested nodes
Change-Id: Ib479c8af995f2b7576503dbd182defd4a1747d9d
JunsuChoi [Wed, 31 Aug 2022 09:07:40 +0000 (18:07 +0900)]
svg_loader: No skip luma mask when composition node is image
Improved to skip Luma Mask when conditions are the same
as AlphaMask for optimization in
e409bb29.
If the composition node is an image, it is not skipped because
it is not known for sure whether to skip it.
Change-Id: I82d1c5ab0ad4bf9624913a574556ea7ae7709a7e
Mira Grudzinska [Tue, 30 Aug 2022 22:21:59 +0000 (00:21 +0200)]
svg_loader: prevent mem leaks
A necessary check added before strdup function is called
Change-Id: Ibc1cbfc29ea342d5ca31390b306943f7d5f6e25d
JunsuChoi [Tue, 30 Aug 2022 01:54:20 +0000 (10:54 +0900)]
svg_loader: Remove unnecessary code
Change-Id: Ia3e0d35ed48b3c04c2408ca24d48bf43c32cc54c
JunsuChoi [Mon, 29 Aug 2022 04:32:06 +0000 (13:32 +0900)]
svg_loader: If there is already set color url, it will be deleted.
When setting the url for color, if there is an already set url,
it will be overwritten after deletion. This prevents memory leaks.
asan result)
Direct leak of 2 byte(s) in 1 object(s) allocated from:
#0 0x7ff1d547bc68 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bc68)
#1 0x7ff1d4e435b4 in _idFromUrl ../src/loaders/svg/tvgSvgLoader.cpp:327
#2 0x7ff1d4e44a8e in _toColor ../src/loaders/svg/tvgSvgLoader.cpp:558
#3 0x7ff1d4e42ee9 in _parseStyleAttr ../src/loaders/svg/tvgSvgLoader.cpp:1033
#4 0x7ff1d4e7f092 in simpleXmlParseAttributes(char const*, unsigned int, bool (*)(void*, char const*, char const*), void const*) ../src/loaders/svg/tvgXmlParser.cpp:361
#5 0x7ff1d4e597d3 in _createPathNode ../src/loaders/svg/tvgSvgLoader.cpp:1363
#6 0x7ff1d4e61359 in _svgLoaderParserXmlOpen ../src/loaders/svg/tvgSvgLoader.cpp:2723
#7 0x7ff1d4e61c49 in _svgLoaderParser ../src/loaders/svg/tvgSvgLoader.cpp:2801
#8 0x7ff1d4e7f3f6 in simpleXmlParse(char const*, unsigned int, bool, bool (*)(void*, SimpleXMLType, char const*, unsigned int), void const*) ../src/loaders/svg/tvgXmlParser.cpp:429
#9 0x7ff1d4e639a1 in SvgLoader::run(unsigned int) ../src/loaders/svg/tvgSvgLoader.cpp:3121
#10 0x7ff1d4dc8b75 in tvg::Task::operator()(unsigned int) ../src/lib/tvgTaskScheduler.h:68
#11 0x7ff1d4dc8b75 in tvg::TaskSchedulerImpl::run(unsigned int) ../src/lib/tvgTaskScheduler.cpp:138
#12 0x7ff1d4dc98f7 in tvg::TaskSchedulerImpl::TaskSchedulerImpl(unsigned int)::{lambda()#1}::operator()() const ../src/lib/tvgTaskScheduler.cpp:113
#13 0x7ff1d4dc98f7 in void std::__invoke_impl<void, tvg::TaskSchedulerImpl::TaskSchedulerImpl(unsigned int)::{lambda()#1}>(std::__invoke_other, tvg::TaskSchedulerImpl::TaskSchedulerImpl(unsigned int)::{lambda()#1}&&) /usr/include/c++/9/bits/invoke.h:60
#14 0x7ff1d4dc98f7 in std::__invoke_result<tvg::TaskSchedulerImpl::TaskSchedulerImpl(unsigned int)::{lambda()#1}>::type std::__invoke<tvg::TaskSchedulerImpl::TaskSchedulerImpl(unsigned int)::{lambda()#1}>(std::__invoke_result&&, (tvg::TaskSchedulerImpl::TaskSchedulerImpl(unsigned int)::{lambda()#1}&&)...) /usr/include/c++/9/bits/invoke.h:95
#15 0x7ff1d4dc98f7 in void std::thread::_Invoker<std::tuple<tvg::TaskSchedulerImpl::TaskSchedulerImpl(unsigned int)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/9/thread:244
#16 0x7ff1d4dc98f7 in std::thread::_Invoker<std::tuple<tvg::TaskSchedulerImpl::TaskSchedulerImpl(unsigned int)::{lambda()#1}> >::operator()() /usr/include/c++/9/thread:251
#17 0x7ff1d4dc98f7 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<tvg::TaskSchedulerImpl::TaskSchedulerImpl(unsigned int)::{lambda()#1}> > >::_M_run() /usr/include/c++/9/thread:195
#18 0x7ff1d3a344bf (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44bf)
example)
<svg height="400" width="600" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<defs>
<radialGradient r="12" fy="10" fx="10" cy="10" cx="10" id="i" xlink:href="#d"/>
<clipPath id="g" clipPathUnits="userSpaceOnUse">
<path d="M0 10 10z" style="marker:none" fill="#fff" stroke-width="2"/>
</clipPath>
</defs>
<path d="M0 10 Z" fill="url(#g)" style="fill:url(#i);fill-opacity:1"/>
</svg>
Change-Id: I14c605e7555dbda19113b9f9027954654e423f4b
Mira Grudzinska [Sun, 28 Aug 2022 21:45:29 +0000 (23:45 +0200)]
svg_loader: fill and stroke paiint url were copied twice
The url were copied in the _copyAttr and in the _styleCopy
functions.
Change-Id: Ia68f3f4be8c68e4be517d1376e0cf68e1d468bcc
Mira Grudzinska [Sun, 28 Aug 2022 22:06:52 +0000 (00:06 +0200)]
svg_loader: only the first css style node is interpreted
Since the css id selector is not supported in TVG, only the first
style node is taken into account.
Change-Id: I23775d42f03668372ccae770d9cb6164bebf2ee2
Mira Grudzinska [Sat, 29 Jan 2022 22:03:58 +0000 (23:03 +0100)]
svg_loader: a css style node shouldn't have a parent
This node is supposed to be separeted from the main tree nodes.
Change-Id: I3cdfc679ef38ca8eee7750c173b7fcc87d8bdd27
jykeon [Tue, 14 Mar 2023 04:26:38 +0000 (13:26 +0900)]
Bump up 0.8.4
Change-Id: Idb062490ebc372e629145db3d8f59592dd0081a4
Signed-off-by: jykeon <jykeon@samsung.com>
Vincent Torri [Wed, 24 Aug 2022 11:09:56 +0000 (13:09 +0200)]
Fix compilation error on Windows
Change-Id: Id9862cbce599596661bbb7d71d70f8732a32ef60
Hermet Park [Tue, 23 Aug 2022 13:44:24 +0000 (22:44 +0900)]
examples: fix a compilation error on windows.
../src/examples/Performance.cpp:32:8: error: 'uint' does not name a type; did you mean 'u_int'?
32 | static uint cnt = 0;
| ^~~~
| u_int
@Issues: https://github.com/Samsung/thorvg/issues/1247
Change-Id: I3f9ae082a89d32519517bedce68cdd5e0c21564b
Vincent Torri [Sat, 20 Aug 2022 08:55:16 +0000 (10:55 +0200)]
fix compilation of svg2png on Windows
Change-Id: I9d7dda51a99d0112357bb61cb19f9b55ce802ac1
Hermet Park [Sat, 20 Aug 2022 06:21:31 +0000 (15:21 +0900)]
common picture: code refactoring.
keep api parameter naming consistency.
ptsCnt, cmdCnt, triangleCnt ...
Change-Id: Ie2b6c7e7781877700dd446a838c254ef73d02413
Hermet Park [Sat, 20 Aug 2022 05:44:20 +0000 (14:44 +0900)]
common picture: code refactoring.
++ neat & clean
Change-Id: I40a28efd77c5bd1dc680fb9a774196a263397e91