Index: src/gpu/GrPathUtils.cpp |
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp |
index 21d115569b495776a3e22ac4a9e2696df7e6f9cf..f97a61e1f60f202942d94ea913b4e98a50b48bf0 100644 |
--- a/src/gpu/GrPathUtils.cpp |
+++ b/src/gpu/GrPathUtils.cpp |
@@ -133,10 +133,10 @@ uint32_t GrPathUtils::generateCubicPoints(const SkPoint& p0, |
if (pointsLeft < 2 || |
(p1.distanceToLineSegmentBetweenSqd(p0, p3) < tolSqd && |
p2.distanceToLineSegmentBetweenSqd(p0, p3) < tolSqd)) { |
- (*points)[0] = p3; |
- *points += 1; |
- return 1; |
- } |
+ (*points)[0] = p3; |
+ *points += 1; |
+ return 1; |
+ } |
SkPoint q[] = { |
{ SkScalarAve(p0.fX, p1.fX), SkScalarAve(p0.fY, p1.fY) }, |
{ SkScalarAve(p1.fX, p2.fX), SkScalarAve(p1.fY, p2.fY) }, |
@@ -408,8 +408,8 @@ void convert_noninflect_cubic_to_quads(const SkPoint p[4], |
SkVector ab = p[1] - p[0]; |
SkVector dc = p[2] - p[3]; |
- if (ab.isZero()) { |
- if (dc.isZero()) { |
+ if (ab.lengthSqd() < SK_ScalarNearlyZero) { |
+ if (dc.lengthSqd() < SK_ScalarNearlyZero) { |
SkPoint* degQuad = quads->push_back_n(3); |
degQuad[0] = p[0]; |
degQuad[1] = p[0]; |
@@ -418,7 +418,7 @@ void convert_noninflect_cubic_to_quads(const SkPoint p[4], |
} |
ab = p[2] - p[0]; |
} |
- if (dc.isZero()) { |
+ if (dc.lengthSqd() < SK_ScalarNearlyZero) { |
dc = p[1] - p[3]; |
} |