Hermet Park
77d33b2d9f
sw_engine texmap: fix trivial compiler warnings.
...
warning: suggest braces around initialization of subobject [-Wmissing-braces]
2021-12-23 10:40:09 +09:00
Hermet Park
6a2aaa2064
sw_engine texmap: ++safety
...
Prevent range over just in case.
2021-12-22 16:40:27 +09:00
Hermet Park
df64a7b0dc
sw_engine raster: fix a crash at the texmap clipping.
...
Handle correctly duplicated spans from the multiple y span data.
Previous logic only expected the one single y span data from the rle.
However rle might have multiple y span data if the anti-aliasing is applied.
This patch also removed the bad design of the common engine
which handles the anti-alising option to ignore the anti-aliasing rle generation.
Just realized, it's difficult to control that condition due to scene-composition.
2021-12-17 19:15:27 +09:00
Hermet Park
05fefcf61f
sw_engine raster: ++safety of the scaled image rasterization
...
Prevent out of buffer boundary access.
@Issues: https://github.com/Samsung/thorvg/pull/1119
2021-12-17 16:46:37 +09:00
Hermet Park
e258a2a662
sw_engine texmap: implemented fast span-edge anti-aliasing
...
This Anti-Aliasing mechanism is originated from Hermet Park's idea.
To understand this AA logic, you can refer this page:
www.hermet.pe.kr/122 (hermetpark@gmail.com )
@Issue: https://github.com/Samsung/thorvg/issues/161
2021-12-16 15:56:20 +09:00
JunsuChoi
791275c30a
sw_engine SwShape: Fix coding style
2021-12-15 15:19:19 +09:00
JunsuChoi
c326b6ac3e
sw_engine SwShape: Prevent null access
...
strokeOutline returned strokeExportOutline() is the address of mpool->strokeOutline[idx].
Assuming this value is null, mpoolRetStrokeOutline on line 617 will access mpool->strokeOutline[idx].
Logically, the logic of the mpool* functions does not occur in this case.
2021-12-15 15:19:19 +09:00
Hermet Park
45132a7051
sw_engine raster: improve the transformed rle image rasterizer.
...
replace the transformed rle rgba image with the texmap raster.
this patch removes the several scattered transformed image rasterizer,
reuse the unified one texmap method instead.
yay, it's much clean and optimal.
2021-12-14 19:04:16 +09:00
Hermet Park
4cdf648e14
sw_engine image: support non-premultiplied alpha images.
...
Previously, translucent png images are not displayed properly
due to alpha channels premultiplication.
This patch implements that missing part to support it properly
by introducing the Surface data between canvas engine & rasterizer
@Issue: https://github.com/Samsung/thorvg/issues/655
2021-12-02 17:10:12 +09:00
Hermet Park
e7b7705875
sw_engine raster: remove unnecessary functions.
...
These alpha/inverse alpha blender table is not useful so far,
we remove them since it just decrease the performance by by-pass addressing.
2021-12-01 18:36:12 +09:00
JunsuChoi
d8797092b5
sw_engine SwCommon: Change spans's x,y value type
...
The x and y of spans cannot be negative
because they are specified as coordinates inside the buffer.
Change the type to fix warnings and potential problems
that occur in conversion between int16_t and uint32_t.
2021-12-01 16:55:22 +09:00
JunsuChoi
e36c2029ce
sw_engine SWRaster: Explicitly declare type cast to uint32_t
2021-11-30 15:46:26 +09:00
JunsuChoi
5715270dfb
sw_engine SWRaster: Initialize uninitialized local variable
2021-11-30 14:54:55 +09:00
Hermet Park
c0cd645bb5
sw_engine raster: fix the regression bug of the image simple scaling rendering.
...
Gave up the optimization this logic.
It brings too many digressed code, not good for maintenance...
2021-11-30 12:03:10 +09:00
Hermet Park
46bdc8f1dc
sw_engine texmap: remove unnecessary conditions.
...
remove exceptional handling for the performance.
2021-11-26 20:16:00 +09:00
Hermet Park
19aa102749
sw_engine raster: fix the texmap regression bug.
...
Wrong inline function with C-preprocessing doesn't work at all...
Correct them with including the separate files instead.
2021-11-26 17:41:33 +09:00
Hermet Park
d2640c6313
Revert "sw_engine raster: code refactoring."
...
This reverts commit 860068301a
.
found a regression bug. this macro doesn't work actually.
2021-11-26 17:21:27 +09:00
Hermet Park
860068301a
sw_engine raster: code refactoring.
...
+ blending stages using macro magics.
I know this is a bit bad for code readibility but good for the maintanence
2021-11-25 20:07:39 +09:00
Hermet Park
eddaf615c3
sw_engine: code refactoring
...
unified the two color interpolate methods.
2021-11-25 20:04:37 +09:00
Hermet Park
2ca6f76d91
sw_engine texmap: code refactoring.
...
Unrolled the blending stages by applying macro magics.
I know this is a bit bad for code readibility
but good for the performance and the optimal LOC.
2021-11-25 18:51:04 +09:00
Hermet Park
aff755aeb5
sw_engine texmap: introduced texture mapping polygon drawing.
...
Introduced the texture-mapping algorithm for the image-scaler.
With this approach, we can support any arbitrary forms of the transformed shapes
while appling the scale factors - x/y separately.
Also this is more efficient when the transformed image is far from the rectangular form
because our current normal image rasterizer based on the given drawing region whereas
our new approach is span-based.
Thus, we applied this mechanism only for the transformed images.
2021-11-25 17:07:24 +09:00
Hermet Park
72ee1c4343
sw_engien renderer: ++safety
...
+exceptional handling for the drawing region.
2021-11-25 15:04:56 +09:00
Hermet Park
b5e134399d
sw_engine raster: fix a regression bug.
...
mistaken by 8ef31f6cd0
2021-11-25 14:49:14 +09:00
Hermet Park
cc96535778
sw_engine raster: fix compiler warnings.
...
popped up unused-functions when simd enabled.
2021-11-25 11:48:53 +09:00
Hermet Park
8ef31f6cd0
sw_engine raster: fix a mistake by the previous hot refactoring.
2021-11-24 20:51:05 +09:00
Hermet Park
e76091a283
sw_engine raster: code refactoring
...
+neat and clean code
2021-11-24 20:43:18 +09:00
Hermet Park
f7e52e93ed
sw_engine image: improvement sequeqnce of the transformed rle rgba image drawing.
...
implement composition by translucent / opaque.
yet this transformed rle rgba image drawing is on the enhancement stage.
2021-11-24 19:32:42 +09:00
Hermet Park
9fbb8d9b09
sw_engine image: complete sequeqnce of the scaled rgba rle image drawing.
...
implement composition by translucent / opaque
2021-11-24 19:08:07 +09:00
Hermet Park
43233a530a
sw_engine image: improvement sequeqnce of the direct rgba rle image drawing.
...
implement composition by translucent / opaque.
+ correct compositor stride reference.
2021-11-24 18:54:58 +09:00
Hermet Park
a5713cecca
sw_engine image: improvement sequeqnce of the transformed rgba image drawing.
...
implement composition by translucent / opaque.
yet this transformed rgba image drawing is on the enhancement stage.
2021-11-24 18:36:54 +09:00
Hermet Park
f0e7ef1dbc
sw_engine image: complete sequeqnce of the scaled rgb image drawing.
...
implement composition by translucent / opaque.
2021-11-24 17:53:10 +09:00
Hermet Park
c0c37396f7
sw_engine image: complete sequeqnce of the direct rgb image drawing.
...
implement composition by translucent / opaque.
2021-11-24 17:39:02 +09:00
Hermet Park
3fae64c626
sw_engine image: refactoring before further development.
...
separate internal functions per context
and keep the coding convention.
2021-11-24 17:13:16 +09:00
Hermet Park
7c8f651e32
sw_engine image: support separate logics for scaled rle rgba image
...
+ scaled rle rgba image
+ scaled masked rle rgba image
+ scaled translucent rle rga image
2021-11-24 14:32:30 +09:00
Hermet Park
16d5907642
sw_engine image: apply rgba blending.
...
rgba requires the default blending.
2021-11-23 15:22:28 +09:00
Hermet Park
1b7f5d952e
sw_engine image: code refactoring
...
Clarify image sequences by renaming & adding TODO comments.
2021-11-23 12:56:05 +09:00
Hermet Park
06cef2a710
sw_engine image: introduced scaled image raster logics.
...
These raster functions are accelerated only for the scaled images.
(no rotation, skrewed)
2021-11-23 11:41:53 +09:00
Hermet Park
f887edf562
common paint: fix the wrong fast track logic.
...
There was a missing sorting between the left-top & right-bottom corner.
that results in the negative values of the viewport...
Now fixed it.
+ refactored to use math functions...
+ still it's a buggy, sometimes no draw at 90' in stress. don't know reason. :(
2021-11-22 17:33:34 +09:00
Hermet Park
b38996f5c9
sw_engine image: code refactoring
...
Image raster sequence is getting quite complex...
Clean up before further image optimization.
2021-11-19 13:43:12 +09:00
Hermet Park
e195ac8b30
sw_engine image: code refactoring
...
+++
2021-11-19 13:22:32 +09:00
Hermet Park
93da844d94
sw_engine raster: clarify the internal function name.
...
"Solid" in this raster context is "Opaque" actually.
So remove the solid from it.
2021-11-19 13:12:40 +09:00
Hermet Park
491ea0ac07
sw_engine raster: remove the condition which is out of the genearal case.
2021-11-19 13:08:02 +09:00
Hermet Park
fa17214633
sw_engine raster: updated tvglog messages
2021-11-18 20:50:03 +09:00
Hermet Park
4f73719fac
sw_engine raster: optimize the image raster
...
these solid images shouldn't apply the alpha blending...
2021-11-17 23:35:33 +09:00
Hermet Park
92f57a149f
sw_engine raster: code refactoring
...
changed internal function names, keep the neat & clean thorvg style code.
2021-11-17 19:40:38 +09:00
Hermet Park
f9bc684699
sw_engine raster: code refactoring
...
clarfy & regroup the internal functions which have been messed up by rendering options.
no logical changes
2021-11-16 20:27:11 +09:00
Hermet Park
e581ae4353
sw_engine neon: code refactoring.
...
keep the internal function name consistency.
2021-11-16 20:14:45 +09:00
Mira Grudzinska
3f82522f60
sw_engine: ialpha function pointer used instead of 255 - alpha
2021-11-16 20:14:31 +09:00
Hermet Park
c9377708a9
sw_engine image: ++optimization
...
apply fast track to fast up the image rasterization.
only shifted image doesn't need to have the matrix-transform computation,
we can avoid it by just shifting offset xy by simple caculating.
@Issue: https://github.com/Samsung/thorvg/issues/206
2021-11-15 17:38:57 +09:00
Hermet Park
0fcdba8a4b
common math: code refactoring
...
introduced mathZero(), mathEqual() for floating variables.
2021-11-15 17:10:54 +09:00