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.
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:
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::get() //Retrieve the current dirty region list and use it when drawing paints.
5. RenderDirtyRegion::clear() //Reset the state.
issue: https://github.com/thorvg/thorvg/issues/1747
Simplified parameters and ensured proper backend engine
initialization by using reference checking through canvas
instances.
C++ API Modification:
- Result Initializer::init(uint32_t threads, CanvasEngine engine)
-> Result Initializer::init(uint32_t threads)
- Result Initializer::term(CanvasEngine engine)
-> Result Initializer::term()
C API Modification:
- Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads)
-> Tvg_Result tvg_engine_init(unsigned threads);
- Tvg_Result tvg_engine_term(Tvg_Engine engine_method)
-> Tvg_Result tvg_engine_term()
issue: https://github.com/thorvg/thorvg/issues/3116
We have improved the functionality to manage the memory pool safely,
by figuring out the current working threads. Users no longer need to
manually configure memory pool management, and the related APIs
have been removed.
API Removals:
- Result SwCanvas::mempool(MempoolPolicy policy)
- enum SwCanvas::MempoolPolicy
- Tvg_Result tvg_swcanvas_set_mempool(Tvg_Canvas* canvas, Tvg_Mempool_Policy policy)
- enum Tvg_Mempool_Policy
issue: https://github.com/thorvg/thorvg/issues/3116
RenderMethod effects methods would have changes:
+ update() //update the effects if any
- prepare() -> region() //update the effect drawing region
- effect() -> render() //draw the effect
enhanced the rendering composition target to better support features such as
alpha blending, blending, masking, post effects, and more.
This allows rasterizers to prepare the composition context with more precise control.
Additionally, resolved a crash in the software engine's post-effect process
caused by a buffer size mismatch during XY buffer flipping.
issue: https://github.com/thorvg/thorvg/issues/3009
issue: https://github.com/thorvg/thorvg/issues/2984
Since we've separated ClipPath and Masking,
Masking now has a distinct and independent purpose.
API Modification:
- enum class CompositeMethod -> enum class MaskMethod
- Result Paint::composite(std::unique_ptr<Paint> target, CompositeMethod method) -> Result Paint::mask(std::unique_ptr<Paint> target, MaskMethod method)
- CompositeMethod Paint::mask(const Paint** target) const -> MaskMethod Paint::mask(const Paint** target) const
issue: https://github.com/thorvg/thorvg/issues/1372
Scene effects are typically applied to modify
the final appearance of a rendered scene,
such as adding a blur effect.
Each effect would have a different number of parameters
to control its visual properties. The Scene::push() interface
uses variadic arguments to accommodate various cases.
Users should refer to the SceneEffect API documentation
and pass the parameters exactly as required for the specific
effect type. For instance, GaussianBlur expects 3 parameters
which are:
- sigma(float)[greater than 0]
- direction(int)[both: 0 / horizontal: 1 / vertical: 2]
- border(int)[extend: 0 / wrap: 1]
- quality(int)[0 ~ 100]
and, scene->push(SceneEffect::GaussianBlur, 5.0f, 0, 0, 100);
New Experimental APIs:
- SceneEffect::ClearAll
- SceneEffect::GaussianBlur
- Result Scene::push(SceneEffect effect, ...);
Example:
- examples/SceneEffect
issue: https://github.com/thorvg/thorvg/issues/374
Corrected the alpha interpolation order during blending.
This also corrected the hard mix blending result in the guitar sample.
issue: https://github.com/thorvg/thorvg/issues/2704
The anti-aliased outline color was incorrectly blended
at the multiply option.
The fix can be observed in the example:
'examples/lottie/resourcesguitar.json'
in order to do this, RenderMehthod::blend() method introduced
`bool direct` for figuring out the intermediate composition.
Spec out this incomplete experimental feature,
this is a still promising one, we will reintroduce
this officially after 1.0 release
size: -2kb
issue: https://github.com/thorvg/thorvg/issues/1372