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
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
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
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.
* Support rendering Gradient in path Stroke mode
* Fix GlStencilCoverTask not support even-odd fill rule
* Make GlStencilCoverTask can discard overlapped area during stroke
rendering
* use GLRenderBuffer in color and stencil attachment, also use x4 sample
count by default.
* add msaa resolve logical at the end of a ComposeTask, so the normal
color texture can get the final rendering result.
* 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
ThorVG has offered an option to clear the buffer since version 1.0.
This is essential when users utilize the canvas target buffer
with the main render target. They share the buffer
and need to draw contents onto the existing contents.
API:
Result Canvas::clear(bool free = true)
-> Result Canvas::clear(bool paints = true, bool buffer = true)
Tvg_Result tvg_canvas_clear(Tvg_Canvas* canvas, bool free);
-> Tvg_Result tvg_canvas_clear(Tvg_Canvas* canvas, bool paints, bool buffer);
Issue: https://github.com/thorvg/thorvg/issues/1779
Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
* Use uniform block to pack all color informations
* Move the actual gl draw call into GlRenderer::sync function, so all
data is been uploaded into GPU
* Make GlRenderTask simple and generic for direct gl draw