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

Unified Diff: src/pathops/SkPathOpsCubic.cpp

Issue 2006653006: pin before calling acos (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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
« src/core/SkGeometry.cpp ('K') | « src/core/SkGeometry.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsCubic.cpp
diff --git a/src/pathops/SkPathOpsCubic.cpp b/src/pathops/SkPathOpsCubic.cpp
index 6b74fb00efac83990703727eb207997f3460c467..6c088b3edae462cb00a5625542e42e79bae9d9c0 100644
--- a/src/pathops/SkPathOpsCubic.cpp
+++ b/src/pathops/SkPathOpsCubic.cpp
@@ -419,7 +419,7 @@ int SkDCubic::RootsReal(double A, double B, double C, double D, double s[3]) {
double r;
double* roots = s;
if (R2MinusQ3 < 0) { // we have 3 real roots
- double theta = acos(R / sqrt(Q3));
+ double theta = acos(SkTPin(R / sqrt(Q3), -1., 1.)); // bug.skia.org/5222
double neg2RootQ = -2 * sqrt(Q);
r = neg2RootQ * cos(theta / 3) - adiv3;
« src/core/SkGeometry.cpp ('K') | « src/core/SkGeometry.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698