Introduce internal PaintMethod since there more derived paint classes are coming.
This PaintMethod is a sort of Strategy Pattern method.
Change-Id: I29c49f5d4ddbfb9e429d4976636b20b39914ee20
1. removed async option which doesn't work currently,
rather than it, we can add async option in initiailizer class.
2. removed update() method.
Instead, we can call update(paint = nullptr); which has exactly same behavior.
Change-Id: I7909a50d804b97baf413a2ff6365a3cf79a3689e
transform interfaces are getting duplicated in derived classes.
we moved to the super for smaller apis count.
Applied strategy pattern to hide the inheritance.
Change-Id: I7b0c3ff9317e9bf3c97bb0c849bf55e79ee9a591
this interface is designed for user-defined arbitrary affine-transform paints.
required by svg loader.
Change-Id: I7f08023605d224e36cef3770098d3757aee81848
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
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
Obivously, we need to clear target before drawing.
Thus canvas request to renderers to clear buffer.
the implementation is upto backend engines.
Change-Id: Ib80da7f2260b021bcfed9fa13fb91c20218f9da0
+lineTo()
+moveTo()
+cubicTo()
+close()
These interfaces might not perfect optmizied,
but you can build path commands easier than manual data set.
Change-Id: Icb934ca256d3107ca0c938d28015d767fb93355e
it's usage may require a little handy but
The path data is very low manipulated, its usage may require a little handy,
but appedingPath() is designed for performance.
Also added testPath.
Change-Id: Ifd929d48506926e3f529198c0b40ee8f922835d4
This allocates nodes slots in advance to avoid memory grow & copy.
it will be benefit if you know how many shapes will be used in your canvas.
Change-Id: I7d93d166c9c054078bd86593d3471a2ade3671ee