Commit graph

1012 commits

Author SHA1 Message Date
Mira Grudzinska
2bf21dae3d svg_loader: key and value in the simpleXmlParseW3CAttribute needed to be cleared out of spaces 2021-06-17 11:17:39 +09:00
Mira Grudzinska
7ffeb2e606 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.
2021-06-17 11:12:33 +09:00
Mira Grudzinska
20e926c950 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.
2021-06-17 10:46:20 +09:00
Mira Grudzinska
e0a1aa9355 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.
2021-06-17 10:16:05 +09:00
Michal Maciola
858de0febb utc capi: added capiSwCanvas test cases 2021-06-16 20:48:15 +09:00
Hermet Park
c19aa9fed7 tset capi: code refactoring.
revise coding style.
2021-06-16 12:53:26 +09:00
Hermet Park
fe493a93f2 test capi: fix build infrastructure 2021-06-16 12:22:08 +09:00
mmaciola
3f1b08f050
utc capi: Added capi initializer, canvas, paint and shape utc 2021-06-16 12:16:59 +09:00
Mira Grudzinska
a3e784b6b5 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.
2021-06-15 14:25:17 +09:00
Hermet Park
26fd6b5dfd tvg_loader: code refactoring.
renamed internal functions, no logical changes.
2021-06-14 14:32:05 +09:00
Michal Maciola
88a85c68fa 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.
2021-06-14 14:18:25 +09:00
mmaciola
fa15b9a2af
tvg_loader: added tvg format verification
TVG format verification was added on TvgLoader:open()
2021-06-14 14:18:10 +09:00
Hermet Park
90dd1b5f98 tests capi: revise the show-case & infrastructure. 2021-06-12 02:11:01 +09:00
Michal Szczecinski
5b99bc186d utc capi: Added shape fill utc. 2021-06-11 23:42:03 +09:00
Michal Maciola
8123250f52 tvg_loader: Fixed missing 'this->' keyword
Fixed missed 'this->' in tvgTvgLoader.cpp
2021-06-11 23:39:10 +09:00
Hermet Park
4795927dc1 fix build break.
regression by - 15b56a66de
2021-06-11 21:04:43 +09:00
Michal Maciola
9453273fc8 capi: picture load data
Added 'tvg_picture_load_data' capi.
2021-06-11 20:54:07 +09:00
Hermet Park
15b56a66de tvg_loader: code refactoring.
revise it under the tvg coding convention.
2021-06-11 20:51:50 +09:00
Hermet Park
52d95dcb59
tests: add SwCanvasBase unit tests 2021-06-11 15:14:35 +09:00
Hermet Park
58fefeb05f examples tvg: clean up for tvg consistency.
no logical changes.
2021-06-11 12:58:15 +09:00
mmaciola
2c1f165f19
TVG Loader/Saver module: tvg loader example 2021-06-11 12:51:35 +09:00
mmaciola
16e39ee81b
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.
2021-06-11 12:49:37 +09:00
Hermet Park
b7431eab3e 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.
2021-06-10 20:00:55 +09:00
Hermet Park
ea8d26a681 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.
2021-06-10 16:08:00 +09:00
Hermet Park
6b75ce3476 common canvas: ++ case cover exception scenarios.
Do not update the paint if it's not pushed in the canvas.
2021-06-10 15:50:56 +09:00
Hermet Park
2401495c47 examples: updated svg samples 2021-06-10 11:59:45 +09:00
Mira Grudzinska
9b1356e7cb 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.
2021-06-10 11:36:20 +09:00
Hermet Park
4acf89cf96 common canvas: ++ exception handling.
canvas update won't be performed if it's on drawing condition nor zero paints.
2021-06-10 11:34:24 +09:00
Hermet Park
85587bbe79 examples stacking: ++ scene stacking. 2021-06-09 21:07:13 +09:00
Hermet Park
13009657cd common canvas: supplement corner cases.
filled up corner cases to return the result properly.

Canvas newly has a drawing condition to prevent usage-violation.
2021-06-09 20:11:57 +09:00
Hermet Park
2d2c88b153 test SwCanvas: ++ case cover.
All prerequiste condition must be passed successfully.
Each test case should verify them before actual unit-test.
2021-06-09 18:11:51 +09:00
Hermet Park
9b204fb983 test SwCanvas: -- out of spec, don't guratee the result. 2021-06-08 17:30:00 +09:00
Hermet Park
83d860b150 test SwCanvas: ++case cover 2021-06-08 17:26:36 +09:00
Mira Grudzinska
f3fac71a12 sw_engine: added check whether surface width <= surface stride
In a case width > stride segf occured. Such a case should be treated
as an invalid arg.
2021-06-08 17:20:46 +09:00
Hermet Park
5c26014e2f tests: add SwCanvas unit tests 2021-06-08 17:20:23 +09:00
Mira Grudzinska
419751c736 sw_engine: fixing the composition for canvas width != canvas stride
When canvas width was smaller than its stride and a composition is used,
the plots were drawn incorrectly. This is fixed by setting the image width
(image from a compositor) to be equal to the surface stride, instead of its width.
The image data are now allocated accordingly the fixed image width.
2021-06-08 17:19:59 +09:00
Hermet Park
f0598a7481 Revert "tests: add SwCanvas base part unit tests"
This reverts commit ce6348a504.

This isn't intended pushing...
2021-06-07 20:09:02 +09:00
Hermet Park
f0ecc670ef common canvas: return FailedAllocation if it really failed at memory allocation.
This fixes SwCanvasBase Reservation Unit Test.
2021-06-07 20:04:39 +09:00
Hermet Park
ce6348a504 tests: add SwCanvas base part unit tests 2021-06-07 19:57:52 +09:00
Hermet Park
1c53d47f81 sw_engine mempool: tiny optimization.
don't mempool anything if the option is same.
2021-06-07 19:40:56 +09:00
JunsuChoi
3c19f2aaf5 svg_loader SceneBuilder: Remove incorrect calculation for radial gradient
We are doing enough calculations in the parser if the unit is user space.
This causes the cx,cy coordinates of radial gradient to be calculated incorrectly.
So remove it.
2021-06-07 19:12:17 +09:00
JunsuChoi
bd566bdcb2 svg_loader SceneBuilder: Remove incorrect calculation for linear gradient
Calculation of objectBoundingBox case in linear gradient is incorrect code.
This causes the x,y coordinates of the linear gradient to be calculated incorrectly.
So remove it.
2021-06-07 19:12:17 +09:00
Hermet Park
50b2b1c7de sw_engine renderer: fix to success SwCanvas Unit Test.
render init count shouldn't be counted when it's in a fail-case.
2021-06-07 18:09:35 +09:00
Hermet Park
eda022365f canvas: fix for SwCanvas Unit Test
Fixed to fail canvas generation if engines are not initialized.
2021-06-07 18:01:26 +09:00
Hermet Park
314b96651b doc: correct the beginning year 2021-06-07 17:39:45 +09:00
Hermet Park
7a407eb8bb common: fix typo 2021-06-07 17:36:19 +09:00
Michal Maciola
c7ccca79b3 TVG Loader/Saver: tvg helper file ('tvgTvgHelper.h') introduced
This patch introduces tvgTvgHelper.h file that contains base definitions used
for .tvg loader and saver modules. Indicators, flags and sizes are defined
and base tvgBlock struct is declared here.
'tvgTvgHelper.h' file is essential only for .tvg loader/saver module and it
doesn't affect any other file. Loader and saver modules itself are introduced
in other, further patches.

.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.
2021-06-07 13:02:44 +09:00
Hermet Park
9873539b04 common taskScheduler: fix wrong thread indexing due to duplicated variable names.
That mistake could invoke inproper threads....
2021-06-07 12:57:35 +09:00
Mira Grudzinska
ae5673658e svg_loader: initializing uninitialized variables
The 'loader->svgParse->global' variable was uninitialized when no viewBox attribute
was set. If gradient was applied, the division by zero occured and no gradient was drawn.
2021-06-07 12:30:56 +09:00
Hermet Park
73ea4abf51 infra: just released v0.2.0 2021-06-06 17:36:48 +09:00