Commit graph

2862 commits

Author SHA1 Message Date
JunsuChoi
02a0e98596 SvgLoader: Support x,y rounded rect
Change-Id: I45d8f7ff3604da0a80c09e2495ed8c0301310094
2020-07-07 02:37:27 +00:00
JunsuChoi
0d19700b4e SvgLoader: Support ellipse draw
Change-Id: I6420673d8341a59b91546224576d1c977c1a08d2
2020-07-07 02:30:06 +00:00
Hermet Park
cfa17c6df6 svg_engine: fix infinit loop dead in stroke rendering.
here logic was wrongly introducedd, we fix the condition check properly.

Change-Id: I97f18f68290c61096f4e7fe54bd6f6fde51e175b
2020-07-07 11:26:28 +09:00
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
add79b07cd sw_engine: Draw shapes even though there is no explict closed command.
This behavior is not confiremd but it's beneficial for svg spec.

Change-Id: Ia711c057811ae51e472b4e164b36f3dd6af9893f
2020-07-01 16:51:53 +09:00
Hermet Park
e0b66b1c3d Merge "SvgLoader: Don't use custom transform" into tizen 2020-07-01 07:36:15 +00: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
JunsuChoi
8c815e95c8 SvgLoader: Don't use custom transform
Change-Id: Ia7cd0992bbb8d5ee117806ee62b35604ffd91e16
2020-07-01 14:07:17 +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
4bc0b584f3 sw_engine: flush all processing data when clear() is requested.
there was a missing point which occured corrupted data in multi-processing.

Change-Id: Ifb28ee82852e488d23d45b4b75f0a6c70bb428b2
2020-06-30 12:38:01 +09:00
Hermet Park
55e347cbbc Merge "SvgLoader: Supports Path's quadratic_to draw" into tizen 2020-06-30 01:22:25 +00:00
JunsuChoi
9ba6bd654e SvgLoader: Fix typo
rect types w, h -> width, height

Change-Id: I5e85360644d9b8c2b2d84f182a0de16fefe9edbf
2020-06-29 11:20:19 +00:00
JunsuChoi
be6615d93e SvgLoader: Supports Path's quadratic_to draw
Convert quadratic bezier to cubic

Change-Id: I885138dcdfb9f0e85bf3ca1ca5c9fc4eb0d8f1f8
2020-06-29 16:35:21 +09:00
JunsuChoi
3fe2eedd89 SvgLoader: Implement svgpath draw
Convert Svg path in string to tvg::PathCommand.
Draw converted data by adding it as path to shape.

Following tags are supported.
Move, Line, Cubic, SCubic, Vertical, Horizontal and Close.

Change-Id: I3cb31e05bcb233b4c187e0c9e7eef8cdadf84695
2020-06-29 07:17:22 +00:00
JunsuChoi
e9d6bd7833 SvgLoader: Implement SvgSceneBuilder using SvgNode
SvgSceneBuilder builds Scene using SvgNode tree.
build(root node) function return the root scene.
Following SVG tags are supported.
Polygon, Polyline, Circle, Rect, Line

Change-Id: I8c9b8c28d9a4799af6ddc45c35f77a75f696b2a5
2020-06-29 16:16:08 +09:00
JunsuChoi
3a8d6821ba SvgLoader: Implement SVG Loader and SimpleXMLParser
Load svg using fstream and parse it using SimpleXMLparser.
And Make a document tree composed of SvgNodes using the parsed data.

Change-Id: I5715b466638195844798f7b66f54f6015e7c3ae6
2020-06-29 07:14:06 +00: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
ad5f147c74 sw_engine: fix a regression bug.
this matrix data is volatile since it's coming from stack memory.
thus engine should record its own memory space for keeping it.

Change-Id: I664dd56412f4d236ad04c312220c67da226274e5
2020-06-25 13:31:45 +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
9ffc1d40f6 sw_engine: optimize memory allocation.
there are a logical wrong that memory increase size,
it correct that also tune the number to reduce memory allocation time.

Now scene transform test works smoothly.

Change-Id: If0674e33426d794546801a96ad9de711b5de0dcd
2020-06-23 18:59:12 +09:00
Hermet Park
b212df1061 sw_engine stroke: initialize a missing variable.
Change-Id: I1c3d83d56045f592ff89a5462d4de494e50c9d34
2020-06-23 17:38:59 +09:00
Hermet Park
55e215e6ea sw_engine: optimize span generation.
there are unnecessary partial spans generated in orthogonal rectangle.

we can merge those partial spans to others if they are on the same scanline...

Change-Id: I35a437a4f2eec106bd50f46f0390c652e617311d
2020-06-23 17:29:28 +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
4f48c856f6 sw_engie: fix wrong boundary check.
this bounding box max indicates absolute positions,
not width/height size.

because of this, shape couldn't rendered properly,
when it's clipped out.

Change-Id: I0afb0d6e63d1b511b83716c55f55e3fd5370fdb8
2020-06-23 14:15:47 +09:00
Hermet Park
a9d712e06e Merge "common transform: support matrix transform interface." into tizen 2020-06-23 02:31:23 +00: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
ab5c1bc441 common bezier: code refactoring.
Organize bezier functions for internal share.

this bezier can be used in svg loader.

Change-Id: I78acd3273c0528688ca46ff7c29d78607bd729bd
2020-06-22 17:07:53 +09:00
Hermet Park
f56a3b791c comon render: split declaration and body.
Change-Id: I39eb1dfb929b7811fab82956aedbb15f001390e7
2020-06-22 16:44:36 +09:00
Hermet Park
538254a32d common render: code refactoring.
just replace the filename.

Change-Id: I6b18520d33c7db3ac9d6c44b10dd693b204495e5
2020-06-22 16:30:18 +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
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
ec03afa83a sw_engine renderer: accept stroke less 1 width size.
Change-Id: I5fe6a0993ab5c1abc79d89834ea04c25b059c320
2020-06-18 10:41:58 +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
fb208defed common engine: manage engine initializing context.
Change-Id: Ida3997fd7cc9ee0916d48290168cdb884e946833
2020-06-15 20:57:17 +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
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
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
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
4e3f8284e8 sw_engine: grow cell memory buffer up to allow larger shapes
Change-Id: I7a8feaa11d3dad81dd1004782e07a8ac4a768d91
2020-06-09 11:03:18 +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
98edb4112b sw_engine shape: ++ comment for later optimization
Change-Id: Ie6cd622748b88e2bce0c9d9a79cc4528a95c9c5c
2020-06-03 19:17:42 +09:00