Commit graph

418 commits

Author SHA1 Message Date
Hermet Park
efd4741a78 common canvas: initialize member variable.
to shutdown the static code analizer report.
2021-03-12 11:50:46 +09:00
Hermet Park
0984241954 sw_engine fill: correct value loss by data conversion. 2021-03-11 20:10:11 +09:00
Hermet Park
5e01fd8b4b Revert "sw_engine shape/image: substituting logical 'and' with 'or'"
This reverts commit 74b27c74af.

This patch breaks Stroke example. 1 line drawings...

There is a possibility that less 1 (i.e: 0.5) width axis-aligned line drawings...

So logically "&&" is correct.
2021-03-09 20:13:44 +09:00
Mira Grudzinska
b5bc73849c sw_engine raster: functions optimization in the image block
The alpha value calculation pulled out outside the inner loop
to reduce the number of unnecessary operations.
Added local variables to reduce the number of costly
multiplications performed in a loop.
2021-03-09 19:47:50 +09:00
Mira Grudzinska
74b27c74af sw_engine shape/image: substituting logical 'and' with 'or'
In the case when the height or width of the bounding box is 0
it is not necessary to calculate Rle.
2021-03-09 19:44:29 +09:00
Mira Grudzinska
07e6c476a8 sw_engine fill: fixing the infinite loop condition
Fixed in the fillFetchLinear() function.
2021-03-03 17:46:33 +09:00
Mira Grudzinska
692e100f9a canvas: replacement of the bitwise OR operator with the logical one
Bitwise logical operators do not perform short-circuiting.
2021-03-03 10:54:27 +09:00
Hermet Park
d522c9d45e
sw_engine fill: fix wrong gradient transformation
There transformation logic was not identical between shape & gradient

gradient transform was applied into center of gradient world,
while shape wasn't. So... we correct gradient transform metric to shape like.

@Issues: 255
2021-03-03 10:53:32 +09:00
Hermet Park
6cd587ba5f scene: fix a composition regression bug.
Pre-condition is broken when this commit come - b60a773d12

Both condition should be identitcal so that comp logic is perfectly performed.
2021-02-25 18:06:56 +09:00
Hermet Park
b60a773d12
common: optimize scene composition
Scene could avoid composition if its children is only child (non scene)

This patch bring it conditionally check so as to avoid unnecesary expensive job.

@Issues: 254
2021-02-25 12:38:39 +09:00
Hermet Park
c0362cb69c sw_engine: fix a composition crash issue.
Added an exceptional handling for out of buffer boundary.
2021-02-24 20:02:10 +09:00
Hermet Park
69ff5a484b canvas: fix crash issue.
When canvas target size is changed, it need to update all retained paints again
so that they cannot redraw onto out of buffer boundary.
2021-02-24 19:58:44 +09:00
Hermet Park
197879f2ef fixed all wasm build breaks. 2021-02-23 10:47:46 +09:00
Michal Szczecinski
f0ab7f4002 sw common: Fixed crash in rasterRGBA32
Description:
Crash was observed in examples when composite object was used.
It was caused because __m256i object was used on non aligned
memory to 32bit. Algorithm in this function was changed to use
unaligned __m256i_u object. Code was also simplified.
2021-02-22 13:26:41 +09:00
Mira Grudzinska
5e1d3772ca sw_engine raster: fixing rasterization of an image with InvMask
In case of the image rasterization with an inverse mask the opacity
was omitted and the alpha value instead of the inverse alpha value was used.
2021-02-22 13:02:04 +09:00
Hermet Park
028e1fa251 sw_engine: enhance log message.
more informational log is better.
2021-02-22 12:53:56 +09:00
Mira Grudzinska
229a013fcd sw_engine math: fixing matrix transformation
Unnecessary rounding during matrix transformation has been removed.
The problem occured when scaling a shape with a dashed stroke.
2021-02-22 11:15:11 +09:00
JunsuChoi
6db7f85ffb common Scene: Fix translucent composition condition
If a scene has another scene as a child and
the number of children is 1, the composition of the child does not work.
Therefore, fix that composition works as long as the number of children is not 0.
2021-02-22 11:00:20 +09:00
JunsuChoi
70e1e7f1c6 sw_engine Renderer: Fix build problem caused by merge conflict. 2021-02-19 17:33:15 +09:00
Mira Grudzinska
d86032df36
sw_engine: adding a gradient as a stroke feature
* sw_engine: adding a gradient as a stroke feature

Similarly as a shape may have a gradient fill so can the stroke.

* Capi: adding APIs for a gradient stroke

Co-authored-by: Hermet Park <hermetpark@gmail.com>
2021-02-19 17:16:10 +09:00
JunsuChoi
415fca577e common: TVG_UNUSED marking on unused parameter 2021-02-19 16:51:50 +09:00
JunsuChoi
69f02d803b shape: Refactoring to use initialize list
Member data should be initialized in-class or in a constructor initialization list
2021-02-19 16:51:50 +09:00
JunsuChoi
08c37978a9 common: Pointer that can declare const are refactored to use const
Pointer and reference parameters should be "const" if the corresponding object is not modified
2021-02-19 16:51:50 +09:00
JunsuChoi
3c7adb0a95 common: Functions that can declare const are refactored to use const
Member functions that don't mutate their objects should be declared "const"
2021-02-19 16:51:50 +09:00
Mira Grudzinska
29ca149b4b sw_engine rle: fixing clipping with non overlaping figures
For clip that did not overlap with the plotted source, the whole
source was plotted - the size of the rle data was not updated.
2021-02-19 15:11:20 +09:00
Mira Grudzinska
f1fd23cf32 common render: removed unnecessary assignments in update() fun
The rotation part of the transformation matrix can be assigned,
it does not have to be multiplied by the identity matrix.
The values of e13 and e23 of the transformation matrix represents the translation,
so they don't need to be taken into account in the rotation part.
2021-02-19 14:11:44 +09:00
JunsuChoi
c63f961b9c common: Clean up code
- Combine if condition with the same return value.
- Remove empty space
- Remove tab
2021-02-18 14:03:47 +09:00
Mira Grudzinska
6925f6c272 sw_engine raster: checking zero division while inverting the transform matrix
In case the user has provided the transformation matrix, it is possible that
the inverse matrix does not exist.
2021-02-09 09:26:37 +09:00
Mira Grudzinska
46f8945028 sw_engine raster: adding rastering functions for image without transformation
Added rastering functions for the image (transparent and not) for the fast
track option - identity transform.
2021-02-09 09:21:53 +09:00
Mira Grudzinska
307f3698a8 sw_engine raster: removing unnecessary logical 'and' operation
Shifting the 32-bit number by 24 bits leaves only 8 bits,
so there is no need to mask them with 0xFF.
2021-02-03 11:25:19 +09:00
Michal Szczecinski
8003c439fe renderer: Fixed RenderUpdate::All flag fields.
All flag should have all bits set to 1.
2021-02-03 11:24:00 +09:00
Michal Szczecinski
ba2bd2383d shape: Fixed reset api.
Added stroke's RLE reset in shape reset function.
2021-02-03 11:23:21 +09:00
Mira Grudzinska
3dfc3c4943 sw_engine renderer: rendering optimization of shapes without strokes
The value of 'a' for shapes without a stroke could hold the fill 'a' value.
Added checking if stroke exists before calling rastering functions.
2021-02-02 11:53:58 +09:00
Patryk Kaczmarek
905fd46ccf sw_engine composition: invert alpha masking
composition invert alpha masking

@Examples: added InvMasking

@Issues: 31

Change-Id: I2ee9d428d5749240ddf2e6adbb7677dccbe1926f
2021-02-02 11:47:30 +09:00
Hermet Park
6db796acf3 common picture: fix minor logic.
missing nulling pointer,
also return value properly.
2021-01-20 23:29:15 +09:00
Hermet Park
e9939dec82 common canvas: fix non-updated paints.
When shapes are poped from canvas while retaining shapes instances,
they have no chances to redraw after pushed again due to missing flag.

This patch fixes it by forcely updating flag on pushing time.

@Issues: 181
2021-01-20 23:20:51 +09:00
Hermet Park
9e8410b9bd common paint: duplicate composition target.
composition target also copied in duplication.

added missing part.
2021-01-10 23:39:04 +09:00
Hermet Park
3a156b6307 sw_engine composition: enhance image masking
composition alpha masking supports scene/paints targets.

@Examples: Masking

@Issues: 31
2021-01-10 23:22:01 +09:00
Hermet Park
581e33b954 sw_engine: optimize raster image.
added a routine that draw non-transformed translucent image.
composition images will use this routine to draw faster.

Also added optimization point comments in raster image.
2021-01-10 20:11:37 +09:00
Hermet Park
dc70920b40 common paint: code refactoring.
remove the opacity argument in the render method.

Considered again, this opacity value is not commonly used yet.
we can introduce it when it's necessary.
2021-01-10 18:04:42 +09:00
Hermet Park
0e9115cd00 sw_engine renderer: fix invalid rle issue.
if shape rendering is failed, all the prepared data must be reset
because those are invalid.

@Issues: 180
2021-01-10 17:39:57 +09:00
Hermet Park
736d6ee4ef
common sw_engine: revise the masking implementation.
We re-implement the masking feature with image composition method.

This patch is working only for single shape but settle up coming extensions.
2021-01-04 00:46:59 +09:00
Hermet Park
333ff3a12b common: keep consistency file permissions => 664 2020-12-30 13:25:38 +09:00
Hermet Park
d08d87dc0b
gl_engine: fix coding convention.
no logical changes.
2020-12-30 12:40:54 +09:00
Hermet Park
cfa2d187bf
sw_engine: apply opacity to graident fill case.
previously, opacity value is ignored to gradient fill.

This patch implements that case.
2020-12-30 12:38:32 +09:00
pankajkumar20
f096570360
common gl_engine: transformation support
support transformation of shapes some partial cases.
2020-12-30 12:23:22 +09:00
Hermet Park
c3d0a79d3e sw_engine renderer: fix a regression bug.
recover a broken shape+stroking opacity that introduced in ealier refactoring...
2020-12-29 12:07:05 +09:00
Hermet Park
7d9023ac5c common sw_engine: code refactoring
Renamed internal interfaces.

We need both blender & compositor interfaces.

Renamed SwCompositor -> SwBlender which is for pixel joining methods.

Added (SwCompositor, Compositor) which is designed for compositing images.
2020-12-25 20:54:56 +09:00
Hermet Park
4767f83b99
common composite: code refactoring
Splited out ClipPath routine from other pixel compositions'
since yet it's unlikely compatible...

Also revise internal engine interfaces to be simpler.

This is a step forward to enhance masking feature.
2020-12-25 19:47:01 +09:00
Hermet Park
9cb256f473 common shape: code refactoring
don't convert data type(float-double) during computation.
2020-12-23 15:38:23 +09:00