From 61f07677c569058f0a2f62b0c8064af6367b7138 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 28 May 2021 14:22:52 +0900 Subject: [PATCH] sw_engine renderer: fix aliasing problem. a corner case is detected that anti-aliasing is missing at shapes if the shape has the dash-style stroke. By adding the condition, it applies anti-aliasing properly. @Issues: 394 --- src/lib/sw_engine/tvgSwRenderer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/sw_engine/tvgSwRenderer.cpp b/src/lib/sw_engine/tvgSwRenderer.cpp index 34428dfa..7afcf231 100644 --- a/src/lib/sw_engine/tvgSwRenderer.cpp +++ b/src/lib/sw_engine/tvgSwRenderer.cpp @@ -98,8 +98,9 @@ struct SwShapeTask : SwTask if (renderShape) { /* We assume that if stroke width is bigger than 2, shape outline below stroke could be full covered by stroke drawing. - Thus it turns off antialising in that condition. */ - auto antiAlias = (strokeAlpha == 255 && strokeWidth > 2) ? false : true; + Thus it turns off antialising in that condition. + Also, it shouldn't be dash style. */ + auto antiAlias = (strokeAlpha == 255 && strokeWidth > 2 && sdata->strokeDash(nullptr) == 0) ? false : true; if (!shapeGenRle(&shape, sdata, antiAlias, clips.count > 0 ? true : false)) goto err; ++addStroking; }