From f98057063b7e93bcbffb48aea0629b717bb58b0c Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Wed, 5 Mar 2025 15:27:44 +0100 Subject: [PATCH] renderer: rectified the fast track for clipping - Issue was present when masking and clipping were applied simultaneously. In the case where the mask was in fastTrack mode and the clip was also clipped, the fastTrack was not reset, resulting in an incorrect rendering effect. - For rectangular clippers with a stroke width > 0, stroke clipping should be applied. However, the fastTrack mode was set instead, resulting in regular clipping instead of stroke clipping. --- src/renderer/tvgPaint.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/renderer/tvgPaint.cpp b/src/renderer/tvgPaint.cpp index b368734c..a07c3ff6 100644 --- a/src/renderer/tvgPaint.cpp +++ b/src/renderer/tvgPaint.cpp @@ -250,12 +250,13 @@ RenderData Paint::Impl::update(RenderMethod* renderer, const Matrix& pm, Arrayviewport(); /* TODO: Intersect the clipper's clipper, if both are FastTrack. Update the subsequent clipper first and check its ctxFlag. */ - if (!PAINT(this->clipper)->clipper && (compFastTrack = _compFastTrack(renderer, this->clipper, pm, viewport)) == Result::Success) { + if (!PAINT(this->clipper)->clipper && SHAPE(this->clipper)->rs.strokeWidth() == 0.0f && _compFastTrack(renderer, this->clipper, pm, viewport) == Result::Success) { PAINT(this->clipper)->ctxFlag |= ContextFlag::FastTrack; - } - if (compFastTrack == Result::InsufficientCondition) { + compFastTrack = Result::Success; + } else { trd = PAINT(this->clipper)->update(renderer, pm, clips, 255, pFlag, true); clips.push(trd); + compFastTrack = Result::InsufficientCondition; } }