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

Unified Diff: src/pathops/SkDLineIntersection.cpp

Issue 13934009: path ops -- use standard max, min, double-is-nan (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 | « src/pathops/SkDCubicIntersection.cpp ('k') | src/pathops/SkDQuadIntersection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkDLineIntersection.cpp
===================================================================
--- src/pathops/SkDLineIntersection.cpp (revision 8808)
+++ src/pathops/SkDLineIntersection.cpp (working copy)
@@ -109,16 +109,16 @@
if ((at0 < 0 && at1 < 0) || (at0 > 1 && at1 > 1)) {
return fUsed = 0;
}
- fT[0][0] = SkTMax<double>(SkTMin<double>(at0, 1.0), 0.0);
- fT[0][1] = SkTMax<double>(SkTMin<double>(at1, 1.0), 0.0);
+ fT[0][0] = SkTMax(SkTMin(at0, 1.0), 0.0);
+ fT[0][1] = SkTMax(SkTMin(at1, 1.0), 0.0);
}
double bDenom = b0 - b1;
if (approximately_zero(bDenom)) {
fT[1][0] = fT[1][1] = 0;
} else {
int bIn = aDenom * bDenom < 0;
- fT[1][bIn] = SkTMax<double>(SkTMin<double>((b0 - a0) / bDenom, 1.0), 0.0);
- fT[1][!bIn] = SkTMax<double>(SkTMin<double>((b0 - a1) / bDenom, 1.0), 0.0);
+ fT[1][bIn] = SkTMax(SkTMin((b0 - a0) / bDenom, 1.0), 0.0);
+ fT[1][!bIn] = SkTMax(SkTMin((b0 - a1) / bDenom, 1.0), 0.0);
}
bool second = fabs(fT[0][0] - fT[0][1]) > FLT_EPSILON;
SkASSERT((fabs(fT[1][0] - fT[1][1]) <= FLT_EPSILON) ^ second);
@@ -189,11 +189,11 @@
if ((at0 < 0 && at1 < 0) || (at0 > 1 && at1 > 1)) {
return fUsed = 0;
}
- fT[0][0] = SkTMax<double>(SkTMin<double>(at0, 1.0), 0.0);
- fT[0][1] = SkTMax<double>(SkTMin<double>(at1, 1.0), 0.0);
+ fT[0][0] = SkTMax(SkTMin(at0, 1.0), 0.0);
+ fT[0][1] = SkTMax(SkTMin(at1, 1.0), 0.0);
int bIn = (a0 - a1) * (b0 - b1) < 0;
- fT[1][bIn] = SkTMax<double>(SkTMin<double>((b0 - a0) / (b0 - b1), 1.0), 0.0);
- fT[1][!bIn] = SkTMax<double>(SkTMin<double>((b0 - a1) / (b0 - b1), 1.0), 0.0);
+ fT[1][bIn] = SkTMax(SkTMin((b0 - a0) / (b0 - b1), 1.0), 0.0);
+ fT[1][!bIn] = SkTMax(SkTMin((b0 - a1) / (b0 - b1), 1.0), 0.0);
bool second = fabs(fT[0][0] - fT[0][1]) > FLT_EPSILON;
SkASSERT((fabs(fT[1][0] - fT[1][1]) <= FLT_EPSILON) ^ second);
return computePoints(line, 1 + second);
@@ -250,11 +250,11 @@
if ((at0 < 0 && at1 < 0) || (at0 > 1 && at1 > 1)) {
return fUsed = 0;
}
- fT[0][0] = SkTMax<double>(SkTMin<double>(at0, 1.0), 0.0);
- fT[0][1] = SkTMax<double>(SkTMin<double>(at1, 1.0), 0.0);
+ fT[0][0] = SkTMax(SkTMin(at0, 1.0), 0.0);
+ fT[0][1] = SkTMax(SkTMin(at1, 1.0), 0.0);
int bIn = (a0 - a1) * (b0 - b1) < 0;
- fT[1][bIn] = SkTMax<double>(SkTMin<double>((b0 - a0) / (b0 - b1), 1.0), 0.0);
- fT[1][!bIn] = SkTMax<double>(SkTMin<double>((b0 - a1) / (b0 - b1), 1.0), 0.0);
+ fT[1][bIn] = SkTMax(SkTMin((b0 - a0) / (b0 - b1), 1.0), 0.0);
+ fT[1][!bIn] = SkTMax(SkTMin((b0 - a1) / (b0 - b1), 1.0), 0.0);
bool second = fabs(fT[0][0] - fT[0][1]) > FLT_EPSILON;
SkASSERT((fabs(fT[1][0] - fT[1][1]) <= FLT_EPSILON) ^ second);
return computePoints(line, 1 + second);
« no previous file with comments | « src/pathops/SkDCubicIntersection.cpp ('k') | src/pathops/SkDQuadIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698