Hermet Park
8ff1405050
common shape: revise Shape::reset() api.
...
reset Path is useful rather than reset all properties.
2021-03-12 18:27:14 +09:00
Hermet Park
9f0fafa5df
This is too untable.... Stress in example is crashed by this.
...
Revert "svg_loader: limiting the ploted area of svg to viewBox"
This reverts commit 2bb108b2f1
.
2021-03-12 18:10:26 +09:00
Hermet Park
efd4741a78
common canvas: initialize member variable.
...
to shutdown the static code analizer report.
2021-03-12 11:50:46 +09:00
Mira Grudzinska
2bb108b2f1
svg_loader: limiting the ploted area of svg to viewBox
...
The 'viewBox' element given in the svg file determines
the coordinates of the plotted area. ClipPath used in Svg loader.
2021-03-12 10:54:38 +09:00
Hermet Park
0984241954
sw_engine fill: correct value loss by data conversion.
2021-03-11 20:10:11 +09:00
Mira Grudzinska
ecf47fcec8
example: Duplicate.cpp modified
...
Duplication of the Picture with a raw image is added
2021-03-11 10:42:28 +09:00
Hermet Park
699a751b1b
updated AUTHORS
2021-03-09 20:20:43 +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
Patryk Kaczmarek
6e59116137
example: AnimateMask images change
...
Change-Id: Iacd407c3e186f1f91c2bcbd9099f0b83a9dba264
2021-03-09 14:39:56 +09:00
Hermet Park
7809ea4181
Update README.md
2021-03-07 12:05:58 +09:00
Hermet Park
1c1f185142
Update README.md
...
updated svg part.
2021-03-07 11:58:01 +09:00
JunsuChoi
355cc8c253
svg_loader SvgPath: Remove unnecessary optimization code
...
This condition(optimization) is not a step suggested by arc implementation.
https://www.w3.org/TR/SVG11/implnote.html#ArcCorrectionOutOfRangeRadii (Step2)
This code is useful if the arc is too small to represent.
However, scaling often occurs in vectors, which can create unnecessary problems.
example path
<path d="M32.41,20.49a.41.41,0,1,1-.41-.42A.41.41,0,0,1,32.41,20.49Z" transform="translate(0)" fill="#020202 "/>
2021-03-05 16:39:16 +09:00
JunsuChoi
f590571e3a
svg_loader SvgLoader: Fix copy conditions for stop of gradient
...
When getting a linked stop list, if there is no existing stop list
in current gradient, it is copied.
2021-03-04 18:43:58 +09:00
Mira Grudzinska
a173b16ed5
svgloader: fixing linear gradient transformation
...
Gradient stop points were incorrectly transformed when building
the scene in the SVG loader.
2021-03-03 19:48:26 -08:00
Hermet Park
cb425fa4bb
capi: fix incorrect composite api.
...
Api prototype is completely wrong, now it's corrected.
2021-03-04 11:33:24 +09:00
Mira Grudzinska
a72be6159d
svgloader: fixing SVG image display when viewBox size is not given
...
When viewBox is not given its dimensions should be determined
by the height and width parameters
2021-03-03 18:02:36 -08: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
d03db583e5
svgloader: fillRule value passed to the shape
...
The value was loadeed but not set to the shape.
2021-03-02 18:05:54 -08: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
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