Corrected subtract/intersect masking behaviors that were inaccurately functioning
within chain-masking.
This also helps to enhance the masking performance by reducing the
masking region when applying subtract/intersect.
@Issue: https://github.com/thorvg/thorvg/issues/1606
The blending feature allows user to combine colors to create visually appealing effects,
including transparency, lighting, shading, and color mixing, among others.
Its process involves the combination of colors or images from the source paint object
with the destination (the lower layer image) using blending operations.
The blending operation is determined by the chosen @p BlendMethod,
which specifies how the colors or images are combined.
@APIs:
- enum class BlendMethod::Normal, Add, Screen, Multiply, Overlay, Lighten, Difference, Exclusion, SrcOver, Darken, Lighten, ColorDodge, ColorBurn
- BlendMethod Paint::blend() const noexcept;
- Result Paint::blend(BlendMethod method) const noexcept;
@Issue: https://github.com/thorvg/thorvg/issues/307
Co-authored-by: Peter Vullings <peter@projectitis.com>
Co-authored-by: Hermet Park <hermetpark@lottiefiles.com>
There are two branches for completing stroke composition between the canvas and sw_engine.
It is necessary to centralize the task on the canvas engine side so that
we can maintain the logic without confusion.
There is a report of the thread sanitizer.
It could be a false-positive as far as I reviewed,
but we hate to be bothered by it. So let's revert it.
@Issue: https://github.com/thorvg/thorvg/issues/1409
One more regression bug by afea40a947
As tasks will now be triggered by other tasks on the worker threads,
the designated memory pool data (outline) for each thread should be
reset before moving on to other tasks.
@Issue: https://github.com/thorvg/thorvg/issues/1409
The new api is introduced to handle the rendering
order of a stroke and a fill. By default fill is
rendered as the first one, stroke as the second
one. This order can be reversed by calling
order(true).
@Issue: https://github.com/thorvg/thorvg/issues/1340
Introduced SceneTask, it implements scene clippath behavior
by merging RLE of the scene children render data on any running thread.
Co-authored-by: Michal Szczecinski <m.szczecinsk@partner.samsung.com>
@Issue: https://github.com/thorvg/thorvg/issues/524
As there are multiple types of painting tasks,
the clip() interface has been newly designed to handle clipping behavior
according to each task's role when requested."
Now Scene clipper could implement clipping behavior on it.
Revise the logic to avoid potential blocking of the main thread.
Move the clippers job completion to worker-threads to prevent main thread blocks
and enhance maximum parallelization efficiency.
Since the color space is set at the time of specifying the target buffer of the canvas,
there is no way to know the color space when the picture is loaded.
So, check the color space applied to SwCanvas at the time of reload()
and change the color space.
There is an issue of BGR color space support for each loader.
The external_jpg loader resets the TJPF color space and calls read() to get a new buffer.
In the case of external_png, we need to change the color value directly
because it have to start over from begin_read_*.
This solution can affect performance as much as it access again image buffer
that have already been `read()` done. However, this only happens once.
re-design the shape data structure so that render backends
are able to access them directly.
This also let us remove tvgShape member data from the Shape::Impl.
To achieve this, migrate shape/stroke/path
from the canvas interface to the render interface.
If a paint is used as a clipper, it must be determined in the paint behavior.
Propagate its decision to the immediate derived classes so that
not only shapes but also scenes must be dealt as a clipper properly.
This revised this change 0de3872be3
for better a solution.
According to the svg specs clip's fill and opacity
should be ignored. Till now setting the alpha/opacity
value to zero resulted in the shape's rendering abort.
@Issue: https://github.com/Samsung/thorvg/issues/1192
This would fail building with Visual Studio 2017, at least downstream in Godot
where we undefine old Windows compilers' non-standard `min`/`max` macros (see
`minmax.h`/`NOMINMAX`).
Handle correctly duplicated spans from the multiple y span data.
Previous logic only expected the one single y span data from the rle.
However rle might have multiple y span data if the anti-aliasing is applied.
This patch also removed the bad design of the common engine
which handles the anti-alising option to ignore the anti-aliasing rle generation.
Just realized, it's difficult to control that condition due to scene-composition.
replace the transformed rle rgba image with the texmap raster.
this patch removes the several scattered transformed image rasterizer,
reuse the unified one texmap method instead.
yay, it's much clean and optimal.
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
There was a missing sorting between the left-top & right-bottom corner.
that results in the negative values of the viewport...
Now fixed it.
+ refactored to use math functions...
+ still it's a buggy, sometimes no draw at 90' in stress. don't know reason. :(
revert d520da2db8
After considered the scneario seriously,
this doesn't helpful for the performance at all...
just increased code complexity. earlier bad decision... revert it.
Tasks can be disposed while the renderer referencing it.
Now, we can delete the tasks with lazy approach by introducing some tags.
@Issue: https://github.com/Samsung/thorvg/issues/995