replace dynamic_cast to static_cast,
This can be a controversial choice between optmization and clean code.
Obviously we know the converting types,
try avoiding a bit heavier casting some cases.
Change-Id: Id763e6d1db449a229a492ab5b1a901a195936152
We prefer to build up a tiny compact engine at memory rather than compatibility,
this engine is not considerd for end-users but designed for middle-level framework
and some low-level users.
Thus, we won't consider 64bits data size,
use explicit 32 bits data until coming next upgrade...
Change-Id: I0704d5f1e0eb909cccc10922bc5972e115fbbcc0
Introduce Result type for notifying caller more detailed info.
We should implement the result values for each apis, with practical values.
Change-Id: Ia47abcb56a8efca7094ac3eed0178aeac8aa2910
also updated transform test cases.
Yet, this engine is not well optimized,
If they are too mch sluggish,
you can use ELM_FPS envrionment lowing down the fps
when you launch test cases...
ex) $ELM_FPS=30 ./testSceneTransform
Change-Id: I1871d5bedee010d5d6a3d877d95e257120796e8b
../src/lib/sw_engine/tvgSwStroke.cpp:282:72: error: no match for ‘operator<’ (operand types are ‘long int’ and ‘const SwPoint’)
if (border->ptsCnt > 0 && abs(diff.x) < EPSILON && abs(diff.y) < EPSILON) return;
Change-Id: I426f8980ba718e3dc908dc32a62fb897b5b5fbbf
Each scene could conserve its own transformation,
the origin could be the parent Paint (if they were beloned to)
Thus, you can compose the multi-tranformed scene group which
simultenoulsly working in own spaces.
See testTransform and testSceneTransform, how they work.
Change-Id: I51deb4d66f8fcd024f8dc7a1e1af57c398a9d7fe
Paint supports translate, rotate, scale functions for transformation
The origin of these transformation is center of the paint,
thus you have to consider the center-aligned vertices if you'd like to use
these transformation functions.
This policy has been considered for scene transformation.
Change-Id: I78b63d7965faec0ec5b9a98a7776993744534b54
Scene is a group(list) of paints.
This class is designed for vector data set which is prepared before canvas.
If a set of vector data is loaded from other resources such as files,
they can construct these data set using Scene.
This then can be pushed into canvas as one completed image.
Scene is supposed to be used in svg loading and storing to tvg specific data format(tvg)
Change-Id: Ie2ffebf74e79c59d99a77880630a54b6baad7eec
hide engine() interface of shape that's not friendly one by users.
instead canvas would access shape internal data to update/draw it.
Now Paint cannot update itself but has to request to Canvas for it.
Change-Id: Ibafd0864a65c3c33238789d1a3e06c49c4378349
Come to think of it, this optimized method is not so useful,
it could just bring the user misunderstanding and
not to efficient as I expected in the most cases.
So, changed policy for transformation behaviors.
it keeps the properties as others but leaves it to the backend implementation.
Plus, this change contains the correct RenderUpdateFlag.
You can refer the flag in the backend to figure out which kinds of properites has been updated
Change-Id: Ibe0494712598a8161950b9ae2e22ac45bed1c47b
rotate(), scale() won't be retained.
When you call reset() for the shape, these values will be reset as well.
These are working in fire & forget method,
it actually modify the path data for avoiding compuatation every frames.
Thus user needs to keep the last values to understand the final accumulated values.
Change-Id: I41f260271cdefc977eea01a778d49632440c777f
PaintNode -> Paint
ShapeNode -> Shape
SceneNode -> Scene
We can keep clean and neat shorter names.
Change-Id: Ic8521d456d947985e5fbe1ba2bde06faa1f52469
Also, added one more showcase how to update only necessary properties of a shape
while retaining other properties...
Change-Id: If165bc7f8147cad0437e3ca2f7c007614c256248