Commit graph

71 commits

Author SHA1 Message Date
Hermet Park
2929fa5c57 sw_engine: optimize rle rendering.
we don't need to apply anti-aliasing if stroke is there.
here turns off anti-alias if stroke width is more than 2.
magic number 2 is experimentally confirmed.

Change-Id: I09031dc2a0a84f31c5904651ed1e62004645ba9a
2020-07-03 18:32:50 +09:00
Hermet Park
322174d778 sw_engine: optimize othogonal rectangle drawing.
if the rectangle is not transformed, we don't need to use rle method.
we can directly raster pixels onto the bounding box.

Change-Id: I4e8b57149c0bcd78124d09388bf5115093a43bee
2020-07-01 15:53:47 +09:00
Hermet Park
0d5adb2f03 test: enable gl window only on gl backend.
Change-Id: Iafd790b7fc1df8a58bdce2f18c39029cc0d74945
2020-07-01 14:25:53 +09:00
Hermet Park
5faa94340f sw_engine: fix a regression bug.
Shape must have closed path for filling color.
if closed is skipped, it would take it's a line.

Change-Id: Ie1dcde9edbfc6501a34d6cb9ce54184ade6864db
2020-07-01 12:53:01 +09:00
Hermet Park
f377f33993 sw_engine: fix to update stroking transform
when shape doesn't have fill color, stroking is missed in update.

this fixs that issue.

Change-Id: I49292475e56caa834e79497a16db705b965bcf5f
2020-06-30 17:24:14 +09:00
Hermet Park
61cb144122 test: revise sample.
this patch adds the showcase how to handle exceptional cases.

Change-Id: Ic8e3c740bbf613f4dccace511b6c8d93b987a10c
2020-06-30 13:31:28 +09:00
Hermet Park
8bb8710815 test svg: remove white trailings
Change-Id: Ie23ffdd420eb9742b21350dfffd5b29ae0515be3
2020-06-30 10:24:56 +09:00
Hermet Park
918b6c69d8 test: unify test code for supporting gl engine from all test cases.
now you can launch tests with gl engine by "gl" option

ex)
$ testTransform gl
$ testScene gl

Change-Id: Idb720ed369a2fbfb908c977fdaebd7289986fb6f
2020-06-29 21:00:26 +09:00
JunsuChoi
654299d0ab test: Improve svg test
Displays svg files located in "./svgs" dir.

Change-Id: I4b9a281dc31fefb28c969780fa28adb74a5f5c02
2020-06-29 11:24:52 +00:00
Hermet Park
0a562a4ae2 test: print current backend engine name
Change-Id: Iaafa521556a614b47994914c09228b8e8ae9c9e9
2020-06-29 16:26:02 +09:00
Hermet Park
4d6dee91e4 test shape: unify sw/gl test code.
default is sw engine, please run sample app with "gl" argument

$./testShape gl

Change-Id: Iff7da624ff17827df957919341737b9f129f502e
2020-06-29 14:59:01 +09:00
Hermet Park
56e866dd36 renamed project name tizenvg => thorvg
we're going to open this project as the independent one,

thus removed tizen naming here.

Change-Id: Ib3c898067dd9186e893f7cb0903fd70d2ce7b31f
2020-06-25 13:57:41 +09:00
Hermet Park
28485d4b9c test: revise async(stress) test code.
Change-Id: I2005f12cc9552b4a98101ba53f48b04c9a6c5732
2020-06-24 20:16:58 +09:00
Hermet Park
4156de72f1 sw_engine: optimize rasterizey by threading it.
Also, newly introduced render interfaces: preRender(), postRender(), flush()

Change-Id: If506fa27e3c7dbd89f6734cad4774c1d151b88aa
2020-06-24 18:43:11 +09:00
Hermet Park
36c76ca73c sw_engine: threading optimization
make it prepare step asynchronously.

Change-Id: Ifb85f01d579cf1c111558842496b93fcaef74cd9
2020-06-24 14:35:23 +09:00
Hermet Park
35803e9c2b test: add stress test for performance profiling.
Change-Id: I4a1556c107ba59b7c972375ab8bfd22c777a5503
2020-06-24 13:38:13 +09:00
Hermet Park
86300c5fc0 sw_engine: optimize raster.
memset() is more than 10x faster than manual loop.

Thus we replace it to manipulate buffer pixels.

Change-Id: If0f255578f7d49ff6704c4f15e2eefe435cc3c15
2020-06-23 16:55:06 +09:00
Hermet Park
c6742e9590 common transform: support matrix transform interface.
this interface is designed for user-defined arbitrary affine-transform paints.

required by svg loader.

Change-Id: I7f08023605d224e36cef3770098d3757aee81848
2020-06-23 11:28:20 +09:00
Hermet Park
01e52c7c7a common loader: build up loader infrastructure.
Change-Id: I62aaed43015301ec39e414833f37d6c5485d8043
2020-06-19 15:46:02 +09:00
Hermet Park
0e25879d12 correct unmatched files permission.
Please keep file permission 664.

Change-Id: I90bdfa76b4f94a06d3b560df42509f30e59111a4
2020-06-18 18:44:52 +09:00
Hermet Park
9f82ea86a8 test: revise glShape sample.
turn on gl window for testing.

Change-Id: I8a965f820d4a09697bc4145147cb0940672933be
2020-06-18 18:41:10 +09:00
Pranay Kumar Samanta
968286df57 gl_engine: implement gl infrastructure interfaces & test Gl shape sample
Change-Id: Ie142616bf02f9bd50ac8e88e31ed9f782dd6324b
Signed-off-by: Pranay Kumar Samanta <pranay.ks@samsung.com>
2020-06-18 18:36:10 +09:00
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
7435b5b414 sw_engine: support gradient transformation properly
added testGradientTransform

Change-Id: I29037d08ce951e5ceb2eef31cb414efc25296417
2020-06-15 20:14:37 +09:00
Hermet Park
81de016492 test: updated trivial comments.
Change-Id: If44643d51d9acd3e3042118e39ca3e8f07c148da
2020-06-15 18:10:24 +09:00
Hermet Park
7366e8949b sw_engine: implement gradial gradient feature
also added testRadialGradient

Change-Id: If4a278cb4667c38c7842ad30edf5aa2fdd56fff7
2020-06-15 17:43:52 +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
c36f23e80d common gradient: implement linear/radial gradient interfaces.
Change-Id: Ica9c54e662e73592d3fddcabed09b1605b3a5a4f
2020-06-10 17:03: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
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
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
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
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
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
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