Vertical or horizontal lines represented as paths rendering with artifacts.

138 views
Skip to first unread message

Corey Lucier

unread,
Oct 30, 2017, 3:07:48 PM10/30/17
to skia-discuss
Our users are noticing that when rendering lines SkPath, they are seeing what look to be dashed artifacts. 

Any idea where these might be coming from? 

I can't seem to repro with Skia fiddle. We are using M62.

Note the bottom two pink lines, they are represented as a path with drawPath, the top pink line is drawn as a line via drawLine.

If you examine the zoomed in version note the periodic (but not uniform) dashed artifacts (very faint).

Here is the fiddle where I was trying to repro but as of yet can't..not sure yet what might differ between - https://fiddle.skia.org/c/224fd46823d74c3d5cf368e39e034c7d 







Brian Osman

unread,
Oct 30, 2017, 3:22:38 PM10/30/17
to skia-d...@googlegroups.com
Are these paths that just contain a single line contour, or are there multiple lines (eg, lineTo(x0, 0), lineTo(x1, 0), ...)? This is with the CPU backend, right?


--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Corey Lucier

unread,
Oct 30, 2017, 3:24:48 PM10/30/17
to skia-discuss
Here is another fiddle that better reproduces the problem, seems as though degenerate beziers are being emitted from our tooling..but is it rendering "as expected" in this case?

Yuqian Li

unread,
Oct 30, 2017, 3:28:38 PM10/30/17
to skia-d...@googlegroups.com
This seems similar to the skbug.com/6886 . See especially the last dash line screenshot on that bug. I'm planning to write a fix for it soon.

Note that this bug only affects:

1. our newest DAA software backend (which is not turned on in Chrome yet; it's only turned on in vanilla Skia)
2. our newest CCPR GPU backend (I'm not sure when it's going to be used)


On Mon, Oct 30, 2017 at 3:22 PM, 'Brian Osman' via skia-discuss <skia-d...@googlegroups.com> wrote:
Are these paths that just contain a single line contour, or are there multiple lines (eg, lineTo(x0, 0), lineTo(x1, 0), ...)? This is with the CPU backend, right?
On Mon, Oct 30, 2017 at 3:07 PM Corey Lucier <corey....@gmail.com> wrote:
Our users are noticing that when rendering lines SkPath, they are seeing what look to be dashed artifacts. 

Any idea where these might be coming from? 

I can't seem to repro with Skia fiddle. We are using M62.

Note the bottom two pink lines, they are represented as a path with drawPath, the top pink line is drawn as a line via drawLine.

If you examine the zoomed in version note the periodic (but not uniform) dashed artifacts (very faint).

Here is the fiddle where I was trying to repro but as of yet can't..not sure yet what might differ between - https://fiddle.skia.org/c/224fd46823d74c3d5cf368e39e034c7d 







--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

Corey Lucier

unread,
Oct 30, 2017, 3:51:59 PM10/30/17
to skia-discuss
Maybe, but I think we are seeing this with older builds.  M59 and later.  Was this new software backend integrated earlier than M59?

Since we are using a "degenerate-ish" cubic to represent the line seems all segments of the line are getting AA'd on the edges opposite the direction of the line.  Kinda odd.

Yuqian Li

unread,
Oct 30, 2017, 4:04:31 PM10/30/17
to skia-d...@googlegroups.com
You're right: it's not there in M59. I'm investigating your fiddle to see if other things go wrong.

On Mon, Oct 30, 2017 at 3:51 PM, Corey Lucier <corey....@gmail.com> wrote:
Maybe, but I think we are seeing this with older builds.  M59 and later.  Was this new software backend integrated earlier than M59?

Since we are using a "degenerate-ish" cubic to represent the line seems all segments of the line are getting AA'd on the edges opposite the direction of the line.  Kinda odd.

--

Greg Daniel

unread,
Oct 30, 2017, 4:07:41 PM10/30/17
to skia-d...@googlegroups.com
I believe it is that we are double hitting on hairlines. If you change the stroke width to 1.001, or blend in plus mode then it looks fine. So either we can try to tweak the hairline renderer to try and remove some of the double hitting, or improve the degenerate cubic check so that we immediately go from the cubic to a single line instead of chopping it up.

On Mon, Oct 30, 2017 at 4:04 PM 'Yuqian Li' via skia-discuss <skia-d...@googlegroups.com> wrote:
You're right: it's not there in M59. I'm investigating your fiddle to see if other things go wrong.
On Mon, Oct 30, 2017 at 3:51 PM, Corey Lucier <corey....@gmail.com> wrote:
Maybe, but I think we are seeing this with older builds.  M59 and later.  Was this new software backend integrated earlier than M59?

Since we are using a "degenerate-ish" cubic to represent the line seems all segments of the line are getting AA'd on the edges opposite the direction of the line.  Kinda odd.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

Corey Lucier

unread,
Oct 30, 2017, 4:08:41 PM10/30/17
to skia-discuss
Can you clarify Yuqian Li? Are you saying that if we go back far enough we wouldn't see this issue?  (Is there a version of fiddle pointing to older skia builds) so we can easily confirm?

Yuqian Li

unread,
Oct 30, 2017, 4:11:49 PM10/30/17
to skia-d...@googlegroups.com, Mike Reed, Cary Clark
I meant that DAA is not in M59 so if this bug already existed in M59, it's not related with DAA.

My preliminary gdb suggests that the problem is probably in our software AA hairline code. 

On Mon, Oct 30, 2017 at 4:08 PM, Corey Lucier <corey....@gmail.com> wrote:
Can you clarify Yuqian Li? Are you saying that if we go back far enough we wouldn't see this issue?  (Is there a version of fiddle pointing to older skia builds) so we can easily confirm?

--

Corey Lucier

unread,
Oct 30, 2017, 4:16:23 PM10/30/17
to skia-discuss
Greg,

Thanks, I could swear an earlier version of Skia was more forgiving in this instance, but could be wrong.

Mike Reed

unread,
Oct 30, 2017, 4:32:30 PM10/30/17
to skia-d...@googlegroups.com
The cubic is pretty skewed (in t), and our cubic --> line flatness test is pretty dumb; it will create a bunch of lines even though they are not (visually) needed. Couple that with our anti-hairline logic which draws partially covered pixels with partial alpha, and you can (I think) explain the artifacts.

Some experiments:
- change the width to 1.001, and it should look correct (we stop using our hair code)
- change the blend mode to kPlus, and it should look correct (the double-pixel hitting due to end-points safely accumulates)

Ideas for improvements (not mutually exclusive)
- change our flatness test to be smarter
- change our hair logic to handle pixels at joins differently

On Mon, Oct 30, 2017 at 3:51 PM, Corey Lucier <corey....@gmail.com> wrote:
Maybe, but I think we are seeing this with older builds.  M59 and later.  Was this new software backend integrated earlier than M59?

Since we are using a "degenerate-ish" cubic to represent the line seems all segments of the line are getting AA'd on the edges opposite the direction of the line.  Kinda odd.

--
Reply all
Reply to author
Forward
0 new messages