Commit graph

395 commits

Author SHA1 Message Date
Hermet Park
56ff30adff test: +++ missing test file. 2020-09-05 19:05:17 +09:00
Hermet Park
8685c7e0f0 common: fix context corruption among the multiple canvases.
previous implementation didn't consider multiple canvases,
multiple canvas shared one renderer engine that brought corrupted contexts.
Thus, each canvas instances should have designated renderer engine instances.

Now fixed.
2020-09-05 18:55:51 +09:00
Hermet Park
56e474ffab
Update README.md
Update Sample code
2020-09-05 14:26:56 +09:00
JunsuChoi
801896cf8f SvgLoader: Add Mask, ClipPath nodees as dummy.
Mask and clippath TAG are not supported yet.
If this TAG is used, the Child TAG declared with this TAG may cause problems.
To prevent that, declare them as Unknown types until they are supported. (display=none)
2020-09-04 19:47:22 +09:00
JunsuChoi
bd36738011 SvgLoader: Support DashArray attribute for stroke
It supports stroke-dasharray, one of the stroke properties of svg.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray
2020-09-04 16:45:31 +09:00
JunsuChoi
497c1ef131 SvgLoader: Fix memory leak for loader's gradient
Release the memory that was not released.
2020-09-04 16:03:46 +09:00
JunsuChoi
c27a952f44 SvgLoader: Add null check
Since the pointer actually used inside the if condition is loader->def,
add a null check for this.
2020-09-04 16:03:07 +09:00
JunsuChoi
6768e11eed SvgLoaderCommon: Add initialization in SvgVector
A segfault occurs when calling clear() a list without push.
This patch prevents it.
2020-09-04 16:00:58 +09:00
JunsuChoi
0d2982ff76 SvgLoader: Gradient use non-premultipied color
Follow color policy of tvg:Shape.
2020-09-04 12:38:52 +09:00
Hermet Park
1f05c249af sw_engine: step backward optimization.
As profiled, raster parallelization is not so efficient,
we revert this behavior.

We will come again with a better fine-tuned method.
2020-09-04 12:36:19 +09:00
JunsuChoi
c7646d3f73 SvgLoader: Use non-premultipied color
Follow color policy of tvg:Shape.
2020-09-04 12:17:59 +09:00
Hermet Park
b40016c81d svg_loader: prevent dangling node in exception case.
We prefer the independent unit function behavior.
2020-09-04 11:49:08 +09:00
JunsuChoi
3018fe29cd SvgLoader: Remove unnecessary declaration
This declaration is no longer needed,
removing unnecessary actions.(69e8b54be2)
2020-09-04 11:45:45 +09:00
JunsuChoi
23fa5bba23 SvgLoader: Do not delete the cloned node
Reverted incorrectly modified code in 3b9bb51321.

The newly created node becomes a child of the parent parameter
and is deleted together when parsing ends.
2020-09-04 11:45:45 +09:00
JunsuChoi
7807814acb SvgLoader: Fix pointing to wrong parent
If defs type is open empty style, it is not included in stack.
2020-09-04 11:45:45 +09:00
JunsuChoi
c15103e033 SvgLoader: Prevent underflow when stack.cnt is 0
If graphic node is directly located in the <svg>(root) node,
it may cause underflow because stack.cnt is 0.
2020-09-02 18:23:04 +09:00
JunsuChoi
7aff026276 SvgLoader: Defs type nodes are not saved in loader's node list.
If there is an empty (unused) <defs /> inside the svg file, this can cause problems.
<defs> node is managed separately in loader->def.
So it doesn't have to be added to loader's list.
2020-09-02 18:23:04 +09:00
Michal Szczecinski
ff96d4bf2b bindings/capi: Check invalid parameters in capi.
Added checks to capi bindings to avoid crash when api is used
with invalid parameters.
2020-09-02 18:22:10 +09:00
Hermet Park
6f962151b4 svg_loader: fix vector memory leaks.
vector is designed for c++ syntaxes,
it works properly when c++ memory allocator is applied,

Here svg_loader uses c style structures which allocated using malloc()/calloc().
That brings the memory broken of stl vectors.

So, we replaced it with our customized SvgVector to easily fix it.
2020-09-02 12:56:18 +09:00
Hermet Park
6bd56e26c7 test async: fix wrong time unit. 2020-09-01 20:40:18 +09:00
Hermet Park
b46c151e1b canvas: fix memory leak.
call flush() to make engine sure working done before canvas is terminated.
2020-09-01 19:47:33 +09:00
Hermet Park
09fce05105 svg_loader: code refactoring
revise code for simple & better readibility.
2020-09-01 17:51:00 +09:00
Hermet Park
a37b2471ce
Merge pull request #2 from Samsung/hermet/devel
sw_engine: fix memory leak.
2020-08-28 19:17:20 +09:00
Hermet Park
c196bfdf4a sw_engine: fix memory leak.
free dash outline stroke data memory properly.
2020-08-28 19:16:01 +09:00
Hermet Park
5a8d081016 capi: fix memory leak.
Here canvas type should be explicitly defined,
it deleted its instance as a Canvas.
2020-08-28 18:55:03 +09:00
Mateusz Palkowski
6feff3e97d tvgShape: fixed missing check in Shape::fill
Without this check, setting same fill twice results in crash later.

Change-Id: I38e7026c52a250f65923c4e3008868ed471bf885
2020-08-28 14:06:10 +09:00
Hermet Park
acc2bd2cc2 sw_engine: + exceptional handling for safety 2020-08-28 11:28:59 +09:00
Hermet Park
c8bc0a91d9 sw_engine: applied async rasterizing based on task scheduler.
Now, we have 2 points for asynchronous behaviors.

1. update shapes:

Each shape update will be performed by async when you push shape to canvas.
Meaning, if you have time gap between update and rendering in process main-loop,
you can have a benefit by this.

2. rasterization by canvas:

Canvas.draw() will be performed asynchnously until you call canvas.sync();
Meaing, if you can trigger tvg rendering eariler than composition time.
You can have a benefit by this.

If these 1, 2 points might not work for your program,
You can just toggle off async by setting threads number zero at initialization.

Or if you could apply either point of them for your program,
It might be good for performance.

But the best approach is to make both async properly.
Though this might need to fine-grained tuning integration between your program & tvg,
You could achieve the best peformance by parallelzing tasks as possible without any jobs delaying.

Change-Id: I04f9a61ebb426fd897624f5b24c83841737e6b5b
2020-08-26 16:56:54 +09:00
Mira Grudzinska
42a747fa17 SwRenderer: fixing unnecessary nesting in prepare()
Validating the above by adding shape/canvas update to testCapi.cpp

Change-Id: I7db8d014f4aff7b5b2884c2dca5af119329e9d43
2020-08-25 16:50:14 +09:00
Hermet Park
2ef3d05db9 svg_loader: applied asynchronous threads tasks for optimal performance.
Change-Id: I6575a6a6302c0ae52d1256a5f79f4c080002a4aa
2020-08-25 16:08:33 +09:00
Subhransu Mohanty
aad5496c37 meson: added compiler flags to optimize binary size
this reduced library size from 153KB to 119KB.

Change-Id: Ie70e5412b42d864fbaa827eec21b3cbc1e8f26af
2020-08-24 19:50:04 +09:00
Hermet Park
a9b587d930
Merge pull request #1 from kimcinoo/taskqueues
taskscheduler: initialize member correctly
2020-08-24 17:40:15 +09:00
Shinwoo Kim
0ebf41a9cb taskscheduler: initialize member correctly
This patch will fix runtime crash caused by incorrect init variables.
2020-08-24 17:06:26 +09:00
Hermet Park
0916e7e4eb
Update README.md
update gitter channel address.
2020-08-24 14:45:36 +09:00
Hermet Park
90024e92a6 Initial Draft 2020-08-24 14:30:08 +09:00
Somang
10453bd607
Initial commit 2020-08-24 13:40:43 +09:00
Hermet Park
8efef7714c common initializer: don't try initialize engine duplicatedly.
Change-Id: I58c715745b8db40fe759582545082f2e6e10626a
2020-08-21 15:56:45 +09:00
Hermet Park
657e6daddb common taskscheduler: revise functionalities.
initialization interfaces has been changed for threads count.

if you want to set concrete threads count by system, please specify thread count with it.

std threads:
tvg::Initializer::init(tvg::CanvasEngine::Sw, std:🧵:hardware_concurrency());

if your system provides designed threads info, you can use it.

efl:
tvg_engine_init(TVG_ENGINE_SW, eina_cpu_count());

I recommend to avoid max threads usage for better performance.

Change-Id: I22cfa315768f73fa941be136956cdbb2cf837c20
2020-08-21 12:26:57 +09:00
Hermet Park
06cadc79f5 updated AUTHORS
Change-Id: Ie0bb862f8ba20e682bf3bb7469455fa52a5d5498
2020-08-20 17:52:11 +09:00
Mira Grudzinska
5905c0c323 svg path: changes in processing cmds T,Q,S
Change-Id: I979bb8cbcbdd4fd1374205feac6acedc58bdd3e1
2020-08-20 08:46:34 +00:00
Hermet Park
60f2ece182 Merge "tvg: added task support that runs on a threadpool." into tizen 2020-08-20 08:02:07 +00:00
Hermet Park
04c6295974 code refactoring
remove unnecessary condition.
implementation won't be included multiple times not like headers.

Thus this condition is unnecessary.

Change-Id: Id37e675c40ce7213a06c950da8e5ca17ff7245c9
2020-08-20 16:16:46 +09:00
Hermet Park
9d58643a6c sw_engine: fix loss of data when it's converting.
if SwCoord type is determined to 4byte,
it could lose remarkable value that occur stroking jiggling.

This fixes the issue.

Change-Id: Ib2fed2a3bfc9188a30522f35837439364d446a73
2020-08-20 12:18:51 +09:00
Hermet Park
06d8d06993 sw_engine: replace rgba8888 with abgr8888
Actually Dali rendering system requires abgr8888.

We could add more colorspaces if it's necessary.

Change-Id: Ia42a6575d1313629e55efc3077e302992c47b6c0
2020-08-19 18:39:23 +09:00
Hermet Park
ffa4a7248b code refactoring
Now, stabilizing is pretty enough.

Remove assert code so that we never abort process in any cases.
This also reduce the binary size.

Change-Id: Ia7d2d5c5a0757b12481eaebad7a86aade6a89c1e
2020-08-19 14:53:38 +09:00
Hermet Park
70b4703707 remove print/cout logs.
we need a comprehensive logging interface for this.

right now, leave as "LOG:" to replace later.

Change-Id: I25321223cd48ec13a1de5e4140cfea75a2f42866
2020-08-18 20:35:13 +09:00
Hermet Park
a5beca7369 sw_engine: code refactoring
introduce compositor table for runtime colorspace switching.

Change-Id: If179d1e1625f995e114d66cf1bf13742c54ed4f7
2020-08-18 20:27:23 +09:00
Hermet Park
f4d1065d52 sw_engine: convert colorspace ARGB -> RGBA in default.
We can use RGBA colorspace rather ARGB for pixel data.
This would be better for many rendering system,
since it's more widely preferred than ARGB including opengl.

Change-Id: Ibbfe6a511d77bf0ef30ce261995467c11164d306
2020-08-15 18:22:43 +09:00
Hermet Park
7ab71c52d0 picture svg: introduce load() with memory data input source.
picture now affords the memory data as input source so that
user can pass svg data memory directly.

Change-Id: I246c09b682a2d60e53ad556ce0c90337142ee4f1
2020-08-14 19:41:04 +09:00
Hermet Park
1eb11f249e common initializer: introduce thread count api.
this interface controls the number of threads working behind.

default is 0 == only syncrhonous.

Change-Id: I8404f33359e6213acc5e578061568fede50cd9a6
2020-08-14 18:53:01 +09:00