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

Unified Diff: third_party/agg23/agg_math.h

Issue 1726893002: Remove FXSYS_MulDiv(a, b, c). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 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
Index: third_party/agg23/agg_math.h
diff --git a/third_party/agg23/agg_math.h b/third_party/agg23/agg_math.h
index c0d9570aa9e2e75fac26707423d5b64ff4d00d4a..e003297dfffb4a579e17bd7554cd33d7a4dfbad2 100644
--- a/third_party/agg23/agg_math.h
+++ b/third_party/agg23/agg_math.h
@@ -44,7 +44,7 @@ AGG_INLINE FX_FLOAT calc_line_point_distance(FX_FLOAT x1, FX_FLOAT y1,
if(d < intersection_epsilon) {
return calc_distance(x1, y1, x, y);
}
- return FXSYS_MulDiv(x - x2, dy, d) - FXSYS_MulDiv(y - y2, dx, d);
+ return ((x - x2) * dy / d) - ((y - y2) * dx / d);
}
AGG_INLINE bool calc_intersection(FX_FLOAT ax, FX_FLOAT ay, FX_FLOAT bx, FX_FLOAT by,
FX_FLOAT cx, FX_FLOAT cy, FX_FLOAT dx, FX_FLOAT dy,
@@ -55,8 +55,8 @@ AGG_INLINE bool calc_intersection(FX_FLOAT ax, FX_FLOAT ay, FX_FLOAT bx, FX_FLOA
if (FXSYS_fabs(den) < intersection_epsilon) {
return false;
}
- *x = ax + FXSYS_MulDiv(bx - ax, num, den);
- *y = ay + FXSYS_MulDiv(by - ay, num, den);
+ *x = ax + ((bx - ax) * num / den);
+ *y = ay + ((by - ay) * num / den);
return true;
}
}

Powered by Google App Engine
This is Rietveld 408576698