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

Unified Diff: src/pathops/SkPathOpsQuad.cpp

Issue 1522183002: only call scalar finite when necessary (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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
Index: src/pathops/SkPathOpsQuad.cpp
diff --git a/src/pathops/SkPathOpsQuad.cpp b/src/pathops/SkPathOpsQuad.cpp
index 12b9658ce7cda93f95a8d615a29c9ca90a665e85..3deab211339035498238defdd6ea4a1032fef538 100644
--- a/src/pathops/SkPathOpsQuad.cpp
+++ b/src/pathops/SkPathOpsQuad.cpp
@@ -119,7 +119,8 @@ and using the roots
int SkDQuad::RootsReal(const double A, const double B, const double C, double s[2]) {
const double p = B / (2 * A);
const double q = C / A;
- if (approximately_zero(A) && (approximately_zero_inverse(p) || approximately_zero_inverse(q))) {
+ if (!A || (approximately_zero(A) && (approximately_zero_inverse(p)
+ || approximately_zero_inverse(q)))) {
if (approximately_zero(B)) {
s[0] = 0;
return C == 0;

Powered by Google App Engine
This is Rietveld 408576698