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

Unified Diff: src/core/SkGeometry.cpp

Issue 1556073004: add comment (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: try again Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGeometry.cpp
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp
index fb9cb5c5111507c93b247e7bc50c038ea8356281..c25e18641a43bc0c766e1469a9c16d595e955282 100644
--- a/src/core/SkGeometry.cpp
+++ b/src/core/SkGeometry.cpp
@@ -91,6 +91,12 @@ int SkFindUnitQuadRoots(SkScalar A, SkScalar B, SkScalar C, SkScalar roots[2]) {
SkScalar R = B*B - 4*A*C;
if (R < 0 || !SkScalarIsFinite(R)) { // complex roots
+ // if R is infinite, it's possible that it may still produce
+ // useful results if the operation was repeated in doubles
+ // the flipside is determining if the more precise answer
+ // isn't useful because surrounding machinery (e.g., subtracting
+ // the axis offset from C) already discards the extra precision
+ // more investigation and unit tests required...
return 0;
}
R = SkScalarSqrt(R);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698