Commit graph

697 commits

Author SHA1 Message Date
Hermet Park
3a538340aa infra: disable capi in default.
capi is not mandatory option in v0.1.

we can manually toggle it on when it's necessary.
2021-04-30 19:15:05 +09:00
Hermet Park
28008e2f91
doc: polish up api documentation. 2021-04-30 18:53:20 +09:00
Michal Szczecinski
d4f1864c13
Merge pull request #367 from Samsung/devs/jsuya/doc_capi_groupping
doc common: Revise c api doc
2021-04-29 09:27:12 +02:00
JunsuChoi
3908397d95 doc common: Add enum and struct docs in capi 2021-04-29 15:06:54 +09:00
JunsuChoi
706df374cf doc common: Groupping c APIs
C APIs
 - Initializer
 - Canvas
  - SwCanvas
 - Paint
 - Shape
 - Gradient
 - Picture
 - Scene
2021-04-29 15:06:54 +09:00
Mira Grudzinska
6601c93899 sw_engine: fixing overlapping masks
The buffer to which the mask is rastered is only partially cleared.
If the object to which the mask is applied overlaps an area where
another mask was used, an erroneous image is generated. The buffer
clearing area has been increased to the size of the object to which
the mask is applied.
2021-04-29 12:13:38 +09:00
JunsuChoi
d7b3f0103e doc common: Add grouping of C++ api and C api
group ThorVG C++ APIs
group ThorVGCapi C APIs
2021-04-29 12:11:06 +09:00
Mira Grudzinska
ec1232b9b4 doc common: change of the return value in the composite API 2021-04-28 15:06:00 +02:00
Mira Grudzinska
d0dc9142ec common paint: changed result in composite API
A possible error is due to erroneous arguments, so
InvalidArgument is return instead of InsufficientCondition
2021-04-28 20:02:22 +09:00
JunsuChoi
94f3d0dc11 infra Actions: If no coding style error, no comment
and change action name
2021-04-28 19:53:45 +09:00
Mira Grudzinska
3d5006740c doc common: adding the documentation for the C++ APIs
Added the missing descriptions for Sw/Gl/Canvas and Initializer.
@retval command applied.
2021-04-28 19:46:58 +09:00
JunsuChoi
fa8b7b333e doc README: Update build status badge
The badge provided by travis-ci is no longer used.
Use the badge provided by github action.
2021-04-28 19:46:31 +09:00
JunsuChoi
6241fd054d doc common: Fix typo and missing parameter 2021-04-27 11:54:22 +02:00
JunsuChoi
638d81fb15 infra Travis: Remove travis-ci build test
We don't need to build test with travis-ci.
The build test is already being worked in the github-action.
In addition, travis-ci causes unnecessary failures because the recent request count is not properly counted.
2021-04-26 23:13:09 +09:00
Mira Grudzinska
7e35ec339a doc common: adding the documentation for the C++ APIs
The descriptions have been changed and new ones added.
There are still few apis for which descriptions are missing.
2021-04-25 17:16:13 -07:00
JunsuChoi
2cfc2bd241 doc common: Draft documentation for C++ header APIs
Write documentation for some of the APIs that have already been cleared up.
2021-04-21 17:57:24 +09:00
Hermet Park
e1ebcf6153 loaders svg: code refactoring
split functions as its purpose.
2021-04-21 11:12:22 +09:00
JunsuChoi
51e4757a3b loader SvgLoader: Fix wrong debug log
1.
Modify that attribute information used for use type
looks like it was used for g type.

2.
Fix clippath node looking like setting "none"
(clippath's display = false is intentional)
2021-04-21 11:11:37 +09:00
JunsuChoi
8b54b6768a loader SvgLoader: add locale-independent strtof function
strtof's behavior is changed by system locale.
https://linux.die.net/man/3/strtof

Because of this, strtof(10.0000) returns 0.0 in some locales.
When a given value string is locale-independent, strtof has to be
replaced to custom function.
2021-04-20 19:44:04 +09:00
Michal Szczecinski
3ae9832684 capi: Added Inverted Alpha Mask composition enumeration.
Added missing composite method. Backend supports this compostion type.
2021-04-20 17:59:22 +09:00
Hermet Park
b541a0654c loaders svg: ++safety
prevent buffer overflow just in case.
2021-04-20 17:49:48 +09:00
Mira Grudzinska
332012dd6b loader svg: displaying SVG images without the specified viewBox attribute
If no viewBox attribute is given, the height and width attributes are used
to establish the viewBox size. However, this information was not available
inside the scene builder, even though it was needed.
2021-04-15 04:34:44 -07:00
Hermet Park
f1feebf047 common: code refactoring.
renamed internal function, no logical changes.
2021-04-15 18:26:11 +09:00
Mira Grudzinska
a13561e9c5 sw_engine: adding a check before stroke fill dereference
The crash was observed for empty shapes.
2021-04-15 13:33:58 +09:00
Hermet Park
6276e209a7 common initializer: counting engine init count properly.
Manage the reference count in common so that
all common resources can be initialized/terminated identically.
2021-04-14 20:18:06 +09:00
Mira Grudzinska
0f9d3ff6e9 examples: ignoring pictures other than svgs in Stress.cpp
The picture->size() function does not work for raw/png pictures.
As a consequence enabling both, the svg and png file loaders,
resulted in the unintended behavior of the example.
2021-04-14 17:17:10 +09:00
JunsuChoi
5d81fe2446 loader SvgLoader: Fix for coding convention 2021-04-13 19:01:19 +09:00
JunsuChoi
b75e7ea91a loader SvgLoader: return null if transform attribute invalid
In transform matrix parsing, null is returned if any of the matrices are invalid.
2021-04-13 19:01:19 +09:00
Hermet Park
d3a73f7ee9 loaders svg: fix a wrongly handles the corner case.
Stop the internel loop quick as possible, and state must be reset.
2021-04-13 17:49:29 +09:00
Hermet Park
b3559ecf56 loaders svg: code refactoring.
keep it clean & neat within tvg coding convention.
2021-04-13 17:16:38 +09:00
Hermet Park
d2c04f6037 wasm: fix compile errors. 2021-04-09 22:18:57 +09:00
Hermet Park
352f843d2b sync versioning 0.1.0 2021-04-09 21:42:28 +09:00
Hermet Park
5c9016158e loader svg: fix composition(mask/clip) issue.
composition target missed transform of its source.

That brings incorrect composition area.

This fixes it.
2021-04-09 21:02:55 +09:00
Mira Grudzinska
30ee03002b sw_engine: fixing stroke gradient
Instead of checking the stroke's fill, the shape's fill was checked.
As a result the improper rastering function was called (or none).
2021-04-09 13:18:52 +02:00
Hermet Park
35fdc9a278 loaders svg: set default color for composition paint.
not only clippath but alpha compositions might also have any valid color.
Set it default and let it override values while appending shapes if it's necessary.
2021-04-09 17:10:20 +09:00
Hermet Park
903df3da6a loaders svg: prevent composition setting if the result shape is invalid.
Current loader could return invalid shapes -default, from _appendShape()-
by a certain interpretation result,

Though it's a wrong or exception case, we can prevent worse case by avoiding it.
2021-04-09 16:51:05 +09:00
Hermet Park
e1eb98af79 loaders svg: code refactoring
clean up code and remove unnecessary internal class.

this also helps to reduce binary size by 5.5kb

no logical changes.
2021-04-09 15:57:23 +09:00
Hermet Park
adf1312a5e loaders svg: ++ log info for wrong situation.
if either log is printed, we need to improve the composition method.
2021-04-09 11:02:35 +09:00
Hermet Park
605a3bf175 loaders svg: code refactoring
++ clean code.
2021-04-09 10:55:09 +09:00
Hermet Park
6239eca92f loaders svg: fix invalid clip path result.
tvg engine expects the valid clippath with valid colors,
loaders set any colors values to enable it.

this fixes invalid clippath behavior.
2021-04-08 17:54:25 +09:00
Hermet Park
818d24fc70 sw_engine: fix GradientStroke crash
++ strict null check.
2021-04-08 14:15:23 +09:00
Mira Grudzinska
fcad63ec1f sw_engine raster: adding antialiasing to the gradient rastering functions
The gradient rastering functions with composition did not take
antialiasing into account. The missing part has been added.
2021-04-08 13:54:38 +09:00
Mira Grudzinska
9d7a264610 sw_engine raster: refactoring the gradient rastering functions
The gradient rastering functions have been splitted into translucent
and opaque.
2021-04-08 13:54:38 +09:00
Mira Grudzinska
6b5db72f67 sw_engine: rastering the opaque radial gradient with masking
In the radial gradient rastering functions, the part supporting
the (inverse) masking was added.
2021-04-08 13:54:38 +09:00
Mira Grudzinska
8284b3fdfc sw_engine: removed unnecessary function parameter
In the fillFetchLinear function the offset parameter was removed.
The destination address may be shifted directly in the dst parameter,
it doesn't need to be passed separately.
2021-04-08 13:54:38 +09:00
Hermet Park
4557ed6c4b binary optimization
remove inlining to reduce size by 22kb.
2021-04-07 21:27:21 +09:00
Hermet Park
6388a6a9dd common paint: fix wrong fast clippath logic.
it missed to check clippath's transform in fasttrack logic.
now it additionally check it...
2021-04-06 22:28:38 +09:00
Hermet Park
34bce8d371
Update README.md 2021-04-05 22:33:05 +09:00
Hermet Park
9a40b64261 sw_engine raster: ++ precise alpha multiplying
previously alpha multiplying operation doesn't have perfect precision,
could loss 1 pixel since it divides 255 values by 256.

This improved operation comply with both precision & performance.
2021-04-05 12:04:25 +02:00
Hermet Park
9a1d7ec841
Update CONTRIBUTING.md 2021-04-02 13:30:53 +09:00