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.
This commit is contained in:
Mira Grudzinska 2025-03-05 15:27:44 +01:00 committed by Hermet Park
parent e2f1557de5
commit f98057063b

View file

@ -250,12 +250,13 @@ RenderData Paint::Impl::update(RenderMethod* renderer, const Matrix& pm, Array<R
viewport = renderer->viewport(); viewport = renderer->viewport();
/* TODO: Intersect the clipper's clipper, if both are FastTrack. /* TODO: Intersect the clipper's clipper, if both are FastTrack.
Update the subsequent clipper first and check its ctxFlag. */ 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; PAINT(this->clipper)->ctxFlag |= ContextFlag::FastTrack;
} compFastTrack = Result::Success;
if (compFastTrack == Result::InsufficientCondition) { } else {
trd = PAINT(this->clipper)->update(renderer, pm, clips, 255, pFlag, true); trd = PAINT(this->clipper)->update(renderer, pm, clips, 255, pFlag, true);
clips.push(trd); clips.push(trd);
compFastTrack = Result::InsufficientCondition;
} }
} }