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

Unified Diff: third_party/agg23/agg_curves.cpp

Issue 1729613003: Remove FXSYS_Mul. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master 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
« no previous file with comments | « third_party/agg23/agg_clip_liang_barsky.h ('k') | third_party/agg23/agg_math.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/agg23/agg_curves.cpp
diff --git a/third_party/agg23/agg_curves.cpp b/third_party/agg23/agg_curves.cpp
index e19221d33e77b4f6391f4b6794038ac001141745..21b959dc978c5a10c0e5ee82a21926040c8c8a63 100644
--- a/third_party/agg23/agg_curves.cpp
+++ b/third_party/agg23/agg_curves.cpp
@@ -61,8 +61,8 @@ void curve4_div::recursive_bezier(FX_FLOAT x1, FX_FLOAT y1,
FX_FLOAT y1234 = (y123 + y234) / 2;
FX_FLOAT dx = x4 - x1;
FX_FLOAT dy = y4 - y1;
- FX_FLOAT d2 = FXSYS_fabs(FXSYS_Mul(x2 - x4, dy) - FXSYS_Mul(y2 - y4, dx));
- FX_FLOAT d3 = FXSYS_fabs(FXSYS_Mul(x3 - x4, dy) - FXSYS_Mul(y3 - y4, dx));
+ FX_FLOAT d2 = FXSYS_fabs(((x2 - x4) * dy) - ((y2 - y4) * dx));
+ FX_FLOAT d3 = FXSYS_fabs(((x3 - x4) * dy) - ((y3 - y4) * dx));
switch((int(d2 > curve_collinearity_epsilon) << 1) +
int(d3 > curve_collinearity_epsilon)) {
case 0:
@@ -75,22 +75,22 @@ void curve4_div::recursive_bezier(FX_FLOAT x1, FX_FLOAT y1,
}
break;
case 1:
- if(FXSYS_Mul(d3, d3) <= FXSYS_Mul(m_distance_tolerance_square,
- FXSYS_Mul(dx, dx) + FXSYS_Mul(dy, dy))) {
+ if ((d3 * d3) <=
+ (m_distance_tolerance_square * ((dx * dx) + (dy * dy)))) {
m_points.add(point_type(x23, y23, path_flags_jr));
return;
}
break;
case 2:
- if(FXSYS_Mul(d2, d2) <= FXSYS_Mul(m_distance_tolerance_square,
- FXSYS_Mul(dx, dx) + FXSYS_Mul(dy, dy))) {
+ if ((d2 * d2) <=
+ (m_distance_tolerance_square * ((dx * dx) + (dy * dy)))) {
m_points.add(point_type(x23, y23, path_flags_jr));
return;
}
break;
case 3:
- if(FXSYS_Mul(d2 + d3, d2 + d3) <= FXSYS_Mul(m_distance_tolerance_square,
- FXSYS_Mul(dx, dx) + FXSYS_Mul(dy, dy))) {
+ if (((d2 + d3) * (d2 + d3)) <=
+ (m_distance_tolerance_square * ((dx * dx) + (dy * dy)))) {
m_points.add(point_type(x23, y23, path_flags_jr));
return;
}
« no previous file with comments | « third_party/agg23/agg_clip_liang_barsky.h ('k') | third_party/agg23/agg_math.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698