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
7e6f30830b
example ClipPath: ++coverage
...
Apply gradient usage in clip path.
2020-12-28 00:19:51 +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
c1e36bcb01
tools format: remove tizen specific
...
When ready, we will use this c++ formatter...
2020-12-25 20:06:26 +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
Mira Grudzinska
d3bd55dbc7
sw_engine shape: expand the algorithm to draw arcs with negative angles
...
The _appendArc function allows to draw angles only in a clockwise direction.
The introduced improvement allows to change this direction by giving the 'sweep' argument
with a negative value.
2020-12-23 15:34:18 +09:00
Hermet Park
ac43ec591e
sw_engine renderer: fix wrong conditional check.
...
unsigned int won't be less than 0.
2020-12-22 11:09:48 +09:00
Hermet Park
e737ee4a4f
svg_loader: fixed wrong boundary check
...
sz must be less than 20 to append 'carriage return'
2020-12-22 11:04:39 +09:00
Hermet Park
59ffa16b32
raw_loader: remove unnecessary declaration.
2020-12-22 10:55:23 +09:00
Hermet Park
b7312a11d4
sw_engine raster: fix incorrect condition check.
...
These values won't be less than zero since they are unsigned types.
2020-12-22 10:46:51 +09:00
Hermet Park
168999c5a9
common shape: ++safety
...
null check after memory allocation.
2020-12-22 10:42:11 +09:00
Hermet Park
849ed12050
sw_engine log: adding missed line wrap.
2020-12-21 18:38:12 +09:00
Hermet Park
4c66018c97
sw_engine log: + log clipPath case.
...
These functions are one of special compositions.
2020-12-21 18:35:11 +09:00
JunsuChoi
438b7d6b02
svg_loader SvgLoader: Add memory allocation failed check
...
Prevent to null access when out of memory.
2020-12-18 19:51:06 +09:00
JunsuChoi
21b751291a
raw_loader RawLoader: Add initialize
...
Add initialization to 'copy' member
2020-12-18 19:51:06 +09:00
JunsuChoi
f13e1947ff
svg_loader SvgLoader: Prevent array overflow
...
Since tagName array set '\0' at the end,
it may overflow when sz reaches 20.
So make it a maximum of 19.
2020-12-18 19:51:06 +09:00
Hermet Park
1e02d62d01
inc header: remove unnecessary declaration.
...
This log tag is not used. We can introduce it when it's necessary.
2020-12-18 19:25:24 +09:00
Hermet Park
87aa90c4ec
examples mask: revise the example code.
...
Yet, this isn't work properly but it supposed to do
We need to fix alpha mask logic.
2020-12-18 19:21:34 +09:00
Hermet Park
82e3553b56
common sw_engine: fix build break.
...
some wrong merge conflicts left. resolve them.
2020-12-18 17:44:59 +09:00
Patryk Kaczmarek
4dbdcbd057
common composition: support Masking method
...
New feature - CompositeMethod::MaskAlpha
Newly Support AlphaMask. but it's unstable.
@Issues: 31
2020-12-18 17:40:54 +09:00
Hermet Park
cee1348a44
svg_loader XmlParser: code refactoring.
...
just renamed _nodeTypeToString() -> xmlParserNodeTypeToString()
+ print meson message if log is enabled.
2020-12-17 16:11:09 +09:00
JunsuChoi
23331cf8d4
svg_loader SvgLoader: Print inefficient elements
...
Opacity is 0
both Fill.Opacity and Stroke Opacity are 0
point is 0 in Path
declared display="none"
width or height of bounds becomes 0
2020-12-17 13:56:09 +09:00
Shinwoo Kim
135e6c872b
fix typo
2020-12-16 09:58:40 +09:00
Shinwoo Kim
aedd3afd00
fix mistake
2020-12-16 09:57:57 +09:00
Shinwoo Kim
54e5cdee10
wasm: update picture size for file loading
...
The width and height was not changed, if there is newly loaded file.
As a result, the scale was not correct after loading a file.
2020-12-15 17:38:22 +09:00
Shinwoo Kim
e9772efbd1
wasm: work with log option
...
The wasm is using the ThorVG output starting whith "SVG:" to show
unsupported element and attribute of svg file.
This patch updates wasm_build.sh to make ThorVG prints log,
and removes build errors.
- Following commit needs to include 'algorithm'
1ed6113
common sw_engine: code refactoring & stabilizing.
- Following commit needs to include 'string'
5481633
svg_loader XmlParser: Print unsupported elements, ...
2020-12-15 17:38:22 +09:00
Hermet Park
abc9e89517
common log: notify opacity composition usage log.
...
replaced [XXX] log prefix with XXX:
2020-12-15 14:29:52 +09:00
JunsuChoi
54816339ed
svg_loader XmlParser: Print unsupported elements, attribute with log option
...
* Using printf is temporary. We are planning a proper way to print the log.
When parsing a Svg file, Loader print unsupported elements and attributes.
2020-12-15 14:07:38 +09:00
JunsuChoi
55978d1bf4
examples Opacity: Add close method
2020-12-14 17:22:41 +09:00
Hermet Park
64d3897816
common sw_engine: apply partial composition.
...
Introduce RendererMethod::renderRegion() to return acutal drawing region info.
That is used by scene composition to composite actual partial drawing region
for better performance.
@Issues: 173
2020-12-14 12:29:37 +09:00
Hermet Park
e3eff97fac
sw_engine renderer: optimize composition data usage.
...
Use cache mechanism for composition data so that we don't reallocate
composition memory several times in one frame rendering.
@Issues: 168
2020-12-10 19:55:57 +09:00
Hermet Park
1523446a20
examples Svg: replace a few example svgs.
2020-12-10 19:53:40 +09:00
Hermet Park
d9a0cf3d78
examples capi: fix a memory leak.
...
a shape is not cleaned properly.
@Issues: 178
2020-12-10 14:23:29 +09:00
Hermet Park
462bf277f2
sw_engine rle: fix an invalid memory access.
...
There is a mistake that over-access boundary.
This fix it.
@Issues: 178
2020-12-10 14:16:41 +09:00
Hermet Park
932cc65543
loaders: fix memory leak.
...
While looking for image loader, it occured memory leaks.
Fixed it properly.
@Issues: 178
2020-12-10 11:57:38 +09:00
Hermet Park
393be38f2a
sw_engine stroke: fix memory leak.
...
Properly free data after use.
@Issues: 178
2020-12-10 11:48:08 +09:00
Hermet Park
dbbecef101
tools: remove invalid file link.
2020-12-10 10:47:08 +09:00
pkosko
1712e7d83f
tools: Automatic code format tool added
...
Tool allows auto formatting of code according to Google coding standard
for easier control and fixing formatting issues.
2020-12-10 10:38:22 +09:00
Hermet Park
1ed611386d
common sw_engine: code refactoring & stabilizing.
...
Apply tvg Array instead of std::vector
Also Fixed to compList in update() to passed by reference, not copying.
Also Fixed Composition Target memory leak
Here is the binary size result:
[libthorvg.so] 1785376 >> 1607416
[text] 121255 >> 118277
[data] 7792 >> 7736
[dec] 129119 >> 126085
2020-12-09 19:56:59 +09:00
Hermet Park
d13cd37094
fix typo
2020-12-09 15:29:22 +09:00
Hermet Park
d4515d2732
common array: Introduce Array function to common.
...
This Array is promoted from SvgVector to use it widely in tvg.
It's similar with std::vector, we can use it instead of it.
Also, svg_loader replaced with it subsequently.
2020-12-09 15:29:22 +09:00
Hermet Park
ca6639bb2c
svg_loader: code refactoring
...
Use custom vector data algorithm for optimizing binary size.
Plus remove tuple usage since it leads unnecessary instance copying.
binary size comparison:
[libthorvg.so] 1811400 >> 1785448
[text] 122914 >> 121255
[data] 7824 >> 7792
[dec] 130810 >> 129119
2020-12-09 14:52:47 +09:00
Hermet Park
924490a7a5
sw_engine renderer: code refactoring.
...
Unify Shape+Stroke composition with CompositeCtx which is added for Scene Composition
This fixes clipping issue as well.
@Issues: 164
2020-12-09 12:54:13 +09:00
JunsuChoi
e794c678ec
svg_loader SceneBuilder: No propagate opacity to child
...
Scene's opacity() propagates opacity value inside.
Therefore, unnecessary opacity calculation.
2020-12-08 12:32:05 +09:00
Hermet Park
af88da976d
wasm: code refactoring.
...
Use Picture::size() method instead of scale()
Picture newly supports size() method to resize image.
It's more convenient for users in its usage.
2020-12-08 12:30:58 +09:00
Hermet Park
1e78d1f845
picture: replace size parameter to float.
...
Considering smooth-resizing on sub-pixeling.
2020-12-08 12:27:13 +09:00
Hermet Park
ea969ad0e2
sw_engine renderer: fix a crash issue.
...
This stroking composition condition must be initialized
even when exceptional cases. We moved the condition setting to
handle it always.
2020-12-07 19:52:56 +09:00
Hermet Park
77e8a195b4
sw_engine renderer: support scene opacity composition
...
this is an additional enhancement of af8c278c5e
Now scene opacity composition is supported.
Also, this implementaion fixes an incorrect scene bounding box computation.
Plus, adding stroking feathering to shape bounding box size.
2020-12-07 15:45:44 +09:00
Hermet Park
20de2bfc15
common picture: revise resize method.
...
this implementation handles the center-aligned scale.
Also removed viewbox usage since we have size() method.
2020-12-07 13:56:50 +09:00