When both <defs> and <svg> gradients are declared,
the update of gradient declared in <svg> is omitted.
Therefore, this patch fixes any missing gradient updates.
When there is a matrix of linear gradient, the applied formula is this.
= T(x - cx, y - cy) x g->transform x T(cx, cy)
This patch has modified this formula to work properly.
In relation to the declaration of rx and ry attribute of rect, the following three cases occur.
rx="10" (or ry="10"
rx="10" ry = "0" (or rx="0" ry = "10")
rx="10" ry = "10"
To cover these case, we check the rx and ry declarations.
tvg canvas must draw retained shapes for every draw call
even though user missed call update() for shapes.
that case canvs must draw shapes without update,
it means drawing them within previous condition.
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.
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)
Reverted incorrectly modified code in 3b9bb51321.
The newly created node becomes a child of the parent parameter
and is deleted together when parsing ends.
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.
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.
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