platform/core/graphics/tizenvg.git
3 years agoAdd files via upload
Hermet Park [Wed, 11 Aug 2021 15:39:36 +0000 (00:39 +0900)]
Add files via upload

3 years agoDelete example_tvgsize.png
Hermet Park [Wed, 11 Aug 2021 15:38:31 +0000 (00:38 +0900)]
Delete example_tvgsize.png

3 years agoFix build error with log option 62/262562/1
JunsuChoi [Fri, 13 Aug 2021 08:06:11 +0000 (17:06 +0900)]
Fix build error with log option

Change-Id: I716b8b72a1d050d414d6664491144d1a800bd838

3 years agosw_engine: memory optimization.
Hermet Park [Thu, 12 Aug 2021 11:06:07 +0000 (20:06 +0900)]
sw_engine: memory optimization.

Save the size of the Countour array,
16 bits is large enough to count the points number in one Shape.

3 years agosw_engine shape: fix a corner case that close tag is overwritten with a wrong value.
Hermet Park [Thu, 12 Aug 2021 10:40:59 +0000 (19:40 +0900)]
sw_engine shape: fix a corner case that close tag is overwritten with a wrong value.

if the last contour dispatching is dealt with closed command but actual command
is not the closed, the close tag is written with the opened

In this case, stroking rendering is buggy.

3 years agotvg_saver: optimize tvg format.
Hermet Park [Tue, 10 Aug 2021 08:43:28 +0000 (17:43 +0900)]
tvg_saver: optimize tvg format.

So this optimization stragtegy is to merging shapes.
If two shapes have the same layer, having save properties except the paths,
we can integrate two shapes to one, this helps to build up a simpler
scene-tree, reduce the runtime memory, helps for faster processing for rendering.

As far as I checked tiger.svg, it removes 142 shape nodes,
decreased the binary size: 60537 -> 54568.

Overall, avg 4% binary size can be reduced among our example svgs by this patch.

3 years agosw_engine: allow sharing shapes & connected strokes all in one.
Hermet Park [Thu, 12 Aug 2021 04:09:47 +0000 (13:09 +0900)]
sw_engine: allow sharing shapes & connected strokes all in one.

This patch enhanced the sw raster engine to allow the both closed & open pathes
in one shape rendering.

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

3 years agoAdd files via upload
Hermet Park [Wed, 11 Aug 2021 15:39:36 +0000 (00:39 +0900)]
Add files via upload

3 years agoDelete example_tvgsize.png
Hermet Park [Wed, 11 Aug 2021 15:38:31 +0000 (00:38 +0900)]
Delete example_tvgsize.png

3 years agoAdd files via upload
Hermet Park [Wed, 11 Aug 2021 15:37:56 +0000 (00:37 +0900)]
Add files via upload

3 years agoDelete example_tvg.webp
Hermet Park [Wed, 11 Aug 2021 15:37:44 +0000 (00:37 +0900)]
Delete example_tvg.webp

3 years agoDelete example_tvgsize.png
Hermet Park [Wed, 11 Aug 2021 15:37:36 +0000 (00:37 +0900)]
Delete example_tvgsize.png

3 years agoAdd files via upload
Hermet Park [Wed, 11 Aug 2021 15:36:27 +0000 (00:36 +0900)]
Add files via upload

3 years agoUpdate README.md
Hermet Park [Wed, 11 Aug 2021 15:35:57 +0000 (00:35 +0900)]
Update README.md

3 years agoAdd files via upload
Hermet Park [Wed, 11 Aug 2021 15:33:57 +0000 (00:33 +0900)]
Add files via upload

3 years agoAdd files via upload
Hermet Park [Wed, 11 Aug 2021 15:31:53 +0000 (00:31 +0900)]
Add files via upload

3 years agoUpdate README.md
Hermet Park [Wed, 11 Aug 2021 15:31:28 +0000 (00:31 +0900)]
Update README.md

3 years agocommon: RenderRegion x, y protect against negative value in unsigned int
Michal Maciola [Tue, 10 Aug 2021 15:22:37 +0000 (17:22 +0200)]
common: RenderRegion x, y protect against negative value in unsigned int

This change protects against negative value in unsigned int of
RenderRegion.x/y. This fixes a problem of invisible paint if ClipPath
bounds was negative.

@issue: #704

3 years agotvg_saver: optimize saving data.
Hermet Park [Tue, 10 Aug 2021 02:54:24 +0000 (11:54 +0900)]
tvg_saver: optimize saving data.

This optimizes binary size by skipping the scene if it has the only child.

though the reduced size is too trivial size (avg 0.4% as far as I checked our example svgs),
we can reduce the loading job & runtime memory as well.

3 years agocommon interator: add count() interface.
Hermet Park [Tue, 10 Aug 2021 01:52:43 +0000 (10:52 +0900)]
common interator: add count() interface.

3 years agotvg_saver: skip the invisible paint as possible.
Hermet Park [Mon, 9 Aug 2021 11:31:49 +0000 (20:31 +0900)]
tvg_saver: skip the invisible paint as possible.

3 years ago--annoying compiler warnings.
Hermet Park [Mon, 9 Aug 2021 12:21:01 +0000 (21:21 +0900)]
--annoying compiler warnings.

3 years agoenable neon vectorization. 80/262380/2
Hermet Park [Mon, 9 Aug 2021 11:26:30 +0000 (20:26 +0900)]
enable neon vectorization.

Change-Id: Idbbc47eebd3776899179ca9497206c0bbe958a0f

3 years agodoc api: updated missed version info.
Hermet Park [Mon, 9 Aug 2021 09:21:45 +0000 (18:21 +0900)]
doc api: updated missed version info.

Change-Id: I3768a050884fa76e845c81459b277a1bccc706f1

3 years agodoc api: up to date v0.4.0
Hermet Park [Mon, 9 Aug 2021 09:19:13 +0000 (18:19 +0900)]
doc api: up to date v0.4.0

3 years agocommon: meson.build added default_options cpp_std=gnu++14
Michal Maciola [Mon, 9 Aug 2021 08:16:17 +0000 (10:16 +0200)]
common: meson.build added default_options cpp_std=gnu++14

3 years agosw_engine raster: move neon implementation to the neon domained file.
Hermet Park [Mon, 9 Aug 2021 11:53:27 +0000 (20:53 +0900)]
sw_engine raster: move neon implementation to the neon domained file.

Change-Id: I084f68269dcb49dace12162726768b77195f2c67

3 years agocommon initializer: remove unnecessary code. accepted/tizen/unified/20210810.135318 submit/tizen/20210809.073037
Hermet Park [Mon, 9 Aug 2021 07:14:36 +0000 (16:14 +0900)]
common initializer: remove unnecessary code.

x is always not equal to zero.

Change-Id: Iab2c3ab541df2c4911461b29342366552bfe052e

3 years agobump up version v0.4.0 64/262364/1
Hermet Park [Mon, 9 Aug 2021 06:37:19 +0000 (15:37 +0900)]
bump up version v0.4.0

Change-Id: Ifadb8643cef023393f0b94d67739138baf69c493

3 years agoinfra: just released v0.4.0
Hermet Park [Mon, 9 Aug 2021 06:21:32 +0000 (15:21 +0900)]
infra: just released v0.4.0

Change-Id: Ib5942f0d2eb880daf0617aab3d5f133fcc8ef984

3 years agocommon initializer: fix out of buffer access by the version info string.
Hermet Park [Mon, 9 Aug 2021 04:20:27 +0000 (13:20 +0900)]
common initializer: fix out of buffer access by the version info string.

String must be finished at termination charactor,
previous logic missed that handling, now fixed.

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

3 years agoinfra: update build test tvg -> tvg_beta
Hermet Park [Mon, 9 Aug 2021 04:51:25 +0000 (13:51 +0900)]
infra: update build test tvg -> tvg_beta

update it as acoording to the last change before v0.4

3 years agoinfra: fix missing tvg -> tvg_beta tag.
Hermet Park [Mon, 9 Aug 2021 03:56:11 +0000 (12:56 +0900)]
infra: fix missing tvg -> tvg_beta tag.

breakage was introduced by 6ad1b1bf732c108ec7e626b9005a76fbc4eb91df

3 years agoinfra: tvg format is still fragile, we gonna release it under the beta.
Hermet Park [Mon, 9 Aug 2021 03:45:17 +0000 (12:45 +0900)]
infra: tvg format is still fragile, we gonna release it under the beta.

Change-Id: Id210f7c29857b78097d93f82eab21df5e1679a12

3 years agocommon picture: recover viewbox() api.
Hermet Park [Mon, 9 Aug 2021 03:30:25 +0000 (12:30 +0900)]
common picture: recover viewbox() api.

though picture has size() api, we have a regression issue in tizen,
we can't remove this api until we resolve any regression conditions.

3 years agotvg_saver: add 4 bytes reserved area for future extensions.
Hermet Park [Fri, 6 Aug 2021 01:38:07 +0000 (10:38 +0900)]
tvg_saver: add 4 bytes reserved area for future extensions.

This memory can be used for storing feature flags.

3 years agotvg_saver: optimize binary format.
Hermet Park [Thu, 5 Aug 2021 11:05:03 +0000 (20:05 +0900)]
tvg_saver: optimize binary format.

Skip to save transform data by accumulating them through the scene tree,
and then applying the final transform to the path points.

Assume that each transform have 36 bytes, it could be increased linear to paints node count
if every paints has transform in the worst case.

Fudamentally, this save their memory and only remains to Bitmap Pictures,
also helps to reduce the loading/rendering workloads since
it doesn't need to perform any transform jobs after converting.

3 years agoJPG loader: print error string on failure
Michal Maciola [Sat, 7 Aug 2021 03:00:04 +0000 (05:00 +0200)]
JPG loader: print error string on failure

Added error string printing on jpg image loading failure.
The error message help developer find the corrupted jpg file.
Error message is not printed for open from char* data as there the
loaders are tried on by one.

3 years agotvg_saver: verify view size earlier before the job is started.
Hermet Park [Fri, 6 Aug 2021 01:30:42 +0000 (10:30 +0900)]
tvg_saver: verify view size earlier before the job is started.

3 years agoinfra : Include dlog.h only when log is enabled 76/262276/1
JunsuChoi [Fri, 6 Aug 2021 01:07:21 +0000 (10:07 +0900)]
infra : Include dlog.h only when log is enabled

Change-Id: I91367053d6a9da83218e0b9bd5ad8638254d4617

3 years agotvg_loader: introduce tvg interpreter base class for future extension.
Hermet Park [Wed, 4 Aug 2021 11:53:51 +0000 (20:53 +0900)]
tvg_loader: introduce tvg interpreter base class for future extension.

tvg binary format might break the compatibility if any major features have been changed.
It's allowed to do it when the major version is upgraded.

In that case, still we need to support the backward compatibility,
we can provide multiple binary interpreters and choose the proper one
based on the current loading tvg binary format version.

Thus, you can add further interpreters if it's necessary in the future.
Our policy is to derive the TvgBinInterpreterBase class to make it running on
the interface.

for example, if the major version is upgraded 1.x, you can implement TvgBinInterpreter1.

3 years agoapi: add deprecated syntax for deprecated apis.
Hermet Park [Thu, 5 Aug 2021 02:15:10 +0000 (11:15 +0900)]
api: add deprecated syntax for deprecated apis.

3 years agocommon picture: return bounding box size with the current image size.
Hermet Park [Thu, 5 Aug 2021 05:57:18 +0000 (14:57 +0900)]
common picture: return bounding box size with the current image size.

if the picture has a bitmap-based image,
it can return the bounding box size with the current image size.

3 years agocommon Shape: Fix check to invalid argument
JunsuChoi [Thu, 5 Aug 2021 05:36:40 +0000 (14:36 +0900)]
common Shape: Fix check to invalid argument

add cmds null check

3 years agotvg loader: code refactoring
Hermet Park [Thu, 5 Aug 2021 04:20:08 +0000 (13:20 +0900)]
tvg loader: code refactoring

revise the mimetype load method to keep it clean & neat.

3 years agoloaders: Pass mimetype to picture::load
Michal Maciola [Thu, 5 Aug 2021 02:02:26 +0000 (04:02 +0200)]
loaders: Pass mimetype to picture::load

* loaders: Pass mimetype to picture::load

Added mimetype attribute to enfaster loading using a proper loader.

@Changed api: Picture::load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false)
@issue: #571

3 years agosw_engine raster: code refactoring.
Hermet Park [Wed, 4 Aug 2021 10:11:12 +0000 (19:11 +0900)]
sw_engine raster: code refactoring.

Separate simd implementation by files to maintain them easier.

Now we have avx, c, neon version implementation base,
we can add implementations to them.

3 years agoinfra: updated meson summary.
Hermet Park [Wed, 4 Aug 2021 10:58:15 +0000 (19:58 +0900)]
infra: updated meson summary.

3 years agosw_engine common: Added neon alpha blending.
Michal Szczecinski [Tue, 3 Aug 2021 13:33:29 +0000 (15:33 +0200)]
sw_engine common: Added neon alpha blending.

Changes:
- Prepare neon verison of ALPHA_BLEND API.
- Use ALPHA_BLEND_NEON in _translucentRle

Notes:
- _translucentRle with neon support reduces execution time of this
function ~ 300 % (measured on uint32_t 400 x 400 buffer).
- API was tested on ARMv7l device with GCC 9.2 based toolchain. Results
  on other devices could be different.

3 years agotvg_format: force to check for compatibility by version comparision.
Hermet Park [Wed, 4 Aug 2021 06:31:06 +0000 (15:31 +0900)]
tvg_format: force to check for compatibility by version comparision.

tvg file stores the version info of thorvg when it's generated,
in order to compare it with the runtime thorvg version when it's loaded.

For this, thorvg builds up the current version of symbol on the initilaization step,
that can be referred by the tvg loader.

3 years agocommon loader: use RawLoader class immediately.
Hermet Park [Wed, 4 Aug 2021 06:26:48 +0000 (15:26 +0900)]
common loader: use RawLoader class immediately.

no need to find it here.

3 years agoloader: removed loader finding for LoaderMgr::loader(data, w, h, copy)
Michal Maciola [Tue, 3 Aug 2021 10:56:31 +0000 (12:56 +0200)]
loader: removed loader finding for LoaderMgr::loader(data, w, h, copy)

LoaderMgr::loader(data, w, h, copy) is dedicated for raw images only.
No need to try other loaders.

3 years agobump up version 0.3.3 00/262200/1 submit/tizen/20210804.055919
Hermet Park [Wed, 4 Aug 2021 05:41:39 +0000 (14:41 +0900)]
bump up version 0.3.3

Change-Id: I7788d4c1bad31098e64f3baa86d1f83a65be1e34

3 years agotvg_saver: do not pass through if the view size is invalid.
Hermet Park [Fri, 30 Jul 2021 03:40:02 +0000 (12:40 +0900)]
tvg_saver: do not pass through if the view size is invalid.

3 years agocommon loader: lookup in the numberic order.
Hermet Park [Fri, 30 Jul 2021 03:34:56 +0000 (12:34 +0900)]
common loader: lookup in the numberic order.

3 years agosvg_loader SvgLoader: Add 'href' attribute for parser
JunsuChoi [Fri, 30 Jul 2021 02:47:04 +0000 (11:47 +0900)]
svg_loader SvgLoader: Add 'href' attribute for parser

"xlink:href" will be deprecated.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href

3 years agodexample Picture: improve the test coverage.
Hermet Park [Fri, 30 Jul 2021 02:01:08 +0000 (11:01 +0900)]
dexample Picture: improve the test coverage.

In this patch, it replaced the test images with Lenna.
and fix the wrong jpeg file size figuring.

3 years agotvg_format: optimize data format
Hermet Park [Thu, 29 Jul 2021 11:25:49 +0000 (20:25 +0900)]
tvg_format: optimize data format

This reduces tvg binary format size by converting PathCommand to more compact size.

This optimization increase +12% compress rate with our example:

195,668 => 174,071 (sum of all converted tvgs from svgs)

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

3 years agosw_engine Raster: Apply bilinear interpolation to images
JunsuChoi [Fri, 30 Jul 2021 01:31:59 +0000 (10:31 +0900)]
sw_engine Raster: Apply bilinear interpolation to images

* Apply bilinear interpolation to images

Apply bilinear interpolation when drawing images with transformation
If the mapped coordinate value is a floating point value,
bilinear interpolation is performed using adjacent pixel values.
Interpolation is not performed in cases when the color values to beinterpolated
are the same or scale down case.

3 years agotvg_saver: code refactoring.
Hermet Park [Thu, 29 Jul 2021 11:08:38 +0000 (20:08 +0900)]
tvg_saver: code refactoring.

keep the macro naming convention.

3 years agotvg_loader: code refactoring.
Hermet Park [Thu, 29 Jul 2021 08:26:36 +0000 (17:26 +0900)]
tvg_loader: code refactoring.

keep the macro naming convention

3 years agotvg format: code refactoring
Hermet Park [Thu, 29 Jul 2021 07:43:37 +0000 (16:43 +0900)]
tvg format: code refactoring

use SIZE() macro for consistency.

3 years agotvg_format: save/restore default view size in the data.
Hermet Park [Thu, 29 Jul 2021 06:51:00 +0000 (15:51 +0900)]
tvg_format: save/restore default view size in the data.

current bounding box of the paint is the default view size...

Do we have any better information of that?

3 years agosvg_loader: allow multiple defs tags
Michal Maciola [Thu, 29 Jul 2021 02:47:33 +0000 (04:47 +0200)]
svg_loader: allow multiple defs tags

If svg contained multiple defs tags only the first one was handled correctly.
Every next 'defs' tag was skipped and its inner elements parsed as it was
outside the defs.

3 years agocommon picture: correct non-working size() behavior.
Hermet Park [Wed, 28 Jul 2021 11:55:10 +0000 (20:55 +0900)]
common picture: correct non-working size() behavior.

Pixel-based image picture doesn't work at size() method.
Obvisouly, we missed to implement it properly.

This patch corrects it.

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

3 years agoremove temporary code after resolving the dependency 49/261449/2
Hermet Park [Mon, 19 Jul 2021 08:15:08 +0000 (17:15 +0900)]
remove temporary code after resolving the dependency

Change-Id: I48261134861299c9fd6fbe7dd4f729dcbf400b15

3 years agosw_engine raster: remove inlining.
Hermet Park [Wed, 28 Jul 2021 10:55:28 +0000 (19:55 +0900)]
sw_engine raster: remove inlining.

Reduce the binary size,

Leave it to the best choice by the complier.

3 years agosw_engine common: Added neon version of rasterRGBA32 API.
Michal Szczecinski [Tue, 27 Jul 2021 11:46:57 +0000 (13:46 +0200)]
sw_engine common: Added neon version of rasterRGBA32 API.

Changes:
- Added 'neon' vector option in build system
- Introduced neon version of rasterRGBA32 API, which improves
speed of the funciton on ARM cpu's around ~35%

3 years agosw_engine: flush memory pool after drawing.
Hermet Park [Wed, 28 Jul 2021 08:14:34 +0000 (17:14 +0900)]
sw_engine: flush memory pool after drawing.

if many canvas instances own private memory pool,
the memory usage can be increased linearly.

To prevent memory usage, flush out memory pool from the clear()
if the canvas uses private memory pool.

3 years agocommon loader: code refactoring
Hermet Park [Wed, 28 Jul 2021 05:06:55 +0000 (14:06 +0900)]
common loader: code refactoring

Bitmap based pictures doesn't need the viewbox,
LoaderModule should delegate the viewbox to the derived classes which
having vector-based image loaders such as svg, tvg.

In that case, paint resizing can be performed by the loaders by own
policy.

3 years agocommon loader: code refactoring.
Hermet Park [Wed, 28 Jul 2021 04:40:45 +0000 (13:40 +0900)]
common loader: code refactoring.

replace from Scene to Paint at the internal interface.

Picture doesn't need to know the returned Node type.
base class, Paint is enough to in the data passing.

3 years agocommon picture: remove viewbox() api.
Hermet Park [Mon, 26 Jul 2021 11:59:21 +0000 (20:59 +0900)]
common picture: remove viewbox() api.

picture provides size() interface to return the image size,
viewbox() is conceptually not correct with the Picture.

Remove it under the beta api.

3 years agosw_engine: -- unused header
Hermet Park [Tue, 27 Jul 2021 14:33:26 +0000 (23:33 +0900)]
sw_engine: -- unused header

3 years agoexample performance: improve to print average...
Hermet Park [Tue, 27 Jul 2021 14:28:01 +0000 (23:28 +0900)]
example performance: improve to print average...

3 years agoexample: add a sample for checking rendering performance.
Hermet Park [Tue, 27 Jul 2021 03:10:44 +0000 (12:10 +0900)]
example: add a sample for checking rendering performance.

3 years agotools svg2tvg: introduce a new tool for exporting tvg.
Hermet Park [Mon, 26 Jul 2021 10:56:44 +0000 (19:56 +0900)]
tools svg2tvg: introduce a new tool for exporting tvg.

This is an utility to convert a file from svg to tvg
To use this, enable the feature by toggling in the meson option.

$meson build -Dtools="svg2tvg" ...

See also the usage:

Usage:
   svg2tvg [SVG file]

Examples:
    $ svg2tvg input.svg

3 years agotest paint: add missing Paint utc
Hermet Park [Mon, 26 Jul 2021 09:59:11 +0000 (18:59 +0900)]
test paint: add missing Paint utc

3 years agopicture: paint() method shall not be public.
Hermet Park [Mon, 26 Jul 2021 11:45:02 +0000 (20:45 +0900)]
picture: paint() method shall not be public.

3 years agosw_engine renderer: ++exception handling.
Hermet Park [Mon, 26 Jul 2021 07:49:54 +0000 (16:49 +0900)]
sw_engine renderer: ++exception handling.

initialize a member with the default value.

3 years agotvg_saver: fix the invalid data size. accepted/tizen/unified/20210727.124506 submit/tizen/20210726.072959
Hermet Park [Mon, 26 Jul 2021 07:12:23 +0000 (16:12 +0900)]
tvg_saver: fix the invalid data size.

sizeof(colors) indicates its pointer size, we actually intended to the structure size.

Change-Id: I007dbc615a9f241e009a513b401de32232aee64a

3 years agotvg_saver: +exception handling
Hermet Park [Mon, 26 Jul 2021 07:17:06 +0000 (16:17 +0900)]
tvg_saver: +exception handling

close the file handle before returning the function.

Change-Id: I9da706184669a42ad1ef27747b3909aa0462ab32

3 years agotvg_saver: removing saving the default values
Mira Grudzinska [Thu, 22 Jul 2021 20:02:28 +0000 (22:02 +0200)]
tvg_saver: removing saving the default values

The default values (stroke cap/join, fill rule/spread or color with alpha = 0)
were unnecessarily saved in the tvg format file.

Change-Id: If26778e7759d3aca11c1423bad2ed360cfd3d512

3 years agodoc: ++ MemPool docs
Mira Grudzinska [Fri, 23 Jul 2021 10:33:00 +0000 (12:33 +0200)]
doc: ++ MemPool docs

Change-Id: Ic0230e663172754eb5d1f2c02a6f2f97d334c245

3 years agoMerge "replace the logging system with dlog in tizen" into tizen
Hermet Park [Mon, 26 Jul 2021 06:56:03 +0000 (06:56 +0000)]
Merge "replace the logging system with dlog in tizen" into tizen

3 years agoMerge "enable tvg format in tizen" into tizen
Hermet Park [Mon, 26 Jul 2021 06:55:42 +0000 (06:55 +0000)]
Merge "enable tvg format in tizen" into tizen

3 years agobump up version 0.3.2 75/261775/1
Hermet Park [Mon, 26 Jul 2021 06:52:53 +0000 (15:52 +0900)]
bump up version 0.3.2

Change-Id: I030cd8faa7cb2d2673bcb4edacf339f0345cd474

3 years agoenable tvg format in tizen 74/261774/1
Hermet Park [Mon, 26 Jul 2021 06:46:07 +0000 (15:46 +0900)]
enable tvg format in tizen

Change-Id: I3088ca5d8dfdb39647b4cb3a63e100c82177dcd2

3 years agoreplace the logging system with dlog in tizen 72/261772/2
Hermet Park [Mon, 26 Jul 2021 06:41:52 +0000 (15:41 +0900)]
replace the logging system with dlog in tizen

please turn on logging in meson_option when it's necessary.

Change-Id: Ib2483184697c344f196fc1ff2253309c9215239f

3 years agosw_engine: removed unused rleAlphaMask
Michal Maciola [Fri, 23 Jul 2021 12:27:39 +0000 (14:27 +0200)]
sw_engine: removed unused rleAlphaMask

3 years agocommon log: use the log macro to replace the print method easier.
Hermet Park [Fri, 23 Jul 2021 03:05:53 +0000 (12:05 +0900)]
common log: use the log macro to replace the print method easier.

We can replace the system logger method by changing single line print source in common,
This also helps to remove the THORVG_LOG_ENABLED macro from each use-cases.

TVGLOG(): To print the hint & tip messages for users.
TVGERR(): To print the error message for debugging.

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

3 years agosvg_loader: code refactoring.
Hermet Park [Fri, 23 Jul 2021 05:46:31 +0000 (14:46 +0900)]
svg_loader: code refactoring.

clean up about logging before replacing it with TVGLOG()

3 years agodoc: improved Saver documentation.
Hermet Park [Thu, 22 Jul 2021 04:10:30 +0000 (13:10 +0900)]
doc: improved Saver documentation.

3 years agoapis: promote beta apis to the official ones.
Hermet Park [Thu, 22 Jul 2021 04:00:59 +0000 (13:00 +0900)]
apis: promote beta apis to the official ones.

3 api candidates has been verified since it's tagged in beta,
we confirm that they are useful for tvg usages.

Here list shows the candidates apis:

@API Addition:

Matrix Paint::transform() noexcept;
CompositeMethod Paint::composite(const Paint** target) const noexcept;
Result SwCanvas::mempool(MempoolPolicy policy) noexcept;

3 years agocommon: style fixes (#644)
Michal Maciola [Thu, 22 Jul 2021 11:35:26 +0000 (13:35 +0200)]
common: style fixes (#644)

3 years agocommon: code refactoring.
Hermet Park [Thu, 22 Jul 2021 08:19:22 +0000 (17:19 +0900)]
common: code refactoring.

renamed loader classes same to Saver classes

tvgLoaderMgr -> tvgLoader (tvgSaver)
tvgLoader -> tvgLoadModule (tvgSaveModule)

3 years agoexamples: replace sprintf() with snprintf()
Hermet Park [Thu, 22 Jul 2021 05:19:12 +0000 (14:19 +0900)]
examples: replace sprintf() with snprintf()

snprintf() is more preferred to use in preventing buffer overflow.

3 years agoinfra: add tvg saver in build test
Hermet Park [Thu, 22 Jul 2021 02:54:49 +0000 (11:54 +0900)]
infra: add tvg saver in build test

3 years agotvg_saver: introduce a new module tvg saver
Hermet Park [Wed, 21 Jul 2021 08:31:42 +0000 (17:31 +0900)]
tvg_saver: introduce a new module tvg saver

tvg saver is a new module to export tvg files.

In this patch, it also contains the infrastructure of saver module
to expand other types of savers such as png, jpg, etc.

To save the tvg file from a paint, you can use the Saver feature, for example:

auto saver = tvg::Saver::gen();
saver->save(paint, "sample.tvg");
saver->sync();

Later, you can read the "sample.tvg" using Picture.

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

The behavior of the saver will work on sync/async based on the threading setting of the initializer.
Thus if you wish to have a benefit of it, you must call sync() after the save() in the proper delayed time.

Otherwise, you can call sync() immediately.

Note that, the asynchronous tasking is depent on the saver module implementation.
Also, you need to enable tvg saver/loader modules from meson option. (yet this feature is under the beta)

@API Addition:
Result Saver::save(std::unique_ptr<Paint> paint, const std::string& path) noexcept;
Result Saver::sync() noexcept;

@Examples: tvgSaver

@Co-author: Mira Grudzinska <m.grudzinska@samsung.com>

3 years agotvg format: code refactoring #10
Hermet Park [Wed, 21 Jul 2021 04:56:50 +0000 (13:56 +0900)]
tvg format: code refactoring #10

keep neat & clean code,
revise to tvg style naming convention.

3 years agosvg_loader: allow both clipPath and mask together (#622)
Michal Maciola [Wed, 21 Jul 2021 03:12:09 +0000 (05:12 +0200)]
svg_loader: allow both clipPath and mask together (#622)

* svg_loader: allow both clipPath and mask together

* svg_loader: allow both clipPath and mask together fix #1

Changed seperate functions _applyClipPathComposition and _applyMaskComposition into single function _applyComposition