Commit graph

45 commits

Author SHA1 Message Date
Hermet Park
c235b7b81d common scene: design load()/save() interfaces
these interfaces will perform for vector resources such as svg/tvg/etc ...

see testSvg examples

Change-Id: Icec0a4682301a13646868bd7c3bfc1771ae7db2c
2020-06-16 16:29:26 +09:00
Hermet Park
f627679882 common initializer: replace engine class with intializer
This initializer will take over the global environments of tvg engines.

Change-Id: I7b99973dafaea57ddd3134800bd442ef4dc319ae
2020-06-16 12:54:53 +09:00
Hermet Park
5c988d01a5 sw_engine: implement linear gradient feature
also added testLinearGradient

Change-Id: I9cce74b9fc40c4ebd978939ee50955e44e7f44f2
2020-06-13 12:09:39 +09:00
Hermet Park
f3afd2a636 common fill: added spread mode.
Change-Id: I95d47bc492d5a22326a745a591d243e56a26bae4
2020-06-11 14:27:20 +09:00
Hermet Park
c36f23e80d common gradient: implement linear/radial gradient interfaces.
Change-Id: Ica9c54e662e73592d3fddcabed09b1605b3a5a4f
2020-06-10 17:03:25 +09:00
Hermet Park
c75cca5a13 common: code refacatoring.
shorter prefix for better neat code.

it's just a preference.

Change-Id: I30998476a92bc971193e9a5b4436687e48e4d19a
2020-06-09 20:45:27 +09:00
Hermet Park
498a024df8 common: ++optimization
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
2020-06-09 20:32:22 +09:00
Hermet Park
58de99aea3 common interface: replace arguements size_t to uint32_t
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
2020-06-09 15:36:34 +09:00
Hermet Park
33e1d4b170 common interface: concrete return type.
Introduce Result type for notifying caller more detailed info.

We should implement the result values for each apis, with practical values.

Change-Id: Ia47abcb56a8efca7094ac3eed0178aeac8aa2910
2020-06-09 15:16:25 +09:00
Hermet Park
9aa2566b45 sw_engine: support stroke dash feature
Change-Id: Ibed8bcb6a07952a059bb9a7355f7c43db97aa672
2020-06-06 12:21:30 +09:00
Hermet Park
dc5f9f7430 common: retyped the color value size_t -> uint8_t
since it's range is 0 - 255.

Change-Id: I16e0569341c4a94acab9488d076f235bf90ff4db
2020-06-04 17:49:10 +09:00
Hermet Park
ef9f31577e common stroke: retype the stroke width from size_t to float
Change-Id: I812d06d2037d66408c41d50f7c1ff7ba605558bd
2020-06-02 20:58:50 +09:00
Hermet Park
e2c6f4523c Merge "gl_engine: gl infrastructure interfaces" into tizen 2020-05-27 02:01:26 +00:00
Prudhvi Raj Vasireddi
48e47b272b gl_engine: gl infrastructure interfaces
Change-Id: Ie1a9d1b6632433413098282c1cfaf4cf8e1cf9b9
Signed-off-by: Prudhvi Raj Vasireddi <prudhvi.raj@samsung.com>
2020-05-26 13:56:35 -04:00
Hermet Park
4799426396 common shape: introduce stroke cap and join styles.
+ revise the getter functions for avoiding invalid overloading.

Change-Id: Ie8b0cbe57435253d75871e864c7cd263a14d6df3
2020-05-23 13:32:28 +09:00
Hermet Park
a0521c83c3 common paint: revise bounds interface.
we don't use the reference style for user interfaces.

Change-Id: Id70682bf8c2d8ea9ffab2ea6fb567eaa8639da60
2020-05-22 16:32:32 +09:00
Hermet Park
19999e7abd common stroke: implement stroke interfaces.
Change-Id: I28fe5d5df4cde6640b143e67e241c6afc9c6b1fe
2020-05-22 16:18:32 +09:00
Hermet Park
b08d144dc9 common shape: introduce transformation matrix
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
2020-05-06 02:05:09 +09:00
Hermet Park
0716d3e774 common scene: implement basic scene behaviors and testScene sample.
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
2020-05-05 10:27:35 +09:00
Hermet Park
4ff97a6a40 common canvas: hide engine() interface
this engine() is not necessary by users,
we can hide this by moving out CanvasImpl class.

Change-Id: Iaf47dbd3c523e96d6af0bd1fd4caa11a7fd3778a
2020-05-04 21:27:41 +09:00
Hermet Park
211dafdaed common shape: refactored interfaces.
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
2020-05-04 21:12:29 +09:00
Hermet Park
682bc25298 common shape: revise scale/rotate approach.
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
2020-05-03 15:03:29 +09:00
Hermet Park
30ac2da1a3 common shape: support scale/rotate transform
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
2020-05-02 23:01:16 +09:00
Hermet Park
42c56757df common: redesigned interfaces
PaintNode -> Paint
ShapeNode -> Shape
SceneNode -> Scene

We can keep clean and neat shorter names.

Change-Id: Ic8521d456d947985e5fbe1ba2bde06faa1f52469
2020-05-02 18:20:50 +09:00
Hermet Park
1b3661a0b0 common shape: renamed the method clear() to reset()
Also, added one more showcase how to update only necessary properties of a shape
while retaining other properties...

Change-Id: If165bc7f8147cad0437e3ca2f7c007614c256248
2020-05-02 18:07:51 +09:00
Hermet Park
0be7e0cf53 canvas: migrate render target clear call into draw();
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
2020-05-02 17:33:41 +09:00
Hermet Park
a8864390e2 canvas: code refactoring
accept an extra argument in the clear() to clear paints node

and clear buffer selectively.

Change-Id: I83721e74358f546f325bb03fd1f36c7565174dd7
2020-05-02 11:25:07 +09:00
Hermet Park
c923d881aa test: added testUpdate
this shows a moving shape:

how to update canvas every frames.

Change-Id: I373e39757f4511d4e676f36d76e468d03b185a0c
2020-05-02 10:55:33 +09:00
Hermet Park
74d2f275e7 sw_engine: support color blending
this contains testBlending as well

Change-Id: Ia0aadea804a973cfe8ec981ed1b21c1b44512ef2
2020-05-01 14:45:16 +09:00
Hermet Park
700a44c623 common shape: added path commands interfaces for user convenient.
+lineTo()
+moveTo()
+cubicTo()
+close()

These interfaces might not perfect optmizied,
but you can build path commands easier than manual data set.

Change-Id: Icb934ca256d3107ca0c938d28015d767fb93355e
2020-04-30 23:36:28 +09:00
Hermet Park
9b8ab42e54 common shape: support path appending
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
2020-04-30 18:33:01 +09:00
Hermet Park
5120a7ae12 canvas: correct convention
add missing noexcept option.

Change-Id: I14eacb0fdb2c9bd40e365bf81bb5cc0b73239ffe
2020-04-27 02:00:38 +09:00
Hermet Park
809dfd8644 canvas: add reserve() method.
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
2020-04-27 01:52:44 +09:00
Hermet Park
0e6faa9276 common: code refactoring.
introduce Canvas class to replace the CanvasBase.
now, SwCanvas, GlCanvas inherits this Canvas for polymorphism
and remove duplicated interfaces.

Change-Id: I65a87e3aa2289d04997930a54aeccd14f57dd73a
2020-04-27 01:48:48 +09:00
Hermet Park
1e96cc2b10 common shape: support ellipse
Now, you can pass separate width radius and height radius in circle.

Change-Id: Ie1e2b58fbb399d8ef74d55d83ec48d8f4323f21e
2020-04-26 18:18:52 +09:00
Hermet Park
fe9c2c9162 common shape: implement appendCircle body.
Change-Id: Ib8507366f84532db3119f04c8d55e0d4e8206f9f
2020-04-26 11:38:06 +09:00
Hermet Park
37d34eeb19 sw_engine: concrete shape rendering sequence.
Succeed first sw backend screen up!

Change-Id: I882fb1726ed1f45e92e73fbc36170e93645dfbd2
2020-04-19 18:28:01 +09:00
Hermet Park
9b7337622d rename class names.
RasterMethod -> RenderMethod
SwEngine -> SwRenderer
GlEngine -> GlRenderer

Change-Id: Ic2ded698e49c4373fe21fe31fa34baca01bf43a2
2020-04-18 23:00:44 +09:00
Hermet Park
c8d800f6c6 sw_engine: implement line and curve raster
Change-Id: I22a77892544cd510cfe646aee60093cebb848806
2020-04-18 19:56:10 +09:00
Hermet Park
f9fcd58744 implement shape basics sw engine.
Change-Id: I93788f40f7c4f59bcc9ab4dff9127bcb4e6c1466
2020-04-04 13:47:20 +09:00
Hermet Park
701b482131 implement sw engine basic sequence.
Change-Id: Ide27c9b191088109f95e03fcd1c80ad3ecc058cd
2020-04-03 19:36:31 +09:00
Hermet Park
02b2d812e4 implement basic interfaces
major functions are added for Path specification.
added backend engine infra skeleton.

Change-Id: Ia923b02649cff545fa768ab8538ad7187195826f
2020-04-02 17:24:38 +09:00
Hermet Park
bf05660666 Update sample prototypes.
This is still a hard work and under the intensive settle up stage.

Change-Id: Ibfbeaabe8a51dc5edeeccf8fe75e65e60b91f703
2020-03-30 20:51:44 +09:00
Hermet Park
df94be1d9d build up base infra code for prototype.
Change-Id: I117a798caf4d9fedfe5c467471dee2f0150c2630
2020-03-30 16:36:13 +09:00
Hermet Park
c20274aaf8 + Initial draft
Introduce project skeleton such as build envrionment and interfaces
to build up code further cooperatively.

Change-Id: Ie9ac38991f609d33637283134906d7cc3f2ac19e
2020-03-25 11:53:03 +09:00