platform/core/graphics/tizenvg.git
3 years agores: updated images
Hermet Park [Thu, 1 Jul 2021 03:26:52 +0000 (12:26 +0900)]
res: updated images

Change-Id: I1bb0f49832e29ddfddeaea5528e3c78cadcdb40a

3 years agosvg_loader: recalculating the default values of grads
Mira Grudzinska [Fri, 25 Jun 2021 11:53:00 +0000 (13:53 +0200)]
svg_loader: recalculating the default values of grads

The default values of gradient properties were handled differently
than the values given by a user/in an svg file.

Change-Id: Iff7edabe33b77593bd74c89e9d9c7efdedcfb381

3 years agosw_engine: fix broken MSVC compatibility.
Hermet Park [Thu, 1 Jul 2021 03:01:27 +0000 (12:01 +0900)]
sw_engine: fix broken MSVC compatibility.

error: use of undeclared identifier 'ulong'

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

Change-Id: Ic0554c2e0160d46c0762b619a62a7eddabcf3743

3 years agosw_engine: stop-opacity value should be interpolated between stops
Mira Grudzinska [Tue, 29 Jun 2021 22:21:48 +0000 (00:21 +0200)]
sw_engine: stop-opacity value should be interpolated between stops

The opacity value is interpolated as are all color channels.

Change-Id: Ib7cf0d33cc354b23d6afa406e50d6ff9b001966a

3 years agosvg_loader: allow multiple <defs> tags without data and memory leak (#528)
Michal Maciola [Wed, 30 Jun 2021 08:21:30 +0000 (10:21 +0200)]
svg_loader: allow multiple <defs> tags without data and memory leak (#528)

* svg_loader: allow multiple defs without data and memory leak

If the svg file contained multiple <defs> tags, each subsequent tag
overwritten the previous tag. This resulted in incorrect rendering of the
file and memory leaks.

@Issues: 491

* svg_loader: allow multiple defs without data and memory leak- fix #1

Changed the idea to abandon node creating instead of deleting it after
creation. Removed simpleXmlParseAttributes for _createDefsNode.

Change-Id: Iada1c467949228e116a637c8fd37ceabb5dc34bb

3 years agosvg_loader: fix a infinite loop error by circular dependency.
Hermet Park [Wed, 30 Jun 2021 06:27:25 +0000 (15:27 +0900)]
svg_loader: fix a infinite loop error by circular dependency.

Composition can be applied recursively if its children nodes have composition target to this one.
This can be occured by wrong svg description, and tvg prevents this exception case.

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

Change-Id: I9bddf19b1da5317109533260f336cdea54294620

3 years agoinfra: ++ strict build test
Hermet Park [Wed, 30 Jun 2021 06:15:00 +0000 (15:15 +0900)]
infra: ++ strict build test

Enable log in default.

Change-Id: I3cc0f7debbebb281fe90c2ddb5a4baaaccfba8b3

3 years agosvg_loader: code refactoring
Hermet Park [Wed, 30 Jun 2021 05:16:27 +0000 (14:16 +0900)]
svg_loader: code refactoring

unify to tvg fill rule.

Change-Id: Ia6cd5d8e64aab410409492f03177322e2073a968

3 years agosvg_loader: recover partial code from 3e7888b5387a57568c558afc59526d5e672e1859
Hermet Park [Wed, 30 Jun 2021 06:12:15 +0000 (15:12 +0900)]
svg_loader: recover partial code from 3e7888b5387a57568c558afc59526d5e672e1859

oops, log was not tested in the patch...

Change-Id: Ia607f4b6095a370c18de9be65c31cbe9f77be15e

3 years agosvg_loader: code refactoring
Hermet Park [Wed, 30 Jun 2021 05:09:09 +0000 (14:09 +0900)]
svg_loader: code refactoring

remove more unused declarations...

Change-Id: I856ddc02892afe3877303134fb65325206eac594

3 years agosvg_loader: code refactoring
Hermet Park [Wed, 30 Jun 2021 04:58:58 +0000 (13:58 +0900)]
svg_loader: code refactoring

use color structure to keep neat & compact code.

Change-Id: I82ffc31f774961f3ecc4c1c305222811434f360d

3 years agosvg_loader: code refactoring
Hermet Park [Wed, 30 Jun 2021 04:44:37 +0000 (13:44 +0900)]
svg_loader: code refactoring

remove unused declaration.

Change-Id: I8ed7f5182c7d2f811f8faab06fc6161807a72ee6

3 years agosvg_loader: fix the inifite loop bug when size has 'em' unit.
Hermet Park [Tue, 29 Jun 2021 11:13:03 +0000 (20:13 +0900)]
svg_loader: fix the inifite loop bug when size has 'em' unit.

svg may have 'em' unit for fonts, strtof() must handle this case to not
drop in the infinite loop.

Yet thorvg doesn't support font feature in svg,
it must multiply values with font size if those values have 'em' size.

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

Change-Id: I07f3bcb7d177420739e3804d01b3d2e7492d457f

3 years agosw_engine rle: -- sanitizer reports.
Hermet Park [Tue, 29 Jun 2021 06:51:50 +0000 (15:51 +0900)]
sw_engine rle: -- sanitizer reports.

The code is actually intended, we can modify it to ignore the
annoying sanitizer reports.

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

Change-Id: I05578fa69435b70f66340ead7373629a81925fc3

3 years agosw_engine renderer: fix a broken composition bug
Hermet Park [Tue, 29 Jun 2021 05:23:38 +0000 (14:23 +0900)]
sw_engine renderer: fix a broken composition bug

tvg sw_engine tries to skip composition as far as its doable,
it tries composition only if the translucent shape with stroking is there.

There has been a condition bug that composition is applied unnecessarily
even if stroking is disabled. This resulted in broken blending
at gradient filling since it applied alpha values multiple times.

Issues:
https://github.com/Samsung/thorvg/issues/445

Change-Id: I09ba606b2e6c0c5f4750c9e8810b74c705851b63

3 years agoMerge "temporary fix for abi break." into tizen
Hermet Park [Tue, 29 Jun 2021 02:42:25 +0000 (02:42 +0000)]
Merge "temporary fix for abi break." into tizen

3 years agosvg_loader: currentColor - inheritance from a parent
Mira Grudzinska [Sun, 27 Jun 2021 14:07:24 +0000 (16:07 +0200)]
svg_loader: currentColor - inheritance from a parent

The 'currentColor' attribute value was not inherited. Fixed.

3 years agosvg_loader: negative attrs length fix
Michal Maciola [Fri, 25 Jun 2021 15:36:00 +0000 (17:36 +0200)]
svg_loader: negative attrs length fix

After finding no attributes but white spaces, attrs length could be negative
that resulted in segmentation fault in simpleXmlParseAttributes function.

@Issue: #487

3 years agosvg_loader: fix trivial build warnings.
Hermet Park [Mon, 28 Jun 2021 04:38:12 +0000 (13:38 +0900)]
svg_loader: fix trivial build warnings.

../src/loaders/svg/tvgSvgLoader.cpp: In function ‘void _copyAttr(SvgNode*, const SvgNode*)’:
../src/loaders/svg/tvgSvgLoader.cpp:1598:60: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct SvgStyleProperty’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
     memcpy(to->style, from->style, sizeof(SvgStyleProperty));

@Issue: 498

3 years agosvg_loader: finish the search after founding the proper color
Mira Grudzinska [Sun, 27 Jun 2021 14:25:45 +0000 (16:25 +0200)]
svg_loader: finish the search after founding the proper color

In the _toColor func, after founding the proper color, the search
should be finiched.

3 years agosvg_loader: applying opacity to the gradient
Mira Grudzinska [Sat, 26 Jun 2021 11:23:19 +0000 (13:23 +0200)]
svg_loader: applying opacity to the gradient

Before this change the 'stroke-opacity' and the 'fill-opacity'
grad style attributes were not taken into account.

3 years agotemporary fix for abi break. 08/260508/1
Hermet Park [Mon, 28 Jun 2021 04:02:12 +0000 (13:02 +0900)]
temporary fix for abi break.

Change-Id: If4dffc9c484a213d8e038b925c4257806ee91da3

3 years agocommon: introducing the composite API (getter)
Mira Grudzinska [Thu, 24 Jun 2021 11:02:32 +0000 (13:02 +0200)]
common: introducing the composite API (getter)

The new API gets the composite method and the pointer to the composite
target of the given paint object.

3 years agocommon: PaintType enum changed to identifier in Paint class
Mira Grudzinska [Thu, 24 Jun 2021 15:02:32 +0000 (17:02 +0200)]
common: PaintType enum changed to identifier in Paint class

The PaintType enum was used to set the paint type in the internal Paint
implementation. This solution is switched to an identifier with id() getter,
so that the information about the type can be reached from outside the Paint.

3 years agoUpdate README.md
Hermet Park [Fri, 25 Jun 2021 01:49:08 +0000 (10:49 +0900)]
Update README.md

@mgrudzinska I don't know this makes you understand, you can suggest if you have a better phrase.

3 years agoUse spellcheck
K. S. Ernest (iFire) Lee [Thu, 24 Jun 2021 18:05:02 +0000 (11:05 -0700)]
Use spellcheck

3 years agosvg_loader: fix memory violation issues.
Hermet Park [Thu, 24 Jun 2021 09:38:23 +0000 (18:38 +0900)]
svg_loader: fix memory violation issues.

copy attribute must copy the url data,
otherwise, url memory can be atempted freeing twice.

also, fix the memory leak in multiple composition case.

3 years agoUpdate README.md
Hermet Park [Thu, 24 Jun 2021 14:02:32 +0000 (23:02 +0900)]
Update README.md

3 years agosvg_loader: handling the ColorStop offset values
Mira Grudzinska [Tue, 22 Jun 2021 18:32:48 +0000 (20:32 +0200)]
svg_loader: handling the ColorStop offset values

The ColorStop offset < 0 and > 1 should be treated as 0 and 1 respectively.
The offset value < than the previous offset value should be replaced
by the previous value - without this change segfault occurred.
Validating the APIs parameters values is the user responsibility.

3 years agosw_engine stroke: set stroke invalid if points are zero.
Hermet Park [Thu, 24 Jun 2021 11:41:02 +0000 (20:41 +0900)]
sw_engine stroke: set stroke invalid if points are zero.

This valid tag is used for further progress.
we don't need it actually since we can count by points number.

3 years agosvg_loader: prevent heap memory overflow.
Hermet Park [Thu, 24 Jun 2021 07:45:58 +0000 (16:45 +0900)]
svg_loader: prevent heap memory overflow.

if the input points are odd-numberd by invalid svg data, it could access invalid memory.

Prevents it just in case.

3 years agosvg_loader SvgPath: Added corner case handling for flags of Arc
JunsuChoi [Wed, 23 Jun 2021 03:43:45 +0000 (12:43 +0900)]
svg_loader SvgPath: Added corner case handling for flags of Arc

It handles the case what the flag of the arc of the path is defined
without spaces or commas, such as 00, 01, 11 or 10.

3 years agosvg2png: Clean up code
JunsuChoi [Thu, 24 Jun 2021 01:28:51 +0000 (10:28 +0900)]
svg2png: Clean up code

Modify the code to fit coding style

3 years agosvg2png: revise code to fix memory violation.
Hermet Park [Wed, 23 Jun 2021 12:00:54 +0000 (21:00 +0900)]
svg2png: revise code to fix memory violation.

previous code didn't take care of multi-threading.

This revise code to avoid changing canvas buffer during multi-tasking.

3 years agoUpdate tvgSwMath.cpp
Hermet Park [Wed, 23 Jun 2021 13:46:41 +0000 (22:46 +0900)]
Update tvgSwMath.cpp

fix typo.

3 years agotvg_loader: recover wrongly introduced change by my mistake.
Hermet Park [Wed, 23 Jun 2021 10:45:43 +0000 (19:45 +0900)]
tvg_loader: recover wrongly introduced change by my mistake.

3 years ago+++
Hermet Park [Wed, 23 Jun 2021 08:32:19 +0000 (17:32 +0900)]
+++

3 years agotvg_loader: code refactoring.
Hermet Park [Tue, 22 Jun 2021 10:53:56 +0000 (19:53 +0900)]
tvg_loader: code refactoring.

keep it neat & clean code for better readibility and maintenence.

3 years agosw_engine: fix MSVC compatibility problem.
Hermet Park [Wed, 23 Jun 2021 07:17:10 +0000 (16:17 +0900)]
sw_engine: fix MSVC compatibility problem.

clz (count leading zero) is builtin function
that is not available in MSVC.

This patch replace clz for MSVC env.

Thanks @fire for pointing out this.

Refers: https://stackoverflow.com/questions/355967/how-to-use-msvc-intrinsics-to-get-the-equivalent-of-this-gcc-code

3 years agocommon: fix compatibility issue for MSVC.
Hermet Park [Wed, 23 Jun 2021 05:50:46 +0000 (14:50 +0900)]
common: fix compatibility issue for MSVC.

strcasecmp() is not supported by MSVC

We can replace it with _stricmp()

thanks @fire for pointing out this.

3 years agocommon: fix compatibility issue for MSVC.
Hermet Park [Wed, 23 Jun 2021 04:41:58 +0000 (13:41 +0900)]
common: fix compatibility issue for MSVC.

__attribute__ syntax is not supported by MSVC.

We can turn it on optionally.

3 years agocommon: fix compatibility issue for MSVC
Hermet Park [Wed, 23 Jun 2021 04:31:13 +0000 (13:31 +0900)]
common: fix compatibility issue for MSVC

Math Constants are not defined in Standard C/C++

for this, we can use _USE_MATH_DEFINES before math headers.

3 years agoexamples: add commentary for exceptions.
Hermet Park [Wed, 23 Jun 2021 04:09:11 +0000 (13:09 +0900)]
examples: add commentary for exceptions.

3 years agosw_engine fill: fixing gradient calculations for 'repeat' spread value
Mira Grudzinska [Tue, 22 Jun 2021 09:35:22 +0000 (11:35 +0200)]
sw_engine fill: fixing gradient calculations for 'repeat' spread value

There was a call to the ctable element from outside its boundaries, because
the check was misplaced.

3 years agoinfra: add memory sanitize option in meson
Hermet Park [Wed, 23 Jun 2021 02:47:59 +0000 (11:47 +0900)]
infra: add memory sanitize option in meson

for optimial library, we removed some peripheral information in default,
this breaks asan environment.

This patch changes it to make it both.

if you want to use asan, please change the meson option.

default is disabled.

example)
$meson . build -Db_sanitize=address
$meson . build -Db_sanitize=address,undefined

3 years agosvg_loader: correct parsing ColorStop offset values
Mira Grudzinska [Tue, 22 Jun 2021 19:11:34 +0000 (21:11 +0200)]
svg_loader: correct parsing ColorStop offset values

Values different from numbers and percentages should be ignored
and the default values should be applied (zeros).

3 years agocommon loadermgr: fix missing break; in switch-case.
Hermet Park [Wed, 23 Jun 2021 01:18:46 +0000 (10:18 +0900)]
common loadermgr: fix missing break; in switch-case.

3 years agosvg_loader SvgLoader: Copy the missing composite url
JunsuChoi [Tue, 22 Jun 2021 07:07:55 +0000 (16:07 +0900)]
svg_loader SvgLoader: Copy the missing composite url

When copying an attribute, url information of stype's composite is overwritten with memcpy.
This causes double free by deleting the wrong string in freeNodeStyle.

3 years agocommon scene: fix a regression bug.
Hermet Park [Tue, 22 Jun 2021 08:22:39 +0000 (17:22 +0900)]
common scene: fix a regression bug.

That is wrongly changed by 39bf94e506c30a07720a0ef66809dea3331de727

renderer must be valid until all operations is done.

3 years agotvg_loader: code refactoring.
Hermet Park [Tue, 22 Jun 2021 08:05:38 +0000 (17:05 +0900)]
tvg_loader: code refactoring.

remove if-def code.

Actually, tvg log is supposed to print some useful info for users,
not debugging info for our engine developers.

3 years agosvg_loader SvgLoader: Prevent invalid access
JunsuChoi [Tue, 22 Jun 2021 07:15:05 +0000 (16:15 +0900)]
svg_loader SvgLoader: Prevent invalid access

If there is no path information, it is not copied.

3 years agofix a build break in MSVC
Hermet Park [Tue, 22 Jun 2021 03:45:19 +0000 (12:45 +0900)]
fix a build break in MSVC

add missing string header, string is used for a Picture::load() parameter

3 years agocommon scene: code refactoring.
Hermet Park [Tue, 22 Jun 2021 02:46:42 +0000 (11:46 +0900)]
common scene: code refactoring.

keep it clean and less LOC.

3 years agosvg_loader XmlParser: Fix check the end of string
JunsuChoi [Tue, 22 Jun 2021 04:27:40 +0000 (13:27 +0900)]
svg_loader XmlParser: Fix check the end of string

While skipping the string, check the end of the string first.
Prevents an invalid read when parser really get to the end of the string.

3 years agocommon: fix a memory leak after scene->clear(true)
Michal Maciola [Wed, 16 Jun 2021 07:46:36 +0000 (09:46 +0200)]
common: fix a memory leak after scene->clear(true)

If renderer was null, paints was cleared (count set to zero), but data
was not deleted regardless free boolean.

3 years agoloaders: revise code from cce4b443b3250d14a3077cf13226f7cacbb82f57
Hermet Park [Mon, 21 Jun 2021 11:18:08 +0000 (20:18 +0900)]
loaders: revise code from cce4b443b3250d14a3077cf13226f7cacbb82f57

use copy variable instead of additional buffer pointer.

3 years agoloaders: added copy param for Picture::load
Michal Maciola [Thu, 17 Jun 2021 13:43:47 +0000 (15:43 +0200)]
loaders: added copy param for Picture::load

@API Changed:
Result Picture::load(const char* data, uint32_t size, bool copy /*=false*/) noexcept
TVG_EXPORT Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, bool copy);

3 years agotest Scene: Separate tests into SECTION()
JunsuChoi [Fri, 18 Jun 2021 06:40:15 +0000 (15:40 +0900)]
test Scene: Separate tests into SECTION()

Split some tests into SECTIONs based on their type.
This improves the readability of TC.

And developer can run test in SECTION unit.
ex)
./build/test/tvgUnitTests "Pushing Paints Into Scene" -c "Pushing Null Pointer"

3 years agobump up version 26/260126/1 accepted/tizen/unified/20210628.031610 submit/tizen/20210621.031355
Hermet Park [Mon, 21 Jun 2021 03:00:13 +0000 (12:00 +0900)]
bump up version

Change-Id: I7ab9e0002ba57626f502878ccae23e4c3fc8af6a

3 years agosvg_loader: radial gradient transformation support
Mira Grudzinska [Thu, 17 Jun 2021 22:53:49 +0000 (00:53 +0200)]
svg_loader: radial gradient transformation support

For now the gradient radius is scales like x-axis - it has to be changed
after issue #37 will be resolved.

3 years agotest Scene: Add tvg::Scene unit tests
JunsuChoi [Thu, 17 Jun 2021 06:39:41 +0000 (15:39 +0900)]
test Scene: Add tvg::Scene unit tests

- Creation
- Push
- Reserve
- Clear

3 years agoinfra CI: Upload unit test result to artifact
JunsuChoi [Thu, 17 Jun 2021 08:31:41 +0000 (17:31 +0900)]
infra CI: Upload unit test result to artifact

Users can download the unit test result list from PR-> Checks -> Build Test -> Artifacts.

3 years agoinfra CI: Fix test flag of test build
JunsuChoi [Thu, 17 Jun 2021 08:07:52 +0000 (17:07 +0900)]
infra CI: Fix test flag of test build

test -> tests

3 years agotest capi: code refactoring.
Hermet Park [Thu, 17 Jun 2021 05:57:06 +0000 (14:57 +0900)]
test capi: code refactoring.

keep the coding consistency, no logical changes.

Also, renamed tests to avoid conflicts duplicated names.

3 years agoutc capi: Added linear gradient tests.
Michal Szczecinski [Fri, 4 Jun 2021 11:17:25 +0000 (13:17 +0200)]
utc capi: Added linear gradient tests.

3 years agotest capi: code refactoring.
Hermet Park [Thu, 17 Jun 2021 05:38:27 +0000 (14:38 +0900)]
test capi: code refactoring.

keep the coding consistency, no logical changes.

3 years agoutc capi: Added radial gradient tests.
Michal Szczecinski [Fri, 4 Jun 2021 11:17:25 +0000 (13:17 +0200)]
utc capi: Added radial gradient tests.

3 years agocommon Scene: return FailedAllocation if it really failed at memory allocation.
JunsuChoi [Thu, 17 Jun 2021 03:04:12 +0000 (12:04 +0900)]
common Scene: return FailedAllocation if it really failed at memory allocation.

Due to change of f0ecc67, the return type of reserve() is changed to bool,
which can return the result for the fail case.

3 years agosvg_loader: key and value in the simpleXmlParseW3CAttribute needed to be cleared...
Mira Grudzinska [Wed, 16 Jun 2021 23:30:45 +0000 (01:30 +0200)]
svg_loader: key and value in the simpleXmlParseW3CAttribute needed to be cleared out of spaces

3 years agosvg_loader: fixing color parsing
Mira Grudzinska [Wed, 16 Jun 2021 23:12:57 +0000 (01:12 +0200)]
svg_loader: fixing color parsing

For colors given in a style attribute in the format "rgb(rrr, ggg, bbb)"
a parsing was incorect. Now fixed.

3 years agosvg_loader: after reading an unsupported style attribute no other values were loaded
Mira Grudzinska [Wed, 16 Jun 2021 14:16:02 +0000 (16:16 +0200)]
svg_loader: after reading an unsupported style attribute no other values were loaded

After finding an unsupported style attribute the log is printed (on request)
and processing of other values continues.

3 years agosvg_loader: adding check if stroke-dasharray attribute != none
Mira Grudzinska [Wed, 16 Jun 2021 13:54:12 +0000 (15:54 +0200)]
svg_loader: adding check if stroke-dasharray attribute != none

The stroke-dasharray value equal to "none" was causing a segfault
during a conversion to float. Fixed now.

3 years agoutc capi: added capiSwCanvas test cases
Michal Maciola [Wed, 16 Jun 2021 09:15:08 +0000 (11:15 +0200)]
utc capi: added capiSwCanvas test cases

3 years agotset capi: code refactoring.
Hermet Park [Wed, 16 Jun 2021 03:51:07 +0000 (12:51 +0900)]
tset capi: code refactoring.

revise coding style.

3 years agotest capi: fix build infrastructure
Hermet Park [Wed, 16 Jun 2021 03:22:08 +0000 (12:22 +0900)]
test capi: fix build infrastructure

3 years agoutc capi: Added capi initializer, canvas, paint and shape utc
mmaciola [Wed, 16 Jun 2021 03:16:59 +0000 (05:16 +0200)]
utc capi: Added capi initializer, canvas, paint and shape utc

3 years agosvg_loader: gradient update takes into account a stroke and a fill
Mira Grudzinska [Mon, 14 Jun 2021 21:38:51 +0000 (23:38 +0200)]
svg_loader: gradient update takes into account a stroke and a fill

For shapes with a grad fill and a grad stroke only the fill was drawn.
After this fix both can have a valid gradient.

3 years agotvg_loader: code refactoring.
Hermet Park [Mon, 14 Jun 2021 05:32:05 +0000 (14:32 +0900)]
tvg_loader: code refactoring.

renamed internal functions, no logical changes.

3 years agoloader_mgr: FileTypes order changed
Michal Maciola [Fri, 11 Jun 2021 14:34:05 +0000 (16:34 +0200)]
loader_mgr: FileTypes order changed

FileType order was changed in tvgLoaderMgr.h to move Tvg at the beginning.

When raw data loading [LoaderMgr::loader(data, size)], loaders are tried
one by one (in order according to the FileType enum) until the correct loader
is found.
When using EFL and load edj, multiple loader(data, size) with tvg data may be
called. This change should improve performance in that case.

3 years agotvg_loader: added tvg format verification
mmaciola [Mon, 14 Jun 2021 05:18:10 +0000 (07:18 +0200)]
tvg_loader: added tvg format verification

TVG format verification was added on TvgLoader:open()

3 years agotests capi: revise the show-case & infrastructure.
Hermet Park [Fri, 11 Jun 2021 17:01:18 +0000 (02:01 +0900)]
tests capi: revise the show-case & infrastructure.

Change-Id: I0ea2ba3d7099bcb2a4bce052259e3e6a266eb6dc

3 years agoutc capi: Added shape fill utc.
Michal Szczecinski [Fri, 4 Jun 2021 08:11:11 +0000 (10:11 +0200)]
utc capi: Added shape fill utc.

3 years agotvg_loader: Fixed missing 'this->' keyword
Michal Maciola [Fri, 11 Jun 2021 13:55:24 +0000 (15:55 +0200)]
tvg_loader: Fixed missing 'this->' keyword

Fixed missed 'this->' in tvgTvgLoader.cpp

3 years agofix build break.
Hermet Park [Fri, 11 Jun 2021 12:02:36 +0000 (21:02 +0900)]
fix build break.

regression by - 15b56a66de8fb5872afc4bda4986cae6967ddb56

3 years agocapi: picture load data
Michal Maciola [Mon, 31 May 2021 09:44:59 +0000 (11:44 +0200)]
capi: picture load data

Added 'tvg_picture_load_data' capi.

3 years agotvg_loader: code refactoring.
Hermet Park [Fri, 11 Jun 2021 06:08:40 +0000 (15:08 +0900)]
tvg_loader: code refactoring.

revise it under the tvg coding convention.

3 years agotests: add SwCanvasBase unit tests
Hermet Park [Fri, 11 Jun 2021 06:14:35 +0000 (15:14 +0900)]
tests: add SwCanvasBase unit tests

3 years agoexamples tvg: clean up for tvg consistency.
Hermet Park [Fri, 11 Jun 2021 03:58:15 +0000 (12:58 +0900)]
examples tvg: clean up for tvg consistency.

no logical changes.

3 years agoTVG Loader/Saver module: tvg loader example
mmaciola [Fri, 11 Jun 2021 03:51:35 +0000 (05:51 +0200)]
TVG Loader/Saver module: tvg loader example

3 years agoTVG Loader/Saver: tvg loader introduced
mmaciola [Fri, 11 Jun 2021 03:49:37 +0000 (05:49 +0200)]
TVG Loader/Saver: tvg loader introduced

This patch introduces tvg loader module for loading .tvg binary files.
This allows to load and reuse pregenerated scene.

tvg file format:
.tvg is a binary file format designed for saving/restoring the scene content.
It allows to save scenes and reuse them in other apps or to restore state of
the application.

@Example:
   auto picture = tvg::Picture::gen();
   picture->load(EXAMPLE_DIR"/tvg_file.tvg");
   canvas->push(move(picture));

@API Additions:
   Result paint(std::unique_ptr<Paint> paint) noexcept;

@Issue: Issue ticket is #375.

Change-Id: Ic9c8c2d78a368f50ab1f040778cdb15b8d917cb1

3 years agoexamples: updated samples.
Hermet Park [Thu, 10 Jun 2021 11:00:55 +0000 (20:00 +0900)]
examples: updated samples.

one of children paint can not be updated immediately with a canvas.

the root paint must be passed, otherwise requesting whole canvas is the best idea.

Change-Id: Ia9ffd76054effadccc651bac6ffbdb8988d3e334

3 years agoexamples: revise examples
Hermet Park [Thu, 10 Jun 2021 03:44:20 +0000 (12:44 +0900)]
examples: revise examples

remove the show-cases that accessing the raw memory from the unique_ptr

we don't like to use those cases without any inevitable excuse.

Change-Id: I3417ce563285a58e063640123f15436c7319fc85

3 years agocommon canvas: ++ case cover exception scenarios.
Hermet Park [Thu, 10 Jun 2021 06:50:56 +0000 (15:50 +0900)]
common canvas: ++ case cover exception scenarios.

Do not update the paint if it's not pushed in the canvas.

Change-Id: I5cfd0e107389eac0e2b0947593bef1f6bc7215f5

3 years agosvg_loader: support stroke gradient
Mira Grudzinska [Wed, 9 Jun 2021 21:52:12 +0000 (23:52 +0200)]
svg_loader: support stroke gradient

The loader was ready to handle the gradient stroke, but there was no API to support
it when the loader was introduced. We've had this API for a while already, so
its call has been added.

Change-Id: Ifbda04027b79e84524cf166f05e331c9a33901e9

3 years agocommon canvas: ++ exception handling.
Hermet Park [Thu, 10 Jun 2021 02:33:57 +0000 (11:33 +0900)]
common canvas: ++ exception handling.

canvas update won't be performed if it's on drawing condition nor zero paints.

Change-Id: Ifb05ed0dc27e052d3d35c45c1a4a75cab3c31446

3 years agoexamples stacking: ++ scene stacking.
Hermet Park [Wed, 9 Jun 2021 12:07:13 +0000 (21:07 +0900)]
examples stacking: ++ scene stacking.

Change-Id: I368bddde7f058a1752ba55227205ff4dc30cb687

3 years agocommon canvas: supplement corner cases.
Hermet Park [Wed, 9 Jun 2021 11:07:28 +0000 (20:07 +0900)]
common canvas: supplement corner cases.

filled up corner cases to return the result properly.

Canvas newly has a drawing condition to prevent usage-violation.

Change-Id: I634d301e8754382eacbe2fd4f8ed0fa1b9b516a6

3 years agotest SwCanvas: ++ case cover.
Hermet Park [Wed, 9 Jun 2021 09:11:23 +0000 (18:11 +0900)]
test SwCanvas: ++ case cover.

All prerequiste condition must be passed successfully.
Each test case should verify them before actual unit-test.

Change-Id: I7cbba9b299dd9808ccdd80e1d892435e283abe30

3 years agotest SwCanvas: -- out of spec, don't guratee the result.
Hermet Park [Tue, 8 Jun 2021 08:30:00 +0000 (17:30 +0900)]
test SwCanvas: -- out of spec, don't guratee the result.

Change-Id: I7b50c4d8b48c1f494ceb5d42817cc0cfa6cdaa1f

3 years agotest SwCanvas: ++case cover
Hermet Park [Tue, 8 Jun 2021 08:26:36 +0000 (17:26 +0900)]
test SwCanvas: ++case cover

Change-Id: I7be382dc1175cc27ddeb244b910283af54bcb95c