Commit graph

77 commits

Author SHA1 Message Date
Hermet Park
f335779ce5 sw_engine stroke: stabilizing line drawing.
Also added StrokeLine test

Change-Id: I91143039823d744bf9287534227927556a2f51e1
2020-06-03 19:10:14 +09:00
Hermet Park
01b550497c sw_engine: support stroke transformation properly.
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
2020-06-03 12:08:48 +09:00
Hermet Park
ad6b74dd13 test scene: remove duplicated engine initialization.
Change-Id: I5a2f972544e47578552b0c49367749ce2d01c5f2
2020-06-03 11:41:40 +09:00
Hermet Park
2b53b8018a test stroke: remove duplicated engine initialize call.
Change-Id: Ia592a45581eae4fd5c85e6ba4d9d0eef835b14c1
2020-06-03 11:35:03 +09:00
Hermet Park
3bb272877a sw_engine: fix a missing of variable initializing.
Change-Id: I6451b07709fbc56441363e8f0ee0f4647404ae10
2020-06-03 11:27:34 +09:00
Hermet Park
7ee25cd783 sw_engine: fix mistached c style alloc/free
these are allocated by c style mem alloc.
Thus, they should be freed with free()

Change-Id: I320fff4d5a5bce2374ace6495a9f96c3e1034cfc
2020-06-03 11:15:40 +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
8614a2efee sw_engine: fix stroke join round result.
a trivial reversed value was returned that
brought the inverted arc drawing...

Change-Id: I928f05b3400772a367d1653496d385354032cbad
2020-06-02 20:25:54 +09:00
Hermet Park
bab258e004 test: revise stroke example
Change-Id: I92a40e905544fd8fb41df88810eabce7429b1b7f
2020-06-02 20:07:05 +09:00
Hermet Park
1686af7643 sw_engine: implement stroke rle part
Current stroke fails to merged shapes case...

you can test with testStroke example

Change-Id: I488af728949cba1d01b88723eb1dc4c49bac6c9b
2020-06-02 18:46:43 +09:00
Hermet Park
41dbd9774a sw_engine: implement stroke cubicto, arcto, lineto
Change-Id: I59e95b1031ebfaf54e966cab334e045613ca3830
2020-06-01 19:20:29 +09:00
JunsuChoi
6744838453 sw_engine: Fix build error (no match type)
../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
2020-05-29 15:31:43 +09:00
Hermet Park
b4cf6660b7 test: recover sample build.
introduced by mistake.

Change-Id: I8fd88054da1e86cace02931791a646a182ab6721
2020-05-28 20:37:25 +09:00
Hermet Park
c51241f26b sw_engine: implment basic stroke functions.
Change-Id: Ib9203b4d133ce7ffd80b40d7ad0cac3519b5273d
2020-05-28 20:32:55 +09:00
Hermet Park
6b54eb5c22 updated AUTHORS
Change-Id: Id756d25e475e8f8cb8379577032e5b41e772b88e
2020-05-27 11:03:07 +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
a5f15a588c common scene: complete scene tranfsormation feature.
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
2020-05-17 21:38:15 +09:00
Hermet Park
1f6da2d0b6 test: update samples
fix some broken test code.

Change-Id: I42b0dd8b4c599ea59e0860a40b828936dca1e54d
2020-05-17 20:52:58 +09:00
Hermet Park
2f833298c3 test: update transform sample
Change-Id: I7f1416d9e32b241e50b7e2132764cac28d590a93
2020-05-17 20:35:40 +09:00
Hermet Park
fdbf42f478 common: support Scene Transform
this contains testSceneTransform example

Change-Id: I460b05dc8bc4a842e26e950c800c5c35f8d3da7f
2020-05-17 16:50:47 +09:00
Hermet Park
2f2efb73dd common shape: revise RenderTransform for Scene Transformation
This RenderTransform takes over all transform information.

Change-Id: I21b6a55de05feca56c40f3ff402d18445417463c
2020-05-17 15:09:20 +09:00
Hermet Park
40ef2f1575 fix wrong flag operation.
just correct mistakes.

Change-Id: I8de0fe68cd298cacf3bdc951f67657095c5fa5fe
2020-05-06 11:56:17 +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
17af011eae common scene: support bounds() method
this method returns boundary of a scene.

Change-Id: I1a32c8e034f53822008048f1d8ae7062fb72cca3
2020-05-05 20:38:26 +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
f4de03b01a test: updated test samples.
1. added testTransform
2. replaced testShape with testMergeShapes

Change-Id: I1f7b25a1d2f62ac682f7a19e75fc3a44db7c52f0
2020-05-03 15:14:01 +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
60d104a40a sw_engine: code refactoring.
renamed internal variables for better readibility.

Change-Id: I1ba7938401e8b7249c8bcc396be1ba3c109716cd
2020-05-02 17:44:49 +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
11e070d167 sw_engine: support anti-aliasing
Change-Id: I9b79c8b4022ddf2ae4fe980f480ba3ec140750d3
2020-05-01 17:48:21 +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
2f174560eb test: rename testPath to testPathCopy
Change-Id: I8cf2a26437a804d2cd061d61d3a99b3c6f3aa0e6
2020-05-01 12:46:54 +09:00
Hermet Park
14efeb4f0b test: updated comments
Change-Id: I92fccb5a9de088f837a768a2f1d60ac94eac9410
2020-04-30 23:40:35 +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
308456ebad common shape: remove unnecessary log
Change-Id: Ie85153afdc01270ed282d9ff87607ee1a882be31
2020-04-30 18:38:34 +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
e0ecd680a0 sw_engine: fix crash at merge shape test
increased spare cell memory for rasterizing.

Change-Id: I391dfbfae0ef028d213c55fe1ceca023e272e676
2020-04-30 15:43:13 +09:00
Hermet Park
46ba3352a8 sw_engine: case cover out of surface boundary.
Also added surface boundary test code.

Change-Id: Ib4c327d12ce52d506f1b8a566ffa48e5b5b8c03e
2020-04-30 15:19:46 +09:00
Hermet Park
5120a7ae12 canvas: correct convention
add missing noexcept option.

Change-Id: I14eacb0fdb2c9bd40e365bf81bb5cc0b73239ffe
2020-04-27 02:00:38 +09:00