The reference node doesn't have to be placed inside the defs block,
so when refering to it, it is necessary to search the entire node tree.
In case of invalid svg file this can lead to circular references.
Added prevention against such a sutuation.
For the performance reasons, the LumaMask is used only when
it's necessary - when the mask color is other than white.
Otherwise the AlphaMask is enough.
In an svg file the mask-type attribute can be specified.
It takes one of the two values: Luminosity or Alpha.
After the LumaMask is introduced into TVG, this attribute can be
properly read by the svg loader.
The SvgCompositeNode is replaced by the SvgMaskNode and SvgClipNode.
This is needed for using Luma/AlphaMask in the svg loader and in the future,
when we introduce other mask's features.
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
To handle the objectBoundingBox units, the shape's boundaries have to be known.
According to the SVG standard, a stroke shouldn't be taken into account. Since
the bounds() api uses the shape's stroke information, a new function is introduced,
that compensates this and returns boundaries without any strokes.
When parsing a binary stored as a char type,
interpreter can access the misaligned memory while accessing it with a pointer.
To prevent that, pass the array copied to memcpy as tvg Object.
Clips and masks require to implement some additional variables,
so the new node type has been introduced. Implementation of the usage
of these additional variables will be the subject of a separate
commit.
Introducing the gradient transform() apis and changing the grad
algorithms made it possible to apply the shape's transformation
before saving the tvg file, in case the shape (or its stroke)
has a fill.
The values in absolute units are calculated based on the pixel unit.
Till now the default value of 90dpi was used. Since CSS3 (now CSS4 is
the most recent) 1 inch equals to 96 pixels. The necessary constants
are introduces in this commit.
This reverts commit cd5116b053.
Ah this breaks the Stress example due to Picture::duplicate() is not available...
Need to consider and come back again.
* common: added colorSpace() function
This patch introduces colorSpace() function for SW and GL engine.
* infra: change LoadModule:read() into LoadModule:read(uint32_t colorspace)
This patch changes LoadModule:read() into LoadModule:read(uint32_t colorspace)
* picture: implement passing colorspace into loader
This patch implements passing colorspace into loaders.
Loader->read is now called on the first update.
* external_jpg_loader: support colorspaces
* external_png_loader: support colorspaces
removed invalid nullptr checks.
New allocation doesn't gurantee that returns nullptr when it's failed.
It's useless on the modern compliers and our policy respects it.
The final gradient transformation depends on the coordinate system.
It can not be applied during an svg loading. The transformation matrix
has to be passed via api for further gradient processing.