Otherwise these can be misclassified as cusps since there is already
tolerance in the discriminant test.
BUG=skia:
Change-Id: Id02c12f671714cebf799953ebed5335ee4c4d52a
Reviewed-on: https://skia-review.googlesource.com/9355
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
} else if (discr < -SK_ScalarNearlyZero) {
return kLoop_SkCubicType;
} else {
- if (0.f == d[0] && 0.f == d[1]) {
- return (0.f == d[2] ? kLine_SkCubicType : kQuadratic_SkCubicType);
+ if (SkScalarAbs(d[0]) < SK_ScalarNearlyZero && SkScalarAbs(d[1]) < SK_ScalarNearlyZero) {
+ return ((SkScalarAbs(d[2]) < SK_ScalarNearlyZero) ? kLine_SkCubicType
+ : kQuadratic_SkCubicType);
} else {
return kCusp_SkCubicType;
}