Commit graph

1156 commits

Author SHA1 Message Date
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
Hermet Park
0e98809f15 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.
2021-08-05 10:58:48 +09:00
Hermet Park
148b4fbfe0 infra: updated meson summary. 2021-08-04 19:58:15 +09:00
Michal Szczecinski
3ce0722ffd 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.
2021-08-04 18:49:55 +09:00
Hermet Park
a042e771e4
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.
2021-08-04 15:31:06 +09:00
Hermet Park
19b11277a0 common loader: use RawLoader class immediately.
no need to find it here.
2021-08-04 15:30:21 +09:00
Michal Maciola
a4a323929f 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.
2021-08-04 15:25:17 +09:00
Hermet Park
dc7bb0deed tvg_saver: do not pass through if the view size is invalid. 2021-07-30 12:40:02 +09:00
Hermet Park
b3aed50a2e common loader: lookup in the numberic order. 2021-07-30 12:36:19 +09:00
JunsuChoi
b72ff371ee 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
2021-07-30 12:26:27 +09:00
Hermet Park
5e52134e2a dexample Picture: improve the test coverage.
In this patch, it replaced the test images with Lenna.
and fix the wrong jpeg file size figuring.
2021-07-30 12:09:59 +09:00
Hermet Park
e59ba67b7c 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
2021-07-30 10:35:30 +09:00
Hermet Park
a91bd37ea9
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?

This also fixes the wrong result after changing the size of the tvg picture.
2021-07-30 10:34:48 +09:00
JunsuChoi
37453a2dfd
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.
2021-07-30 10:31:59 +09:00
Hermet Park
ccc3c7d381 tvg_saver: code refactoring.
keep the macro naming convention.
2021-07-29 20:12:00 +09:00
Hermet Park
2db5d24c9f tvg_loader: code refactoring.
keep the macro naming convention
2021-07-29 17:26:36 +09:00
Hermet Park
4bdf346dbb tvg format: code refactoring
use SIZE() macro for consistency.
2021-07-29 16:45:14 +09:00
Hermet Park
87c6ce1f7c 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?
2021-07-29 15:51:00 +09:00
Michal Maciola
eb810a92f2
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.
2021-07-29 11:47:33 +09:00
Hermet Park
02081d8cdc 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
2021-07-29 11:44:18 +09:00
Hermet Park
750d170978 sw_engine raster: remove inlining.
Reduce the binary size,

Leave it to the best choice by the complier.
2021-07-28 19:56:37 +09:00
Michal Szczecinski
1acc25b5ac 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%
2021-07-28 19:17:23 +09:00
Hermet Park
386888bd11 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.
2021-07-28 17:22:35 +09:00
Hermet Park
d213a67180 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.
2021-07-28 14:16:18 +09:00
Hermet Park
3cb0caf2c4 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.
2021-07-28 13:45:34 +09:00
Hermet Park
f7f241cff5 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.
2021-07-28 13:07:43 +09:00
Hermet Park
7e5311fb86 sw_engine: -- unused header 2021-07-27 23:36:54 +09:00