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
- refactored the Fill matrix to hold internal data statically.
- refactored for clean & neat the raster engine / svg loader logic.
API Modification:
- Matrix Fill::transform() const -> Matrix& Fill::transform() 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
Implement some advance blending equation in GLEngine by using two
RenderPass.
* The first pass render the content into an off-screen framebuffer, also
blit the screen content to an off-screen Texture.
* The second pass renders the final blended color to the screen.
Also use a stencil test to prevent non-drawn areas from participating in the color blending calculation.
issue: https://github.com/thorvg/thorvg/issues/2435
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
deprecate the `identifier()` APIs by replacing them with `type()`.
ThorVG is going to introduce an instance `id()`,
and this could be confused with the `identifier()` methods.
with this new type() method can reduce the memory size
by removing unncessary type data.
New Experimental C APIs:
- enum Tvg_Type
- Tvg_Result tvg_paint_get_type(const Tvg_Paint* paint, Tvg_Type* type)
- Tvg_Result tvg_gradient_get_type(const Tvg_Gradient* grad, Tvg_Type* type)
New Experimental C++ APIs:
- Type Paint::type() const
- Type Fill::type() const
- Type LinearGradient::type() const
- Type RadialGradient::type() const
- Type Shape::type() const
- Type Scene::type() const
- Type Picture::type() const
- Type Text::type() const
Deprecated C APIs:
- enum Tvg_Identifier
- Tvg_Result tvg_paint_get_identifier(const Tvg_Paint* paint, Tvg_Identifier* identifier)
- Tvg_Result tvg_gradient_get_identifier(const Tvg_Gradient* grad, Tvg_Identifier* identifier)
Deprecated C++ APIs:
- enum class Type
- uint32_t Paint::identifier() const
- uint32_t Fill::identifier() const
- static uint32_t Picture::identifier()
- static uint32_t Scene::identifier()
- static uint32_t Shape::identifier()
- static uint32_t LinearGradient:identifier()
- static uint32_T RadialGradient::identfier()
Removed Experimental APIs:
- static uint32_t Text::identifier()
issue: https://github.com/thorvg/thorvg/issues/1372
Performing a full-screen RenderPass resolve is too expensive.
Because most composite cases only require a small area to be rendered off-screen.
To improve performance, use the bounds of the Geometry for off-screen rendering whenever possible
* Optimize clip logical, change to use GL_GRATER and keep incrace depth
value, so no need to do depth clear after every clip draw.
* Correct geometry bounding box calculation, and make sure the bounds is
larger than all vertices
* Limit drawing area for off-screen RenderPass with correct scissor box
The viewport function defines the rectangular area of the canvas
that will be used for drawing operations.
It is used to clip the rendering output to the boundaries of the rectangle.
Apps can use this function to set the drawing region within the canvas.
When the ThorVG canvas is partially inside the screen area such as during scrolling
it could help enhance rendering performance.
New Experimental API:
- Result Canvas::viewport(int32_t x, int32_t y, int32_t w, int32_t h) noexcept;
Issue: https://github.com/thorvg/thorvg/issues/2274
* restrict the scissor box of composite task
* do not tessellate stroke or fill geometry if there is no Fill or
Stroke color
* use actually transformed curve to calculate polyline count when doing
curve flatten
Fix some error:
* glViewport not controlled by framebuffer, and need to set manually when
target framebuffer is changed.
* change even-odd stencil operation, so no need to do third draw call to
clear stencil buffer
* fix the missing `GlCanvas::update` calls in Lottoe and LottieExtension
* Fix error when handle GradientTransform calculation. And move the inv
calculation into gradient vertex shader.
* Fix cubic tessellation not close the last point
Since blit msaa framebuffer to another msaa framebuffer may generate
GLError in some platforms. Use normal texture rendering to blit the final
color buffer onto target framebuffer.
GL might need to generate a default target FBO
when the given target ID indicates the main surface.
However, users may want to draw visuals directly onto the main surface.
This policy must be reviewed thoroughly.
* Support rendering Gradient in path Stroke mode
* Fix GlStencilCoverTask not support even-odd fill rule
* Make GlStencilCoverTask can discard overlapped area during stroke
rendering
Refactor the GlCanvas::target() interface to allow
passing the drawing target ID from the user side.
Previously, it performed the drawing on the currently set FBO target.
Beta API change:
Result GlCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
-> Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h)
Since we choose MSAA, no need to calculate edge alpha during fragment
stage. So this commit removed the alpha attribute and related code:
* Remove the alpha attribute in vertex data.
* Change position type from `vec3` to `vec2` in all shader code.
* Remove alhpa multiplication in all fragment shaders
* add new render task to do stencil and cover rendering which is a
fallback rendering method to handle cases that trianglation tessellation
failed
* add a new tessellator to generate stencil and cover vertex mesh
../src/renderer/gl_engine/tvgGlRenderer.cpp:450:24: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
450 | for (auto i = 0; i < mComposePool.count; i++) {
|