summaryrefslogtreecommitdiff
path: root/third_party/agg23
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-03 14:51:45 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-03 20:36:56 +0000
commit669a418f75c05d4a39e2bcaff2b7b93dec1c5764 (patch)
treeb76f5025c8e70b1ef449f317ff60a8eef7317ab9 /third_party/agg23
parentac978f83392e309488601eb382d5f318b6d366ad (diff)
downloadpdfium-669a418f75c05d4a39e2bcaff2b7b93dec1c5764.tar.xz
Drop FXSYS_ from math methods
This Cl drops the FXSYS_ from math methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I85c9ff841fd9095b1434f67319847ba0cd9df7ac Reviewed-on: https://pdfium-review.googlesource.com/3598 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'third_party/agg23')
-rw-r--r--third_party/agg23/0000-bug-466.patch10
-rw-r--r--third_party/agg23/agg_curves.cpp15
-rw-r--r--third_party/agg23/agg_math.h4
-rw-r--r--third_party/agg23/agg_math_stroke.h34
-rw-r--r--third_party/agg23/agg_vcgen_dash.cpp2
5 files changed, 31 insertions, 34 deletions
diff --git a/third_party/agg23/0000-bug-466.patch b/third_party/agg23/0000-bug-466.patch
index 3217b3838a..e761198a48 100644
--- a/third_party/agg23/0000-bug-466.patch
+++ b/third_party/agg23/0000-bug-466.patch
@@ -4,7 +4,7 @@ index 6d7ba8a..2b06b1b 100644
+++ b/third_party/agg23/agg_math_stroke.h
@@ -60,28 +60,30 @@ void stroke_calc_arc(VertexConsumer& out_vertices,
}
- da = FXSYS_acos(width / (width + ((1.0f / 8) / approximation_scale))) * 2;
+ da = acos(width / (width + ((1.0f / 8) / approximation_scale))) * 2;
out_vertices.add(coord_type(x + dx1, y + dy1));
- if(!ccw) {
- if(a1 > a2) {
@@ -18,8 +18,8 @@ index 6d7ba8a..2b06b1b 100644
a1 += da;
- while(a1 < a2) {
+ while (a1 < a2) {
- out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)),
- y + (width * FXSYS_sin(a1))));
+ out_vertices.add(coord_type(x + (width * cos(a1)),
+ y + (width * sin(a1))));
- a1 += da;
+ a1 += da;
}
@@ -34,8 +34,8 @@ index 6d7ba8a..2b06b1b 100644
a1 -= da;
- while(a1 > a2) {
+ while (a1 > a2) {
- out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)),
- y + (width * FXSYS_sin(a1))));
+ out_vertices.add(coord_type(x + (width * cos(a1)),
+ y + (width * sin(a1))));
- a1 -= da;
+ a1 -= da;
}
diff --git a/third_party/agg23/agg_curves.cpp b/third_party/agg23/agg_curves.cpp
index 4bfe457817..483da70128 100644
--- a/third_party/agg23/agg_curves.cpp
+++ b/third_party/agg23/agg_curves.cpp
@@ -61,17 +61,16 @@ void curve4_div::recursive_bezier(float x1, float y1,
float y1234 = (y123 + y234) / 2;
float dx = x4 - x1;
float dy = y4 - y1;
- float d2 = FXSYS_fabs(((x2 - x4) * dy) - ((y2 - y4) * dx));
- float d3 = FXSYS_fabs(((x3 - x4) * dy) - ((y3 - y4) * dx));
+ float d2 = fabs(((x2 - x4) * dy) - ((y2 - y4) * dx));
+ float d3 = fabs(((x3 - x4) * dy) - ((y3 - y4) * dx));
switch((int(d2 > curve_collinearity_epsilon) << 1) +
int(d3 > curve_collinearity_epsilon)) {
case 0:
- if(FXSYS_fabs(x1 + x3 - x2 - x2) +
- FXSYS_fabs(y1 + y3 - y2 - y2) +
- FXSYS_fabs(x2 + x4 - x3 - x3) +
- FXSYS_fabs(y2 + y4 - y3 - y3) <= m_distance_tolerance_manhattan) {
- m_points.add(point_type(x1234, y1234, path_flags_jr));
- return;
+ if (fabs(x1 + x3 - x2 - x2) + fabs(y1 + y3 - y2 - y2) +
+ fabs(x2 + x4 - x3 - x3) + fabs(y2 + y4 - y3 - y3) <=
+ m_distance_tolerance_manhattan) {
+ m_points.add(point_type(x1234, y1234, path_flags_jr));
+ return;
}
break;
case 1:
diff --git a/third_party/agg23/agg_math.h b/third_party/agg23/agg_math.h
index 6c03bab929..6d5e39ac3e 100644
--- a/third_party/agg23/agg_math.h
+++ b/third_party/agg23/agg_math.h
@@ -52,8 +52,8 @@ AGG_INLINE bool calc_intersection(float ax, float ay, float bx, float by,
{
float num = ((ay - cy) * (dx - cx)) - ((ax - cx) * (dy - cy));
float den = ((bx - ax) * (dy - cy)) - ((by - ay) * (dx - cx));
- if (FXSYS_fabs(den) < intersection_epsilon) {
- return false;
+ if (fabs(den) < intersection_epsilon) {
+ return false;
}
*x = ax + ((bx - ax) * num / den);
*y = ay + ((by - ay) * num / den);
diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_stroke.h
index 90c1153cc5..82df8080cf 100644
--- a/third_party/agg23/agg_math_stroke.h
+++ b/third_party/agg23/agg_math_stroke.h
@@ -51,14 +51,14 @@ void stroke_calc_arc(VertexConsumer& out_vertices,
float approximation_scale)
{
typedef typename VertexConsumer::value_type coord_type;
- float a1 = FXSYS_atan2(dy1, dx1);
- float a2 = FXSYS_atan2(dy2, dx2);
+ float a1 = atan2(dy1, dx1);
+ float a2 = atan2(dy2, dx2);
float da = a1 - a2;
bool ccw = da > 0 && da < FX_PI;
if(width < 0) {
width = -width;
}
- da = FXSYS_acos(width / (width + ((1.0f / 8) / approximation_scale))) * 2;
+ da = acos(width / (width + ((1.0f / 8) / approximation_scale))) * 2;
out_vertices.add(coord_type(x + dx1, y + dy1));
if (da > 0) {
if (!ccw) {
@@ -68,8 +68,8 @@ void stroke_calc_arc(VertexConsumer& out_vertices,
a2 -= da / 4;
a1 += da;
while (a1 < a2) {
- out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)),
- y + (width * FXSYS_sin(a1))));
+ out_vertices.add(
+ coord_type(x + (width * cos(a1)), y + (width * sin(a1))));
a1 += da;
}
} else {
@@ -79,8 +79,8 @@ void stroke_calc_arc(VertexConsumer& out_vertices,
a2 += da / 4;
a1 -= da;
while (a1 > a2) {
- out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)),
- y + (width * FXSYS_sin(a1))));
+ out_vertices.add(
+ coord_type(x + (width * cos(a1)), y + (width * sin(a1))));
a1 -= da;
}
}
@@ -168,18 +168,16 @@ void stroke_calc_cap(VertexConsumer& out_vertices,
out_vertices.add(coord_type(v0.x - dx1 - dx2, v0.y + dy1 - dy2));
out_vertices.add(coord_type(v0.x + dx1 - dx2, v0.y - dy1 - dy2));
} else {
- float a1 = FXSYS_atan2(dy1, -dx1);
- float a2 = a1 + FX_PI;
- float da =
- FXSYS_acos(width / (width + ((1.0f / 8) / approximation_scale))) *
- 2;
- out_vertices.add(coord_type(v0.x - dx1, v0.y + dy1));
+ float a1 = atan2(dy1, -dx1);
+ float a2 = a1 + FX_PI;
+ float da = 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;
+ while (a1 < a2) {
+ out_vertices.add(
+ coord_type(v0.x + (width * cos(a1)), v0.y + (width * sin(a1))));
a1 += da;
- a2 -= da / 4;
- while(a1 < a2) {
- 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));
}
diff --git a/third_party/agg23/agg_vcgen_dash.cpp b/third_party/agg23/agg_vcgen_dash.cpp
index cfeab0764e..74fd901181 100644
--- a/third_party/agg23/agg_vcgen_dash.cpp
+++ b/third_party/agg23/agg_vcgen_dash.cpp
@@ -55,7 +55,7 @@ void vcgen_dash::add_dash(float dash_len, float gap_len)
void vcgen_dash::dash_start(float ds)
{
m_dash_start = ds;
- calc_dash_start(FXSYS_fabs(ds));
+ calc_dash_start(fabs(ds));
}
void vcgen_dash::calc_dash_start(float ds)
{