Commit graph

1211 commits

Author SHA1 Message Date
Mira Grudzinska
c5430684d1 infra: excluding pthread lib dependency on windows os 2021-09-22 12:38:17 +09:00
Mira Grudzinska
cfacdd705f example: refactoring 2021-09-22 01:13:52 +02:00
Michal Maciola
702f452c6c svg: fix url property
If 'fill="url(#image)"' and defs with id 'image' was not found, the paint was
improperly filled with color.
2021-09-21 20:20:59 +02:00
Mira Grudzinska
4589196689
common: preventing msvc compiler warnings (#817) 2021-09-20 13:54:06 +02:00
Mira Grudzinska
9d63e2894d common: preventing possible compiler warnings 2021-09-19 19:53:40 +02:00
Hermet Park
75e1310c7a prepare to release tvg format feature. 2021-09-16 17:46:10 +09:00
Hermet Park
3d93867e8e tvg_saver: code refactoring
removed the duplicated given child transform code,

no logical changes actually.
2021-09-16 15:01:42 +09:00
Hermet Park
80a940c70a examples: updated tvg resources. 2021-09-16 12:47:05 +09:00
Mira Grudzinska
6b216e362d tvg_saver: proper serialization of a grad fill
In the case when a gradinet fill is present, the transformation matrix
can't be preapplied.
2021-09-16 12:40:37 +09:00
Michal Szczecinski
09301dfde1 sw_engine: Fixed build errors. 2021-09-16 12:27:04 +09:00
Hermet Park
ee7dc1352e tvg_saver: do not merge if the shapes have outlines.
Merged shapes with outlines expects the layered,
unfortunately tvg can't cover the situation.

@Issues: https://github.com/Samsung/thorvg/issues/783
2021-09-16 00:06:01 +09:00
Hermet Park
e5f8bc99b7 examples: updated favorite tvg to fix position issue. 2021-09-15 20:06:20 +09:00
Hermet Park
c4e1a1f752 examples: updated tvg resources
these two resources were fixed by the positioning.
2021-09-15 19:41:11 +09:00
Hermet Park
4142237cac examples: updated tvg resources 2021-09-15 19:16:44 +09:00
Mira Grudzinska
c9c3776207 svg_loader: proper svg resizing
Solves the problem of 'vx' and 'vy' < 0 and cases with 'width'
and 'height' values different than widht and height from the 'viewBox'
attribute.
2021-09-15 19:12:43 +09:00
Michal Maciola
1d8625d40d
wasm: paint opacity in the layers list (#804) 2021-09-14 14:27:39 +02:00
Hermet Park
47c1aac562 examples: updated tvg sample 2021-09-14 19:53:12 +09:00
Hermet Park
e3266ac19c examples: extends svg samples 2021-09-13 20:49:46 +09:00
Mira Grudzinska
d3368c9727 svg_saver: shifting 'preTransform' value changing
'preTransform = false' makes sense in case a stroke exist,
so not only when the stroke-width > 0 but when it's color
is valid as well.
2021-09-11 10:49:09 +09:00
Michal Maciola
150cff0fd5
example images: added rotlines.svg (#796) 2021-09-10 13:31:20 +02:00
Michal Maciola
e62f8a0db4
wasm: improved bounds calculation (#795)
Improved bounds calculation in case a rotation is applied
2021-09-10 13:26:58 +02:00
Hermet Park
8c2e762e98
Update README.md 2021-09-09 22:30:03 +09:00
Michal Maciola
e91dcdb0de
wasm: validate empty data (#790) 2021-09-09 10:45:58 +02:00
Michal Maciola
b294a71613
wasm: remove default data (#789) 2021-09-09 10:40:19 +02:00
Hermet Park
4e9452c4b8 api: removed unused 2021-09-09 14:18:46 +09:00
Michal Maciola
2a2ccb30bd
Wasm: allow iterator and add functions for layers revising (#730)
* common: move iterator functionality into separate IteratorModule
* wasm: allow internal lib dependencies and iterator
* wasm: added functions for layers revising

This patch adds functions to thorvgwasm.cpp:
 layers() - that return a list of paints in a picture
 bounds() - that returns a bounds of a given paint
 setOpacity() - that sets the opacity of a given paint
2021-09-09 13:06:13 +09:00
Michal Maciola
f732479acc wasm: pass mimetype on loading and store original size
This patch adds the mimetype parameter for load() function and adds storing of
an original size after successful loading. Added function originalSize().
2021-09-09 12:55:56 +09:00
Hermet Park
79933d9efa api: set default value nullptr for user convenience. 2021-09-09 12:40:43 +09:00
Michal Maciola
8c4197a8a5 wasm: add force parameter for update() function 2021-09-09 11:48:53 +09:00
Hermet Park
1ea9692841 sw_engine image: fix the clipped image issue.
there was a wrong condition introduced the bug that image was not updated,
because transformation is not re-applied after the first created the internal image data.

@Issues: https://github.com/Samsung/thorvg/issues/751
2021-09-09 11:31:05 +09:00
Hermet Park
789083527e examples: updated a tvg resource. 2021-09-09 11:05:54 +09:00
Mira Grudzinska
288c9f5c1d tvg_saver: fix the stroke width scaling factor
To get the scaling factor from the transformation matrix we have
to use two of its elements.
2021-09-08 10:36:59 +02:00
Hermet Park
b495f04ef4 examples tvg: added a new example to verify tvg resources.
These tvg resources might be updated before official release.
2021-09-08 13:29:04 +09:00
Mira Grudzinska
ae6d574466 sw_engine: overlaping stroke cap
A square or a round cap was mistakenly added to the parts
of the dashed lines that should be continuous. Fixed

@Issues: https://github.com/Samsung/thorvg/issues/777
2021-09-08 11:17:42 +09:00
Hermet Park
f652b33a27 tvg_saver: fix a wrong logic by mistake.
an incorrect logic was introduced by mistake.

that breaks the tvg memory chunks.

now recover it.

@Issues: https://github.com/Samsung/thorvg/issues/774
2021-09-07 12:22:23 +02:00
Hermet Park
e381edacb7 tvg_loader: code refactoring.
no logical changes in the succesful cases,

change the code for better readibility.
and add log messages in the error scenario.
2021-09-07 18:18:09 +09:00
Hermet Park
f1d9f691cc tvg_saver: fix the incorrect stroke transformation
Saver tries to pre-transfom to skip the matrix data,
but it missed the case - transformed stroking,

we skip it also only when xy scaling factors are same excluding the dash properties,
because scaled of the stroking is depent on the engines,
we have no idea of the proper input data in advance.

@Issues: https://github.com/Samsung/thorvg/issues/773
2021-09-07 10:56:43 +02:00
Mira Grudzinska
b421660676 svg_loader: parsing flags in the elliptical arc curve
Since the arc flags can have values 0 or 1, we reported as
an error cases, when a float value was given.
Since the EBNF grammar can be used, we misread some paths.
Removing the condition that prevents giving a float as a flag solves
this problem and is in agreement with the w3 specs.
2021-09-07 13:15:50 +09:00
Hermet Park
d21089ddfd
tvg_saver: save the missing scene reserve count. (#771)
This reserved count was just missed,
Aside from it, tvg_loader logic is not well organized (hard to expect)
We can refine it by recovering the data tree structure in the reverse order.

@Issues: https://github.com/Samsung/thorvg/issues/768
2021-09-06 08:38:18 +02:00
Hermet Park
eddd253c55
tvg_loader: code refactoring & optimization loading. (#772)
Skip the reassigning values by the flags,
We assume those property values are reserved,
leave to apis that handle the invalids if the exceptions.
2021-09-06 08:35:11 +02:00
Mira Grudzinska
5cad097485 sw_engine: handling clips from outside the render region
Clips from outside the rendering region were ignored resulting
in rendering shapes, which should be completely clipped.
In case of the clip fast track, the bounding box width/height
overflow occured and shape, that should be clipped, could be
visible (not always).
2021-09-06 13:16:45 +09:00
Hermet Park
d6193dddd0 Revert "sw_engine avx: the not aligned memory separated in the rasterRGBA32 func"
This reverts commit dafc229a75.
2021-09-03 11:08:40 +09:00
Mira Grudzinska
dafc229a75 sw_engine avx: the not aligned memory separated in the rasterRGBA32 func
The aligned and not aligned memory parts handled separately.
This gives around 10% of the performance increase (tested on i7-8700 CPU)
2021-09-03 11:06:59 +09:00
Michal Maciola
3ded3e359d utc: testing loading and saving .tvg
Added tests of loading and saving .tvg.
Created testSavers.cpp. Created files tag.tvg and test.tvg. Minor change
in tag.svg.
2021-09-03 11:02:25 +09:00
Mira Grudzinska
5c504cbfe6
test SwEngine: increasing lines coverage (#767)
All functions from tvgSwStroke.cpp called.
2021-09-02 15:04:44 +02:00
Mira Grudzinska
dddb38d900 test SwEngine: _rasterTranslucentRect added into the tests 2021-09-01 17:26:07 +09:00
Mira Grudzinska
2fb07d9ac8 test SwEngine: raster image functions included into the unit tests
All image rastering funcions called in the 'Image Draw' test case.
2021-09-01 17:25:42 +09:00
Mira Grudzinska
3a54c5e219 sw_engine: calling avxRasterTranslucentRect instead of its c version
For avx vector support the avxRasterTranslucentRect should be called
instead of cRasterTranslucentRect (mischanged in 01e1fec367).
2021-08-31 15:17:28 +02:00
Mira Grudzinska
d7cb87971b
docs: minor linguistic changes (#759) 2021-08-31 15:15:03 +02:00
Michal Maciola
bf2e9631bf
svg2png: changed help message (#762) 2021-08-31 11:19:18 +02:00