Commit graph

1082 commits

Author SHA1 Message Date
Hermet Park
2ceee70fcf wasm: turn off the vectorization.
We can visit this feature later when it's stable.
2021-08-20 12:33:18 +09:00
Michal Maciola
d82b088b7a utc: increase coverage up #1 2021-08-19 14:49:14 +09:00
Michal Maciola
3a05ae4c01 utc: increase coverage up 2021-08-19 14:49:14 +09:00
Hermet Park
6f95e9dbe7 infra: simplify vector meson option.
neon/avx can't be resided in together,
we replace it with a string variable.
2021-08-19 14:46:59 +09:00
Michal Maciola
78dd50acc0
svg2png: enhance the feature.
Svg2png fully redesigned.
Introduced whole directory parsing. Created flags interface.

Usage:
   svg2png [svgFileName] [-r resolution] [-b bgColor]

Flags:
    -r set output image resolution.
    -b set output image background color.

Examples:
    $ svg2png input.svg
    $ svg2png input.svg -r 200x200
    $ svg2png input.svg -r 200x200 -b ff00ff
    $ svg2png input1.svg input2.svg -r 200x200 -b ff00ff
2021-08-18 20:29:10 +09:00
Michal Maciola
399caaaff9 picture: fix reloading images
Calling picture->load after it was already once called resulted in
segmentation fault or memory leak (depending on whether the vector (svg, tvg)
or raster (jpg, png, raw) file was loaded).
This patch checks the image has already been loaded. If so, the load()
returns InsufficientCondition.

@issue: fixes #719
2021-08-18 19:17:14 +09:00
Hermet Park
ca16e8b403 build: renamed the cpu vectorization option. 2021-08-18 19:00:48 +09:00
Michal Szczecinski
e3eaa05548 build: Fixed simd options detection 2021-08-18 18:58:12 +09:00
Hermet Park
1dd5e5c2ea
Update README.md 2021-08-17 14:14:48 +09:00
Michal Szczecinski
359b7d0dbb sw_common neon: Fix issue with unaligned memory.
Neon operations should be performed on memory aligned to 8 bytes.
This commit fixes this issue and increase stability of neon rasterizer.
2021-08-17 12:56:26 +09:00
Hermet Park
e1d5ade705 sw_engine: memory optimization.
Save the size of the Countour array,
16 bits is large enough to count the points number in one Shape.
2021-08-12 20:13:58 +09:00
Hermet Park
2280bb9ce7 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.
2021-08-12 19:40:59 +09:00
Hermet Park
da55b84ed8 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.
2021-08-12 18:39:58 +09:00
Hermet Park
e15b1dbc5f 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
2021-08-12 18:39:46 +09:00
Hermet Park
669ac392ca
Add files via upload 2021-08-12 00:39:36 +09:00
Hermet Park
79620d6a6c
Delete example_tvgsize.png 2021-08-12 00:38:31 +09:00
Hermet Park
2819e093b1
Add files via upload 2021-08-12 00:37:56 +09:00
Hermet Park
b3892d14f6
Delete example_tvg.webp 2021-08-12 00:37:44 +09:00
Hermet Park
e4f8f1e03c
Delete example_tvgsize.png 2021-08-12 00:37:36 +09:00
Hermet Park
6a8f1ae3cd
Add files via upload 2021-08-12 00:36:27 +09:00
Hermet Park
02dd8bee65
Update README.md 2021-08-12 00:35:57 +09:00
Hermet Park
672b514cb6
Add files via upload 2021-08-12 00:33:57 +09:00
Hermet Park
9ed4e21937
Add files via upload 2021-08-12 00:31:53 +09:00
Hermet Park
a382a78aee
Update README.md 2021-08-12 00:31:28 +09:00
Michal Maciola
e6ebb5379b 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
2021-08-11 21:46:59 +09:00
Hermet Park
abebdbe545 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.
2021-08-11 12:19:31 +09:00
Hermet Park
2337ea2b01 common interator: add count() interface. 2021-08-10 11:58:48 +09:00
Hermet Park
5b89389161 tvg_saver: skip the invisible paint as possible. 2021-08-10 10:29:28 +09:00
Hermet Park
41ad6e16e9 --annoying compiler warnings. 2021-08-09 21:24:27 +09:00
Hermet Park
98701eeffe sw_engine raster: move neon implementation to the neon domained file. 2021-08-09 20:54:38 +09:00
Hermet Park
dd1a1723c9 doc api: updated missed version info. 2021-08-09 18:21:45 +09:00
Hermet Park
81f0f199d9 doc api: up to date v0.4.0 2021-08-09 18:20:25 +09:00
Michal Maciola
5f25154ba8 common: meson.build added default_options cpp_std=gnu++14 2021-08-09 18:08:38 +09:00
Hermet Park
0773185f92 common initializer: remove unnecessary code.
x is always not equal to zero.
2021-08-09 16:14:36 +09:00
Hermet Park
4b54d7fcb6 infra: just released v0.4.0 2021-08-09 15:21:32 +09:00
Hermet Park
191442c7ae 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
2021-08-09 14:03:48 +09:00
Hermet Park
b0c23451f9 infra: update build test tvg -> tvg_beta
update it as acoording to the last change before v0.4
2021-08-09 13:57:35 +09:00
Hermet Park
ae8120bb29 infra: fix missing tvg -> tvg_beta tag.
breakage was introduced by 6ad1b1bf73
2021-08-09 12:57:00 +09:00
Hermet Park
6ad1b1bf73 infra: tvg format is still fragile, we gonna release it under the beta. 2021-08-09 12:46:17 +09:00
Hermet Park
a4ccf4d812 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.
2021-08-09 12:39:21 +09:00
Hermet Park
b6590314f6 tvg_saver: add 4 bytes reserved area for future extensions.
This memory can be used for storing feature flags.
2021-08-09 12:10:11 +09:00
Hermet Park
af002df5ff 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.
2021-08-07 12:00:31 +09:00
Michal Maciola
3d88d7eefc
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.
2021-08-07 12:00:04 +09:00
Hermet Park
41b5d8eb4e tvg_saver: verify view size earlier before the job is started. 2021-08-06 10:30:42 +09:00
Hermet Park
78f6f9d896 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.
2021-08-05 19:26:04 +09:00
Hermet Park
d0efdb9854 api: add deprecated syntax for deprecated apis. 2021-08-05 19:23:39 +09:00
Hermet Park
8844bdd1e9 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.
2021-08-05 16:10:45 +09:00
JunsuChoi
cc81f8ef99 common Shape: Fix check to invalid argument
add cmds null check
2021-08-05 14:59:24 +09:00
Hermet Park
e12161d04f tvg loader: code refactoring
revise the mimetype load method to keep it clean & neat.
2021-08-05 13:27:08 +09:00
Michal Maciola
cff8815404
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
2021-08-05 11:02:26 +09:00