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
Juyeong Lee
7147ebf21a
Fix typo in CONTRIBUTING.md
2021-02-26 18:14:17 +09:00
Hermet Park
e64ff980b0
examples images: correct file change mode.
...
For consistency, thorvg keeps file chmod => 664.
2021-02-25 19:14:23 +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
8c635e9591
Update CONTRIBUTING.md
...
fix typo
2021-02-25 12:41:20 +09:00
Hermet Park
a05ddfcd81
updated community guide resource.
2021-02-25 12:39:14 +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
a576c8f4cd
Update CONTRIBUTING.md
...
updated guideline
2021-02-25 12:35:41 +09:00
Patryk Kaczmarek
03d48159e3
examples: new AnimateMask example and svg images with masks
...
Change-Id: I609597a5ecb710e9af9939a3028eeef691b66188
2021-02-25 12:24:19 +09:00
Hermet Park
f378105c43
Update CONTRIBUTING.md
...
++updated
2021-02-25 12:18:47 +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
d6d65c3bd6
Issue 180 example ( #212 )
...
* examples: Added resize_cb to Capi example.
resize_cb in capi example is used to verify crash on reize described
in @180 issue.
* examples capi: Fixed file type from dos to unix.
Use the same code style as it is used in other examples.
2021-02-22 13:30:05 +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
Patryk Kaczmarek
795121fa67
SvgLoader: Mask style implementation
...
Supprot case when style is defined as <mask> attribute.
[Example SVG file]
```html
<svg version="1.1" id="Layer_1" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve"
xmlns="http://www.w3.org/2000/svg ">
<defs>
<mask id="myMask">
<circle id="maskID" cx="40" cy="40" r="10" fill="white" fill-opacity="1" />
</mask>
</defs>
<rect x="0" y="0" width="64" height="64" style="fill: skyblue; mask=url(#myMask);"/>
</svg>
```
Change-Id: I3b856db85204bf7c503a20e4023417ca79aa930c
2021-02-19 18:23:47 +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
Mira Grudzinska
20324dc48e
example StrokeGradient
...
Example showing a gradient usage for a stroke.
2021-02-19 17:14:12 +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
c819754056
common: Refactoring incorrectly declared loop variable
...
Loop variables should be declared in the minimal possible scope
thorvg prefers to declare when using local variables.
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
JunsuChoi
2657acc1bc
common: Fix ubuntu version in build test
...
github action started updating to ubuntu20.04 for ubuntu-latest.
So fix Ubuntu version 18.04 as we are not ready enough to test for 20.04 yet.
2021-02-19 14:32:51 +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
e5f59b53a4
infra CI: Introduce new build test with github action
...
This is a build checker using the github action.
When a pull request occurs this action does a basic build,
example build, build with test.
2021-02-19 12:59:35 +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
JunsuChoi
6a4598f706
infra coding_style: Add coding style check bot
...
Add a bot that checks the coding style using cpplint
and reports the result as a review comment.
This feature refers to the repository where cpplint
and docker settings with github-action.
This action works whenever a PR is created and updated.
In cpplint, only the violation of ThorVG's coding style is reported
as a warning using several options.
whitespace/parens
whitespace/indent
whitespace/end_of_line
whitespace/blank_line
The bot will review all of the contents of all files in the current commit file list,
However, in the future, we will improve Bot to only review the changes.
2021-02-18 14:00:21 +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
e154bfb264
example ClipPath: update
...
Added example with non-overlaping clip and shape.
2021-02-09 09:10:34 +09:00
Hermet Park
6ff2b781cd
Update CONTRIBUTING.md
...
updated maintainers.
2021-02-03 11:33:39 +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
JunsuChoi
5c914f4ad2
svg_loader SvgLoader: Prevent memory leak
...
When OOM of SvgLinear/RadialGradient occurs,
the allocated id, ref, transform may become a memory leak.
Therefore, add free memory.
2021-02-02 10:51:50 +09:00
Patryk Kaczmarek
9b4769076f
Capi: Composite Method binding
2021-01-26 20:36:40 +09:00
Michal Szczecinski
7d01a1c232
common: Removed doxyfile
2021-01-25 23:25:11 +09:00
Michal Szczecinski
975fdc8a39
capi: Added doxygen comments and doxygen config file.
2021-01-25 23:25:11 +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