Hermet Park
2c78945483
gl_engine renderer: fix build break.
...
interface has been changed. make it up-to-date
2020-12-01 16:13:51 +09:00
Michal Szczecinski
a36e25e178
common capi: Added scene clear API
...
Scene::clear() API allows users to remove shapes on their own, without
a crash in paint->dispose() or tvg_paint_del() methods. This case is
needed especially when thorvg is used to draw frames, when in one frame
we have scene with shape, and in next frames (future time stamps) user
deletes shapes
@API additions
Result Scene::clear();
Tvg_Result tvg_scene_clear(Tvg_Paint *scene);
Example:
```c
Tvg_Paint *scene = tvg_scene_new();
Tvg_Paint *shape = tvg_shape_new();
tvg_scene_push(scene, shape);
tvg_scene_clear();
//Now we can safelly free resources manually
tvg_paint_del(scene);
//Without tvg_scene_clear() memory allocatad for shape was double released
tvg_paint_del(shape);
```
2020-12-01 15:39:08 +09:00
JunsuChoi
676e824719
common Scene: Fix validation check for child's bounds
...
Fix typo. and Change return to continue.
Even if the child's boundary calculation is wrong,
other child's boundary should be calculated.
2020-11-30 15:36:36 +09:00
JunsuChoi
1bdf1c72a4
common Test: Add Paint.bounds unit test
2020-11-30 15:36:36 +09:00
JunsuChoi
d8d754e969
sw_engine Raster: Add null check for transform
...
If transform is null, identify matrix is used.
2020-11-30 15:32:30 +09:00
Michal Maciola
7ec52e6c9e
Picture capi binding
2020-11-30 13:16:20 +09:00
Michal Szczecinski
01aef488f0
capi: Added fill rule API.
...
Added capi binding for fill rule setter and getter.
@API changes:
enum Tvg_Fill_Rule {
TVG_FILL_RULE_WINDING = 0,
TVG_FILL_RULE_EVEN_ODD,
}
Tvg_Result tvg_shape_set_fill_rule(Tvg_Paint* paint, Tvg_Fill_Rule rule)
Tvg_Fill_Rule tvg_shape_get_fill_rule(Tvg_Paint* paint, Tvg_Fill_Rule* rule)
2020-11-30 13:08:24 +09:00
Hermet Park
b125a7ea2e
examples: ignore loading raw image file.
...
in the last commit, it added a raw image file in the images folder.
It breaks Multicanvas, Svg which try to load all kinds of files in it.
We don't need to load all files by figuring out file extension name.
2020-11-23 18:56:23 +09:00
JunsuChoi
e00f948705
raw_loader Loader: Introduce Raw image loader
...
Add RawLoader class that loads and display raw images,
and adds a Rasterizer for image data.
Image data can be loaded via picture.
Loaded image supports Composition, Transformation and Alpha blending.
New API
Result load(uint32_t* data, uint32_t width, uint32_t height, bool isCopy) noexcept;
2020-11-23 18:12:36 +09:00
Michal Szczecinski
e259213b44
capi: Added free flag to clear API.
...
Cpp implementaiton of library has free flag which was not used in
capi bindings.
@API changes
from: tvg_canvas_clear(Tvg_Canvas *canvas);
to: tvg_canvas_clear(Tvg_Canvas *canvas, bool free);
2020-11-20 12:04:22 +09:00
Hermet Park
a71773f98d
common taskScheduler: code refactoring
...
removed unnecessary code.
2020-11-11 13:55:46 +09:00
Subhransu Mohanty
c2e1583e94
common taskScheduler: fix a synchronization data race.
...
std mutex shouldn't be used among threads. behavior is unexpected by implmentation.
This resolves it by introducing conditional value.
2020-11-10 16:45:52 +09:00
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