From 46bd78a7c34a2f72c0179e274a8f3bfb4585280f Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 22 Oct 2020 14:55:22 +0900 Subject: [PATCH] sw_engine renderer: fix aliasing shape outline result. There a scenario detected that stroke 2 is not enough to cover shape outlines. So make it bigger size. --- src/lib/sw_engine/tvgSwRenderer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/sw_engine/tvgSwRenderer.cpp b/src/lib/sw_engine/tvgSwRenderer.cpp index 3f94179f..8022a4dc 100644 --- a/src/lib/sw_engine/tvgSwRenderer.cpp +++ b/src/lib/sw_engine/tvgSwRenderer.cpp @@ -62,7 +62,10 @@ struct SwTask : Task shapeReset(&shape); if (!shapePrepare(&shape, sdata, clip, transform)) return; if (renderShape) { - auto antiAlias = (strokeAlpha > 0 && strokeWidth >= 2) ? false : true; + /* 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 > 0 && strokeWidth > 2) ? false : true; if (!shapeGenRle(&shape, sdata, clip, antiAlias, compList.size() > 0 ? true : false)) return; } }