Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: src/core/SkPoint.cpp

Issue 948043003: Fix to check for inf when generating quadratic points (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/conicpaths.cpp ('k') | src/gpu/GrPathUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPoint.cpp
diff --git a/src/core/SkPoint.cpp b/src/core/SkPoint.cpp
index 20bc33666eb053ff8428af8d920d3f4ffb499596..aabde2786dc11339c80b04d31cf2f28eb376ffdd 100644
--- a/src/core/SkPoint.cpp
+++ b/src/core/SkPoint.cpp
@@ -223,7 +223,9 @@ SkScalar SkPoint::distanceToLineBetweenSqd(const SkPoint& a,
1 == kRight_Side);
*side = (Side) SkScalarSignAsInt(det);
}
- return SkScalarMulDiv(det, det, uLengthSqd);
+ SkScalar temp = det / uLengthSqd;
+ temp *= det;
+ return temp;
}
SkScalar SkPoint::distanceToLineSegmentBetweenSqd(const SkPoint& a,
@@ -256,6 +258,8 @@ SkScalar SkPoint::distanceToLineSegmentBetweenSqd(const SkPoint& a,
return b.distanceToSqd(*this);
} else {
SkScalar det = u.cross(v);
- return SkScalarMulDiv(det, det, uLengthSqd);
+ SkScalar temp = det / uLengthSqd;
+ temp *= det;
+ return temp;
}
}
« no previous file with comments | « gm/conicpaths.cpp ('k') | src/gpu/GrPathUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698