Michal Szczecinski
d1d54e8b8f
capi examples: Added scene API C bindings.
...
Scene CAPI allows to use scene functionaliy in C applications such as
set opacity to few shapes at one time or implement transparent layers.
@API Additions:
```c
Tvg_Paint* tvg_scene_new();
Tvg_Result tvg_scene_reserve(Tvg_Paint* scene, uint32_t size);
Tvg_Result tvg_scene_push(Tvg_Paint* scene, Tvg_Paint *paint);
```
Examples:
```c
Tvg_Paint *scene = tvg_scene_new();
Tvg_Paint *shape1 = tvg_shape_new();
tvg_shape_append_rect(shape1, 10, 10, 100, 100, 0, 0);
tvg_shape_set_fill_color(shape1, 255, 0, 0, 255);
Tvg_Paint *shape2 = tvg_shape_new();
tvg_shape_append_rect(shape2, 120, 10, 100, 100, 0, 0);
tvg_shape_set_fill_color(shape2, 255, 0, 0, 255);
tvg_scene_push(scene, shape1);
tvg_scene_push(scene, shape2);
tvg_paint_set_opacity(scene, 100);
tvg_canvas_push(canvas, scene);
```
Co-authored-by: Michal Szczecinski <m.szczecinsk@partner.samsung.com>
2020-11-10 12:13:48 +09:00
Hermet Park
3fabd604bf
examples capi: removed printf()
...
there is no point to print information.
2020-11-09 14:43:15 +09:00
Hermet Park
9872cf066d
common taskScheduler: thread sync optmization
...
replaced future/promise with mutex since they use a lot of memory allocation number.
plus, binary size is reduced from 2094896 -> 1746864
2020-11-09 14:36:22 +09:00
Hermet Park
e445b7f579
Revert "examples: revise example code."
...
This broke gl_engine rendering, revert it.
This reverts commit 9bb1972ef9
.
2020-11-06 15:37:17 +09:00
Hermet Park
bb4c6b299f
common renderer: code refactoring.
...
renamed internal methods from flush() to sync()
since flush() is reserved for caching flush.
2020-11-06 15:26:47 +09:00
Hermet Park
9718c6aa5b
gl_engine renderer: fix build break.
...
just found a missing change for the fillColor api.
2020-11-06 15:25:11 +09:00
Hermet Park
5751fd13cc
sw_engine mempool: ++optimization
...
These memory pools requires very simple mechanism.
Remove stl vector but use direct memory for less binary size.(2127696 -> 2094094)
@Issues: 75
2020-11-06 13:54:53 +09:00
Hermet Park
c6013536ec
common shape: memory optimization
...
All shapes will have path data,
avoid unnecesary dynamic memory allocation internally.
@Issues: 75
2020-11-06 11:47:51 +09:00
Hermet Park
8d03f131a3
updated AUTHORS
2020-11-06 11:33:09 +09:00
Vincent Torri
5a85b40f6c
fix compilation on Windows
2020-11-06 11:28:54 +09:00
Vincent Torri
8243b3a1f5
fix compilation on Windows
2020-11-06 11:28:54 +09:00
Hermet Park
006e6e0920
sw_engine rle: performance optimization.
...
Tis is a subsequential trial of 1b8188ee67
for opimizing memory alloc count.
In this time, it concentrates on rle span.
@Issues: 75
2020-11-05 17:32:42 +09:00
Hermet Park
2b762f00e2
Update README.md
2020-11-05 14:44:43 +09:00
Hermet Park
39ea685edb
Update README.md
2020-11-05 14:43:32 +09:00
Hermet Park
ad9460444a
Update CONTRIBUTING.md
2020-11-05 13:57:21 +09:00
Hermet Park
5fbc446455
Update README.md
2020-11-04 21:01:22 +09:00
Hermet Park
9ba5f740d5
res: updated thorvg card images.
2020-11-04 20:59:19 +09:00
Hermet Park
1d3c56e487
sw_engine mempool: performance optimization.
...
This is a subsequential trial of 1b8188ee67
for opimizing memory alloc count.
In this time, it concentrates on stroke outline.
@Issues: 75
2020-11-04 20:42:01 +09:00
Hermet Park
410fa6c115
sw_engine mempool: changed caching policy.
...
for smart usage, clear memory only when engine is terminated.
2020-11-04 19:20:29 +09:00
Hermet Park
3ab1194773
common sw_engine: code refactoring
...
replaced names and fixed out of coding convention.
2020-11-04 19:18:59 +09:00
Hermet Park
9bb1972ef9
examples: revise example code.
...
Move the Clear call to the end of drawing those scenarios doesn't need to retain paints resources.
We should show the examples as the best usage.
@Issues: 75
2020-11-04 19:05:11 +09:00
Hermet Park
1b8188ee67
sw_engine shape: performance optimization.
...
we introduced shared memory pool for avoiding reallocate memory
while it process the stroke outlines, It experimentally increase
the outline data if we use the allocated memory for multiples shape strokes,
we don't need to alloc/free memory during the process.
This shared outline memory is allocated for threads count
so that we don't interrupt memory access during the tasks.
@Issues: 75
2020-11-04 16:28:47 +09:00
Hermet Park
fbe5b87106
res: polishing example pictures.
2020-11-04 11:47:17 +09:00
Hermet Park
b8128e0083
Update README.md
2020-11-04 11:33:27 +09:00
Hermet Park
6eba3591a5
Update README.md
2020-11-04 11:32:27 +09:00
Hermet Park
52426c56e6
res: adds working-flow picture.
...
this picture will be used in README.
2020-11-04 11:29:13 +09:00
Michal Szczecinski
882188c752
common capi: Added opacity C bindings.
...
Added opacity setter/getter to CAPI. They will be useful to simplify
code responsible for set visiblility of paint.
@API Additions:
Tvg_Result tvg_paint_set_opacity(Tvg_Paint* paint, uint8_t opacity)
Tvg_Result tvg_paint_get_opacity(Tvg_Paint* paint, uint8_t* opacity)
2020-11-04 10:37:55 +09:00
Hermet Park
ec2ec6e9c6
Update README.md
2020-11-03 16:23:29 +09:00
Hermet Park
acd17e449f
Update README.md
2020-11-03 14:48:40 +09:00
Hermet Park
9aa4d6b309
res: updated example screenshot resources
2020-11-03 14:46:16 +09:00
Hermet Park
8fdc24d88c
Update README.md
2020-11-03 14:45:44 +09:00
Hermet Park
8eeb8685ed
Update README.md
2020-11-03 14:42:33 +09:00
Hermet Park
eb6b5d10ce
res: replaced primitive example screenshot.
2020-11-03 14:40:51 +09:00
Hermet Park
e02d3c30e9
Update README.md
2020-11-03 14:26:05 +09:00
Hermet Park
88cd205b16
Update README.md
2020-11-03 14:25:00 +09:00
Hermet Park
200016fea0
common LoaderMgr: code refactoring
...
keep clean & neat thorvg coding style.
2020-11-03 14:21:19 +09:00
Hermet Park
e9d1d13edd
res: adds primitive example screenshot.
2020-11-03 14:20:42 +09:00
Hermet Park
0549bc5cb9
Update README.md
2020-11-03 14:07:58 +09:00
JunsuChoi
af85eb22ad
svg_loader LoaderMgr: Delegates file validation check to LoaderMgr.
...
Delegates extension string check and header(open) check
for file to LoaderMgr.
This makes it easy to add a loader afterwards.
2020-11-03 12:15:12 +09:00
Hermet Park
627579522d
sw_engine shape: code refactoring.
...
thorvg always prefer simpler code, less LOC.
2020-11-02 19:25:36 +09:00
Mira Grudzinska
a96037cd57
sw_engine shape: change of the rectangle fast tracking algorithm
...
The algorithm erroneously treated some shapes (like isosceles trapezoids
and specifically arranged zero width parallelograms) as rectangles,
which causes the whole bbox to be filled.
2020-11-02 19:23:44 +09:00
JunsuChoi
dc822174e8
svg_loader: Fixed a typo
...
lenght ->length
2020-11-02 14:16:13 +09:00
JunsuChoi
9859a48714
test Canvas: Set up unit test based on gtest.
...
In test directory, set up unit_test based on gtest
First, add a test for SwCanvas generate.
2020-11-02 14:15:50 +09:00
JunsuChoi
d4e9450ec1
common lib/loaders: Fix missing space for coding convention
...
Correct missing or incorrect spaces according to coding convention.
2020-11-02 14:15:05 +09:00
JunsuChoi
1bf123ff46
svg_loader SvgLoader: Fix wrong indentation
...
indent 3 -> 4
2020-11-02 14:14:36 +09:00
JunsuChoi
6cf2d89571
svg_loader SvgLoader: Prevent memory overflow for tagName
...
When copying tagName, if length of referenced string is longer
than general case, it is not used as tagName.
2020-10-30 17:06:06 +09:00
Hermet Park
0399d84478
common paint: introduce opacity() method.
...
We introduced separate opacity interface to adjust alpha value by paint.
This opacity will affect to whole paint image if paint is a group of paints.
Also, this opacity is to multipy with fill/stroke alpha values.
This means if the opacity is valid, the paint might deal with a composition step,
which is very expensive due to additional rendering step.
One tip is, if you want to toggle on/off for a certian paint,
you can set opacity to 255 or 0.
@API Additions:
Result Paint::opacity(uint8_t o) noexcept;
uint8_t Paint::opacity() const noexcept;
@Examples: examples/Opacity
@Issues: 94
2020-10-26 19:23:54 +09:00
Hermet Park
da4b57e763
examples fillrule: revise code.
...
just adjusted start points for better visual.
2020-10-26 17:13:02 +09:00
Hermet Park
73c7782749
examples svgs: replace logo design resource.
...
White background is our official thorvg logo,
cyan is for Tizen customed.
2020-10-26 16:52:52 +09:00
Mira Grudzinska
34a832d033
sw_engine shape: adding a dash pattern switch condition
...
Preventing switching to the next dash pattern for a line with a length of zero.
2020-10-26 16:40:42 +09:00