diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2016-02-23 15:23:29 -0500 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2016-02-23 15:23:29 -0500 |
commit | 2c8fad44315db58f5b3222161dcb699691dca904 (patch) | |
tree | 70e9bdf55e1e3197d8bd088abd103012b602e32f /third_party/agg23 | |
parent | 2886a25b68225ad3ad70d417b01108ad1d126488 (diff) | |
download | pdfium-2c8fad44315db58f5b3222161dcb699691dca904.tar.xz |
Remove FXSYS_Mul.
This define just multiples the two parameters together. Inline the *'s.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1729613003 .
Diffstat (limited to 'third_party/agg23')
-rw-r--r-- | third_party/agg23/agg_clip_liang_barsky.h | 16 | ||||
-rw-r--r-- | third_party/agg23/agg_curves.cpp | 16 | ||||
-rw-r--r-- | third_party/agg23/agg_math.h | 6 | ||||
-rw-r--r-- | third_party/agg23/agg_math_stroke.h | 30 |
4 files changed, 34 insertions, 34 deletions
diff --git a/third_party/agg23/agg_clip_liang_barsky.h b/third_party/agg23/agg_clip_liang_barsky.h index cfc4c91f60..13e4ab9e30 100644 --- a/third_party/agg23/agg_clip_liang_barsky.h +++ b/third_party/agg23/agg_clip_liang_barsky.h @@ -85,21 +85,21 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2, if(tin2 <= tout1) { if(tin2 > 0) { if(tinx > tiny) { - *x++ = (T)xin; - *y++ = (T)(y1 + FXSYS_Mul(deltay, tinx)); + *x++ = (T)xin; + *y++ = (T)(y1 + (deltay * tinx)); } else { - *x++ = (T)(x1 + FXSYS_Mul(deltax, tiny)); - *y++ = (T)yin; + *x++ = (T)(x1 + (deltax * tiny)); + *y++ = (T)yin; } ++np; } if(tout1 < 1.0f) { if(toutx < touty) { - *x++ = (T)xout; - *y++ = (T)(y1 + FXSYS_Mul(deltay, toutx)); + *x++ = (T)xout; + *y++ = (T)(y1 + (deltay * toutx)); } else { - *x++ = (T)(x1 + FXSYS_Mul(deltax, touty)); - *y++ = (T)yout; + *x++ = (T)(x1 + (deltax * touty)); + *y++ = (T)yout; } } else { *x++ = x2; diff --git a/third_party/agg23/agg_curves.cpp b/third_party/agg23/agg_curves.cpp index e19221d33e..21b959dc97 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; } diff --git a/third_party/agg23/agg_math.h b/third_party/agg23/agg_math.h index 31e0daf3bb..c0d9570aa9 100644 --- a/third_party/agg23/agg_math.h +++ b/third_party/agg23/agg_math.h @@ -26,7 +26,7 @@ AGG_INLINE FX_FLOAT calc_point_location(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_FLOAT x, FX_FLOAT y) { - return FXSYS_Mul(x - x2, y2 - y1) - FXSYS_Mul(y - y2, x2 - x1); + return ((x - x2) * (y2 - y1)) - ((y - y2) * (x2 - x1)); } AGG_INLINE FX_FLOAT calc_distance(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2) { @@ -50,8 +50,8 @@ AGG_INLINE bool calc_intersection(FX_FLOAT ax, FX_FLOAT ay, FX_FLOAT bx, FX_FLOA FX_FLOAT cx, FX_FLOAT cy, FX_FLOAT dx, FX_FLOAT dy, FX_FLOAT* x, FX_FLOAT* y) { - FX_FLOAT num = FXSYS_Mul(ay - cy, dx - cx) - FXSYS_Mul(ax - cx, dy - cy); - FX_FLOAT den = FXSYS_Mul(bx - ax, dy - cy) - FXSYS_Mul(by - ay, dx - cx); + FX_FLOAT num = ((ay - cy) * (dx - cx)) - ((ax - cx) * (dy - cy)); + FX_FLOAT den = ((bx - ax) * (dy - cy)) - ((by - ay) * (dx - cx)); if (FXSYS_fabs(den) < intersection_epsilon) { return false; } diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_stroke.h index 620d675312..ff42b2291e 100644 --- a/third_party/agg23/agg_math_stroke.h +++ b/third_party/agg23/agg_math_stroke.h @@ -67,8 +67,8 @@ void stroke_calc_arc(VertexConsumer& out_vertices, a2 -= da / 4; a1 += da; while(a1 < a2) { - out_vertices.add(coord_type(x + FXSYS_Mul(width, FXSYS_cos(a1)), - y + FXSYS_Mul(width, FXSYS_sin(a1)))); + out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)), + y + (width * FXSYS_sin(a1)))); a1 += da; } } else { @@ -78,8 +78,8 @@ void stroke_calc_arc(VertexConsumer& out_vertices, a2 += da / 4; a1 -= da; while(a1 > a2) { - out_vertices.add(coord_type(x + FXSYS_Mul(width, FXSYS_cos(a1)), - y + FXSYS_Mul(width, FXSYS_sin(a1)))); + out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)), + y + (width * FXSYS_sin(a1)))); a1 -= da; } } @@ -107,7 +107,7 @@ void stroke_calc_miter(VertexConsumer& out_vertices, v2.x + dx2, v2.y - dy2, &xi, &yi)) { FX_FLOAT d1 = calc_distance(v1.x, v1.y, xi, yi); - FX_FLOAT lim = FXSYS_Mul(width, miter_limit); + FX_FLOAT lim = width * miter_limit; if(d1 <= lim) { out_vertices.add(coord_type(xi, yi)); miter_limit_exceeded = false; @@ -115,8 +115,8 @@ void stroke_calc_miter(VertexConsumer& out_vertices, } else { FX_FLOAT x2 = v1.x + dx1; FX_FLOAT y2 = v1.y - dy1; - if((FXSYS_Mul(x2 - v0.x, dy1) - FXSYS_Mul(v0.y - y2, dx1) < 0) != - (FXSYS_Mul(x2 - v2.x, dy1) - FXSYS_Mul(v2.y - y2, dx1) < 0)) { + if ((((x2 - v0.x) * dy1) - ((v0.y - y2) * dx1) < 0) != + (((x2 - v2.x) * dy1) - ((v2.y - y2) * dx1) < 0)) { out_vertices.add(coord_type(v1.x + dx1, v1.y - dy1)); miter_limit_exceeded = false; } @@ -133,10 +133,10 @@ void stroke_calc_miter(VertexConsumer& out_vertices, width, approximation_scale); break; default: - out_vertices.add(coord_type(v1.x + dx1 + FXSYS_Mul(dy1, miter_limit), - v1.y - dy1 + FXSYS_Mul(dx1, miter_limit))); - out_vertices.add(coord_type(v1.x + dx2 - FXSYS_Mul(dy2, miter_limit), - v1.y - dy2 - FXSYS_Mul(dx2, miter_limit))); + out_vertices.add(coord_type(v1.x + dx1 + (dy1 * miter_limit), + v1.y - dy1 + (dx1 * miter_limit))); + out_vertices.add(coord_type(v1.x + dx2 - (dy2 * miter_limit), + v1.y - dy2 - (dx2 * miter_limit))); break; } } @@ -156,8 +156,8 @@ void stroke_calc_cap(VertexConsumer& out_vertices, FX_FLOAT dy1 = FXSYS_Div(v1.x - v0.x, len); FX_FLOAT dx2 = 0; FX_FLOAT dy2 = 0; - dx1 = FXSYS_Mul(dx1, width); - dy1 = FXSYS_Mul(dy1, width); + dx1 = dx1 * width; + dy1 = dy1 * width; if(line_cap != round_cap) { if(line_cap == square_cap) { dx2 = dy1; @@ -174,8 +174,8 @@ void stroke_calc_cap(VertexConsumer& out_vertices, a1 += da; a2 -= da / 4; while(a1 < a2) { - out_vertices.add(coord_type(v0.x + FXSYS_Mul(width, FXSYS_cos(a1)), - v0.y + FXSYS_Mul(width, FXSYS_sin(a1)))); + out_vertices.add(coord_type(v0.x + (width * FXSYS_cos(a1)), + v0.y + (width * FXSYS_sin(a1)))); a1 += da; } out_vertices.add(coord_type(v0.x + dx1, v0.y - dy1)); |