Skia PathOp kDifference_SkPathOp incorrect result in some cases

11 views
Skip to first unread message

Jiulong Wang

unread,
Apr 20, 2021, 7:38:24 PMApr 20
to skia-discuss
Hi Skia,

Skia's SkPath library does awesome job in most of the cases.  However, occasionally we observed weird behaviors (like this post, also a previous post).  I haven't got time to take a deep look into the math behind it.  Hopefully it can be fixed...

I created a fiddle that re-pro the issue (data copied from a real customer so a bit lengthy): https://fiddle.skia.org/c/ac66fd737b2fb4aa5e29d67e62b7dcac

In case fiddle gets lost, here's the code in gist: https://gist.github.com/jiulongw/a5e5971fa5821f28d77f750c8fe672c9

In the output, the red path diffs the green path and the result is the blue path in the 2nd row.  Note the red path as two contours.  If I first do Simplify on red path, the result is then expected (3rd and 4th row in the output).  However, we observed before that Simplify would do other nasty things so we hesitated to enable it for all cases.

Screen Shot 2021-04-20 at 4.30.41 PM.png

Any help is much appreciated.

Thanks!
-Jiulong
Reply all
Reply to author
Forward
0 new messages