summaryrefslogtreecommitdiff
path: root/third_party/agg23/agg_math.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-14 14:43:42 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 19:05:58 +0000
commit05df075154a832fcb476e1dfcfb865722d0ea898 (patch)
treeb8b771b62adae74d5d5ee561db75d10de3a848bf /third_party/agg23/agg_math.h
parent6b94f01d1c8ad386d497428c7397b1a99614aeba (diff)
downloadpdfium-05df075154a832fcb476e1dfcfb865722d0ea898.tar.xz
Replace FX_FLOAT with underlying float type.
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56 Reviewed-on: https://pdfium-review.googlesource.com/3031 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'third_party/agg23/agg_math.h')
-rw-r--r--third_party/agg23/agg_math.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/third_party/agg23/agg_math.h b/third_party/agg23/agg_math.h
index e003297dff..6c03bab929 100644
--- a/third_party/agg23/agg_math.h
+++ b/third_party/agg23/agg_math.h
@@ -21,37 +21,37 @@
#include "agg_basics.h"
namespace agg
{
-const FX_FLOAT intersection_epsilon = 1.0e-30f;
-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)
+const float intersection_epsilon = 1.0e-30f;
+AGG_INLINE float calc_point_location(float x1, float y1,
+ float x2, float y2,
+ float x, float y)
{
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)
+AGG_INLINE float calc_distance(float x1, float y1, float x2, float y2)
{
- FX_FLOAT dx = x2 - x1;
- FX_FLOAT dy = y2 - y1;
+ float dx = x2 - x1;
+ float dy = y2 - y1;
return FXSYS_sqrt2(dx, dy);
}
-AGG_INLINE FX_FLOAT calc_line_point_distance(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x, FX_FLOAT y)
+AGG_INLINE float calc_line_point_distance(float x1, float y1,
+ float x2, float y2,
+ float x, float y)
{
- FX_FLOAT dx = x2 - x1;
- FX_FLOAT dy = y2 - y1;
- FX_FLOAT d = FXSYS_sqrt2(dx, dy);
+ float dx = x2 - x1;
+ float dy = y2 - y1;
+ float d = FXSYS_sqrt2(dx, dy);
if(d < intersection_epsilon) {
return calc_distance(x1, y1, x, y);
}
return ((x - x2) * dy / d) - ((y - y2) * dx / d);
}
-AGG_INLINE bool calc_intersection(FX_FLOAT ax, FX_FLOAT ay, FX_FLOAT bx, FX_FLOAT by,
- FX_FLOAT cx, FX_FLOAT cy, FX_FLOAT dx, FX_FLOAT dy,
- FX_FLOAT* x, FX_FLOAT* y)
+AGG_INLINE bool calc_intersection(float ax, float ay, float bx, float by,
+ float cx, float cy, float dx, float dy,
+ float* x, float* y)
{
- FX_FLOAT num = ((ay - cy) * (dx - cx)) - ((ax - cx) * (dy - cy));
- FX_FLOAT den = ((bx - ax) * (dy - cy)) - ((by - ay) * (dx - cx));
+ 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;
}