Commit graph

117 commits

Author SHA1 Message Date
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
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
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
09fce05105 svg_loader: code refactoring
revise code for simple & better readibility.
2020-09-01 17:51:00 +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
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
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
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
709548701a loader svg: code refactoring.
renamed svg loader path.

Change-Id: I0219721540ea981d15d17b9571c1ee9b37651fb8
2020-08-14 18:47:50 +09:00
Renamed from src/loaders/svg_loader/tvgSvgLoader.cpp (Browse further)