Clarify the FillRule usage by associating it
explicitly with color/gradient fills.
C++ API
* Result Shape::fill(FillRule r)
-> Result Shape::fillRule(FillRule r)
issue: https://github.com/thorvg/thorvg/issues/3116
- introduced a blending factor to control the mix between the original color and the tritone effect.
- improved Lottie compliance with this enhancement.
- implemented the spec by all engines
CAPI:
* Tvg_Result tvg_scene_push_effect_tritone(Tvg_Paint* scene, int shadow_r, int shadow_g, int shadow_b, int midtone_r, int midtone_g, int midtone_b, int highlight_r, int highlight_g, int highlight_b);
-> TVG_API Tvg_Result tvg_scene_push_effect_tritone(Tvg_Paint* scene, int shadow_r, int shadow_g, int shadow_b, int midtone_r, int midtone_g, int midtone_b, int highlight_r, int highlight_g, int highlight_b, int blend);
- corrected the reversed black/white intensity multiplication.
- made a minor adjustment to the luma equation.
- updated and aligned the API documentation accordingly.
+ Tvg_Result tvg_scene_reset_effects(Tvg_Paint* scene)
+ Tvg_Result tvg_scene_push_effect_gaussian_blur(Tvg_Paint* scene, double sigma, int direction, int border, int quality)
+ Tvg_Result tvg_scene_push_effect_drop_shadow(Tvg_Paint* scene, int r, int g, int b, int a, double angle, double distance, double sigma, int quality)
+ Tvg_Result tvg_scene_push_effect_fill(Tvg_Paint* scene, int r, int g, int b, int a)
+ Tvg_Result tvg_scene_push_effect_tint(Tvg_Paint* scene, int black_r, int black_g, int black_b, int white_r, int white_g, int white_b, double intensity)
+ Tvg_Result tvg_scene_push_effect_tritone(Tvg_Paint* scene, int shadow_r, int shadow_g, int shadow_b, int midtone_r, int midtone_g, int midtone_b, int highlight_r, int highlight_g, int highlight_b)
issue: https://github.com/thorvg/thorvg/issues/3580
- clear resources on the main thread to safely remove resources associated with dirty regions.
- skip redundant condition checks for unsafe disabled add calls.
added new functionality for bezier curves:
1. generate bezier curve as an arc
2. estimate the number of points for optimal tessellation
3. check that bezier curve is close to a straight line
This functionality is useful for gl/wg renderers
A potential memory violation issue was present when accessing image
buffers, especially when the image was offset outside the visible
screen region.
This issue was accidentally discovered while testing particle
effects. It is now properly handled with cleaner and safer code.
This change ensures at the api level that if the focal
point lies outside the end circle, it is projected onto
the edge of the end circle.
Additionally, if the start circle does not fully fit
inside the end circle (after possible repositioning), its
radius is reduced accordingly.
The modification aligns with the SVG 1.1 standard (for fr = 0).
Cases with fr > 0 are not covered by the SVG 1.1, and edge
cases have been handled here to avoid numerical issues.
Note:
This update replaces previous behavior where gl handled
the SVG 2.0 standard.
The API allows now values <= 0 for dashes and gaps. Negative values
are treated as zero. The exception is when all provided values
are <= 0, in which case the dash is ignored.
This fixes the issue when dash = 0 was provided for strokes with round
or butt caps - the dot was not drawn, even though it should have been.
docs: the strokeDash API behavior's clarification for odd numbers
of values in dashPattern and refinement of the accepted values.
This adds support for a static scene mode,
allowing a scene to be treated as a static image.
In this mode, partial rendering for the inner
drawable components is skipped. This is especially
useful for scenes designed to be fully updated as a whole,
such as those used in fully dynamic Lottie contents.
issue: https://github.com/thorvg/thorvg/issues/1747
Partial Rendering refers to a rendering technique where
only a portion of the scene or screen is updated, rather
than redrawing the entire output. It is commonly used as
a performance optimization strategy, focusing on redrawing
only the regions that have changed, often called dirty regions.
This introduces RenderDirtyRegion, which assists
in collecting a compact dirty region from render tasks.
To efficient data-processing, this divide the screen region
with a designated size of partition and handles the partitl rendering
computation with a divide-conquer metholodgy.
Each backend can utilize this class to support efficient partial rendering.
This is implemented using a Line Sweep and Subdivision Merging O(NlogN).
The basic per-frame workflow is as follows:
0. RenderDirtyRegion::init() //set the screen size to properly partition the regions
1. RenderDirtyRegion::prepare() //Call this in Renderer::preRender().
2. RenderDirtyRegion::add() //Add all dirty paints for the frame before rendering.
3. RenderDirtyRegion::commit() //Generate the partial rendering region list before rendering.
4. RenderDirtyRegion::partition() //Get a certian partition
5. RenderDirtyRegion::get() //Retrieve the current dirty region list of a partition and use it when drawing paints.
6. RenderDirtyRegion::clear() //Reset the state.
RenderMethod introduced for 2 utilities for paritial renderings
1. RenderMethod::damage() //add a force dirty region, especially useful for scene effects
2. RenderMethod::partial() //toggle the partial rendering feature
issue: https://github.com/thorvg/thorvg/issues/1747
Implemented support for clipping shapes and images using a render region
bounding box at render time. This allows partial drawing of content,
laying the groundwork for upcoming partial rendering functionality.
for fast access of the drawing region from the linear rle data,
we introduced the binary search for begin/end of rle instead of
additional y index buffer.
There is a reason for not using a y-index buffer:
the shapes in the RLE are not single, continuous shapes
but multiple shapes scattered across the space.
which means that we need a double-associated data structure
per shapes for y indexing, and this data preparation wouldn't be
cheaper enough than realtime binary search especially animated data.
issue: https://github.com/thorvg/thorvg/issues/1747