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

Unified Diff: third_party/agg23/agg_math_stroke.h

Issue 1727793002: Remove FXSYS_Div. (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_stroke.h
diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_stroke.h
index ff42b2291e30c0597225a84071c72792aa8bb655..402028ba67c555a72a8bf5c50dba944d67e0c78a 100644
--- a/third_party/agg23/agg_math_stroke.h
+++ b/third_party/agg23/agg_math_stroke.h
@@ -58,7 +58,7 @@ void stroke_calc_arc(VertexConsumer& out_vertices,
if(width < 0) {
width = -width;
}
- da = FXSYS_acos(FXSYS_Div(width, width + FXSYS_Div(1.0f / 8, approximation_scale))) * 2;
+ da = FXSYS_acos(width / (width + ((1.0f / 8) / approximation_scale))) * 2;
out_vertices.add(coord_type(x + dx1, y + dy1));
if(!ccw) {
if(a1 > a2) {
@@ -152,8 +152,8 @@ void stroke_calc_cap(VertexConsumer& out_vertices,
{
typedef typename VertexConsumer::value_type coord_type;
out_vertices.remove_all();
- FX_FLOAT dx1 = FXSYS_Div(v1.y - v0.y, len);
- FX_FLOAT dy1 = FXSYS_Div(v1.x - v0.x, len);
+ FX_FLOAT dx1 = (v1.y - v0.y) / len;
+ FX_FLOAT dy1 = (v1.x - v0.x) / len;
FX_FLOAT dx2 = 0;
FX_FLOAT dy2 = 0;
dx1 = dx1 * width;
@@ -168,8 +168,9 @@ void stroke_calc_cap(VertexConsumer& out_vertices,
} else {
FX_FLOAT a1 = FXSYS_atan2(dy1, -dx1);
FX_FLOAT a2 = a1 + FX_PI;
- FX_FLOAT da = FXSYS_acos(FXSYS_Div(width, width +
- FXSYS_Div(1.0f / 8, approximation_scale))) * 2;
+ FX_FLOAT da =
+ FXSYS_acos(width / (width + ((1.0f / 8) / approximation_scale))) *
+ 2;
out_vertices.add(coord_type(v0.x - dx1, v0.y + dy1));
a1 += da;
a2 -= da / 4;

Powered by Google App Engine
This is Rietveld 408576698