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
This commit is contained in:
Hermet Park 2021-05-28 14:22:52 +09:00
parent f1d5571aad
commit 61f07677c5

View file

@ -98,8 +98,9 @@ struct SwShapeTask : SwTask
if (renderShape) { if (renderShape) {
/* We assume that if stroke width is bigger than 2, /* We assume that if stroke width is bigger than 2,
shape outline below stroke could be full covered by stroke drawing. shape outline below stroke could be full covered by stroke drawing.
Thus it turns off antialising in that condition. */ Thus it turns off antialising in that condition.
auto antiAlias = (strokeAlpha == 255 && strokeWidth > 2) ? false : true; 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; if (!shapeGenRle(&shape, sdata, antiAlias, clips.count > 0 ? true : false)) goto err;
++addStroking; ++addStroking;
} }