Commit graph

37 commits

Author SHA1 Message Date
Hermet Park
9893af979f replace license from Apache 2.0 to MIT
Change-Id: I61f7cb2b0e407bc035f3b2ec7da9b7f230057e24
2020-08-13 16:53:38 +09:00
Hermet Park
9f6b5eb59e common: changed premultiplied color policy.
Some user have no idea of premultiplied alpha concept,
We suggest more user-friendly interfaces so that they don't confuse it.

Now, this pre-multipying is acommplished by backend engines.

Change-Id: Ifd84d56361cb56a8b98240bbd16690accf370bad
2020-08-06 13:54:51 +09:00
Hermet Park
76a7c900be sw_engine gradient: support x/y scale for radial gradient
Change-Id: Id725637e261642d0e92d100c73841278b7f44c1c
2020-07-24 16:48:41 +09:00
Hermet Park
5fdc1f7fc8 sw_engine: revise stroke scaling logic.
previous fast track logic is useless,
it actually doesn't helpful for performance, just increase the code complexity.

Change-Id: Ib6ad204edfb241d74c41413dfec7ab42fb02af81
2020-07-24 11:03:20 +09:00
Hermet Park
f1aab52958 sw_engine: support bidirectional stroke scaling.
if the transform scale factor for x/y is not identical,
it keeps its both xy scale factor then apply them
for stroking calculation.

Change-Id: I519dfce3ce7b4a12c13da1801d6a00e139e7400f
2020-07-23 17:36:54 +09:00
Hermet Park
4d72eeda15 sw_engine: revise scale transform logic.
Basically, stroke width size is linear,

engine couldn't apply scale factor from the matrix which contains 2 dimensional values.

Thus, we can apply it if the scale factor of x/y is identical.

Otherwise, we should transform every stroke points in the stroking process.
That scenario can be improved with another patch.

Change-Id: I070dcf29d2e42f21e182bdf4239781464158ef73
2020-07-22 20:59:52 +09:00
Hermet Park
96477c0a24 sw_engine: revise outline transform
sw_engine simulates floating point by integer bit shifting,
it loses the accuracy while converting the number data.

This occurs the inacculated curve points result if it scales up very large size.

So we transform points before converting data in order to avoid losing the numbers less decimal point.

Change-Id: I0172e83f06b1a19143a2f65f667dc193e9a4396a
2020-07-21 18:44:27 +09:00
Hermet Park
9e1ba8d2c0 sw_engine: introduce avx simd instruction
avx is the cutting edge method for intel & amd cpus simd instruction.
We are going to support this feature for the desktop environment (instead of sse)

You can turn on this with configuration something like this:

$meson . build -Dvectors=avx

Current patch supports only for raster solid color

Change-Id: I068ba30a1f63d480415e2762f8021fc8d6d28a39
2020-07-11 20:58:09 +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
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
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
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
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
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
9aa2566b45 sw_engine: support stroke dash feature
Change-Id: Ibed8bcb6a07952a059bb9a7355f7c43db97aa672
2020-06-06 12:21:30 +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
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
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
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
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
60d104a40a sw_engine: code refactoring.
renamed internal variables for better readibility.

Change-Id: I1ba7938401e8b7249c8bcc396be1ba3c109716cd
2020-05-02 17:44:49 +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
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
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
c8d800f6c6 sw_engine: implement line and curve raster
Change-Id: I22a77892544cd510cfe646aee60093cebb848806
2020-04-18 19:56:10 +09:00
Hermet Park
2a39617527 implement rle path parts.
Change-Id: I7200d80320404d6e7fb722042b8f330961bee76d
2020-04-15 21:55:53 +09:00
Hermet Park
70c9860d8f implement rle raster.
Change-Id: Ie21dfbf0ff1aed43bfa750eeef3b8c033a986416
2020-04-13 13:42:24 +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