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

Unified Diff: third_party/agg23/agg_math_stroke.h

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_math.h ('k') | xfa/src/fxgraphics/src/fx_graphics.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/agg23/agg_math_stroke.h
diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_stroke.h
index 620d6753120b6da1e19a79ee47b5b573229e1c27..ff42b2291e30c0597225a84071c72792aa8bb655 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));
« no previous file with comments | « third_party/agg23/agg_math.h ('k') | xfa/src/fxgraphics/src/fx_graphics.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698