summaryrefslogtreecommitdiff
path: root/third_party/agg23
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
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')
-rw-r--r--third_party/agg23/0001-gcc-warning.patch2
-rw-r--r--third_party/agg23/0002-ubsan-error-fixes.patch14
-rw-r--r--third_party/agg23/agg_basics.h14
-rw-r--r--third_party/agg23/agg_clip_liang_barsky.h42
-rw-r--r--third_party/agg23/agg_conv_adaptor_vcgen.h12
-rw-r--r--third_party/agg23/agg_conv_dash.h6
-rw-r--r--third_party/agg23/agg_conv_stroke.h22
-rw-r--r--third_party/agg23/agg_curves.cpp58
-rw-r--r--third_party/agg23/agg_curves.h82
-rw-r--r--third_party/agg23/agg_math.h36
-rw-r--r--third_party/agg23/agg_math_stroke.h76
-rw-r--r--third_party/agg23/agg_path_storage.cpp18
-rw-r--r--third_party/agg23/agg_path_storage.h48
-rw-r--r--third_party/agg23/agg_rasterizer_scanline_aa.h14
-rw-r--r--third_party/agg23/agg_shorten_path.h8
-rw-r--r--third_party/agg23/agg_vcgen_dash.cpp12
-rw-r--r--third_party/agg23/agg_vcgen_dash.h24
-rw-r--r--third_party/agg23/agg_vcgen_stroke.cpp14
-rw-r--r--third_party/agg23/agg_vcgen_stroke.h30
-rw-r--r--third_party/agg23/agg_vertex_sequence.h12
20 files changed, 272 insertions, 272 deletions
diff --git a/third_party/agg23/0001-gcc-warning.patch b/third_party/agg23/0001-gcc-warning.patch
index 759696ef03..3bdce6578e 100644
--- a/third_party/agg23/0001-gcc-warning.patch
+++ b/third_party/agg23/0001-gcc-warning.patch
@@ -4,7 +4,7 @@ index dc13851..7f21bac 100644
+++ b/third_party/agg23/agg_path_storage.h
@@ -38,9 +38,9 @@ public:
}
- unsigned vertex(FX_FLOAT* x, FX_FLOAT* y)
+ unsigned vertex(float* x, float* y)
{
- return (m_vertex_idx < m_path->total_vertices()) ?
- m_path->vertex(m_vertex_idx++, x, y) :
diff --git a/third_party/agg23/0002-ubsan-error-fixes.patch b/third_party/agg23/0002-ubsan-error-fixes.patch
index 00ced0071c..58b17dc19c 100644
--- a/third_party/agg23/0002-ubsan-error-fixes.patch
+++ b/third_party/agg23/0002-ubsan-error-fixes.patch
@@ -13,21 +13,21 @@ index db6ca97..5b1261f 100644
@@ -36,8 +37,18 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
T* x, T* y)
{
- const FX_FLOAT nearzero = 1e-30f;
-- FX_FLOAT deltax = (FX_FLOAT)(x2 - x1);
-- FX_FLOAT deltay = (FX_FLOAT)(y2 - y1);
+ const float nearzero = 1e-30f;
+- float deltax = (float)(x2 - x1);
+- float deltay = (float)(y2 - y1);
+
-+ pdfium::base::CheckedNumeric<FX_FLOAT> width = x2;
++ pdfium::base::CheckedNumeric<float> width = x2;
+ width -= x1;
+ if (!width.IsValid())
+ return 0;
-+ pdfium::base::CheckedNumeric<FX_FLOAT> height = y2;
++ pdfium::base::CheckedNumeric<float> height = y2;
+ height -= y1;
+ if (!height.IsValid())
+ return 0;
+
-+ FX_FLOAT deltax = width.ValueOrDefault(0);
-+ FX_FLOAT deltay = height.ValueOrDefault(0);
++ float deltax = width.ValueOrDefault(0);
++ float deltay = height.ValueOrDefault(0);
unsigned np = 0;
if(deltax == 0) {
deltax = (x1 > clip_box.x1) ? -nearzero : nearzero;
diff --git a/third_party/agg23/agg_basics.h b/third_party/agg23/agg_basics.h
index 52a658ec96..fc155561e0 100644
--- a/third_party/agg23/agg_basics.h
+++ b/third_party/agg23/agg_basics.h
@@ -41,7 +41,7 @@
#endif
#define AGG_INLINE inline
-#include "core/fxcrt/fx_system.h" // For FX_FLOAT
+#include "core/fxcrt/fx_system.h"
namespace agg
{
@@ -143,7 +143,7 @@ inline Rect unite_rectangles(const Rect& r1, const Rect& r2)
return r;
}
typedef rect_base<int> rect;
-typedef rect_base<FX_FLOAT> rect_d;
+typedef rect_base<float> rect_d;
enum path_commands_e {
path_cmd_stop = 0,
path_cmd_move_to = 1,
@@ -261,10 +261,10 @@ inline unsigned set_orientation(unsigned c, unsigned o)
return clear_orientation(c) | o;
}
struct point_type {
- FX_FLOAT x, y;
+ float x, y;
unsigned flag;
point_type() {}
- point_type(FX_FLOAT x_, FX_FLOAT y_, unsigned flag_ = 0) : x(x_), y(y_), flag(flag_) {}
+ point_type(float x_, float y_, unsigned flag_ = 0) : x(x_), y(y_), flag(flag_) {}
};
struct point_type_flag : public point_type {
unsigned flag;
@@ -272,13 +272,13 @@ struct point_type_flag : public point_type {
{
flag = 0;
}
- point_type_flag(FX_FLOAT x_, FX_FLOAT y_, unsigned flag_ = 0) : point_type(x_, y_), flag(flag_) {}
+ point_type_flag(float x_, float y_, unsigned flag_ = 0) : point_type(x_, y_), flag(flag_) {}
};
struct vertex_type {
- FX_FLOAT x, y;
+ float x, y;
unsigned cmd;
vertex_type() {}
- vertex_type(FX_FLOAT x_, FX_FLOAT y_, unsigned cmd_) :
+ vertex_type(float x_, float y_, unsigned cmd_) :
x(x_), y(y_), cmd(cmd_) {}
};
}
diff --git a/third_party/agg23/agg_clip_liang_barsky.h b/third_party/agg23/agg_clip_liang_barsky.h
index 5b1261f004..31b35fe96e 100644
--- a/third_party/agg23/agg_clip_liang_barsky.h
+++ b/third_party/agg23/agg_clip_liang_barsky.h
@@ -36,45 +36,45 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
const rect_base<T>& clip_box,
T* x, T* y)
{
- const FX_FLOAT nearzero = 1e-30f;
+ const float nearzero = 1e-30f;
- pdfium::base::CheckedNumeric<FX_FLOAT> width = x2;
+ pdfium::base::CheckedNumeric<float> width = x2;
width -= x1;
if (!width.IsValid())
return 0;
- pdfium::base::CheckedNumeric<FX_FLOAT> height = y2;
+ pdfium::base::CheckedNumeric<float> height = y2;
height -= y1;
if (!height.IsValid())
return 0;
- FX_FLOAT deltax = width.ValueOrDefault(0);
- FX_FLOAT deltay = height.ValueOrDefault(0);
+ float deltax = width.ValueOrDefault(0);
+ float deltay = height.ValueOrDefault(0);
unsigned np = 0;
if(deltax == 0) {
deltax = (x1 > clip_box.x1) ? -nearzero : nearzero;
}
- FX_FLOAT xin, xout;
+ float xin, xout;
if(deltax > 0) {
- xin = (FX_FLOAT)clip_box.x1;
- xout = (FX_FLOAT)clip_box.x2;
+ xin = (float)clip_box.x1;
+ xout = (float)clip_box.x2;
} else {
- xin = (FX_FLOAT)clip_box.x2;
- xout = (FX_FLOAT)clip_box.x1;
+ xin = (float)clip_box.x2;
+ xout = (float)clip_box.x1;
}
- FX_FLOAT tinx = (xin - x1) / deltax;
+ float tinx = (xin - x1) / deltax;
if(deltay == 0) {
deltay = (y1 > clip_box.y1) ? -nearzero : nearzero;
}
- FX_FLOAT yin, yout;
+ float yin, yout;
if(deltay > 0) {
- yin = (FX_FLOAT)clip_box.y1;
- yout = (FX_FLOAT)clip_box.y2;
+ yin = (float)clip_box.y1;
+ yout = (float)clip_box.y2;
} else {
- yin = (FX_FLOAT)clip_box.y2;
- yout = (FX_FLOAT)clip_box.y1;
+ yin = (float)clip_box.y2;
+ yout = (float)clip_box.y1;
}
- FX_FLOAT tiny = (yin - y1) / deltay;
- FX_FLOAT tin1, tin2;
+ float tiny = (yin - y1) / deltay;
+ float tin1, tin2;
if (tinx < tiny) {
tin1 = tinx;
tin2 = tiny;
@@ -89,9 +89,9 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
++np;
}
if(tin2 <= 1.0f) {
- FX_FLOAT toutx = (xout - x1) / deltax;
- FX_FLOAT touty = (yout - y1) / deltay;
- FX_FLOAT tout1 = (toutx < touty) ? toutx : touty;
+ float toutx = (xout - x1) / deltax;
+ float touty = (yout - y1) / deltay;
+ float tout1 = (toutx < touty) ? toutx : touty;
if (tin2 > 0 || tout1 > 0) {
if(tin2 <= tout1) {
if(tin2 > 0) {
diff --git a/third_party/agg23/agg_conv_adaptor_vcgen.h b/third_party/agg23/agg_conv_adaptor_vcgen.h
index 0d8d6ff99e..be4dc2d609 100644
--- a/third_party/agg23/agg_conv_adaptor_vcgen.h
+++ b/third_party/agg23/agg_conv_adaptor_vcgen.h
@@ -20,10 +20,10 @@ namespace agg
{
struct null_markers {
void remove_all() {}
- void add_vertex(FX_FLOAT, FX_FLOAT, unsigned) {}
+ void add_vertex(float, float, unsigned) {}
void prepare_src() {}
void rewind(unsigned) {}
- unsigned vertex(FX_FLOAT*, FX_FLOAT*)
+ unsigned vertex(float*, float*)
{
return path_cmd_stop;
}
@@ -67,7 +67,7 @@ public:
m_source->rewind(path_id);
m_status = initial;
}
- unsigned vertex(FX_FLOAT* x, FX_FLOAT* y);
+ unsigned vertex(float* x, float* y);
private:
conv_adaptor_vcgen(const conv_adaptor_vcgen<VertexSource, Generator, Markers>&);
const conv_adaptor_vcgen<VertexSource, Generator, Markers>&
@@ -77,11 +77,11 @@ private:
Markers m_markers;
status m_status;
unsigned m_last_cmd;
- FX_FLOAT m_start_x;
- FX_FLOAT m_start_y;
+ float m_start_x;
+ float m_start_y;
};
template<class VertexSource, class Generator, class Markers>
-unsigned conv_adaptor_vcgen<VertexSource, Generator, Markers>::vertex(FX_FLOAT* x, FX_FLOAT* y)
+unsigned conv_adaptor_vcgen<VertexSource, Generator, Markers>::vertex(float* x, float* y)
{
unsigned cmd = path_cmd_stop;
bool done = false;
diff --git a/third_party/agg23/agg_conv_dash.h b/third_party/agg23/agg_conv_dash.h
index 63b2019dde..f87eccc3b1 100644
--- a/third_party/agg23/agg_conv_dash.h
+++ b/third_party/agg23/agg_conv_dash.h
@@ -36,15 +36,15 @@ struct conv_dash : public conv_adaptor_vcgen<VertexSource, vcgen_dash, Markers>
{
base_type::generator().remove_all_dashes();
}
- void add_dash(FX_FLOAT dash_len, FX_FLOAT gap_len)
+ void add_dash(float dash_len, float gap_len)
{
base_type::generator().add_dash(dash_len, gap_len);
}
- void dash_start(FX_FLOAT ds)
+ void dash_start(float ds)
{
base_type::generator().dash_start(ds);
}
- void shorten(FX_FLOAT s)
+ void shorten(float s)
{
base_type::generator().shorten(s);
}
diff --git a/third_party/agg23/agg_conv_stroke.h b/third_party/agg23/agg_conv_stroke.h
index 5a36bd73bb..82268ddec6 100644
--- a/third_party/agg23/agg_conv_stroke.h
+++ b/third_party/agg23/agg_conv_stroke.h
@@ -57,47 +57,47 @@ struct conv_stroke :
{
return base_type::generator().inner_join();
}
- void width(FX_FLOAT w)
+ void width(float w)
{
base_type::generator().width(w);
}
- void miter_limit(FX_FLOAT ml)
+ void miter_limit(float ml)
{
base_type::generator().miter_limit(ml);
}
- void miter_limit_theta(FX_FLOAT t)
+ void miter_limit_theta(float t)
{
base_type::generator().miter_limit_theta(t);
}
- void inner_miter_limit(FX_FLOAT ml)
+ void inner_miter_limit(float ml)
{
base_type::generator().inner_miter_limit(ml);
}
- void approximation_scale(FX_FLOAT as)
+ void approximation_scale(float as)
{
base_type::generator().approximation_scale(as);
}
- FX_FLOAT width() const
+ float width() const
{
return base_type::generator().width();
}
- FX_FLOAT miter_limit() const
+ float miter_limit() const
{
return base_type::generator().miter_limit();
}
- FX_FLOAT inner_miter_limit() const
+ float inner_miter_limit() const
{
return base_type::generator().inner_miter_limit();
}
- FX_FLOAT approximation_scale() const
+ float approximation_scale() const
{
return base_type::generator().approximation_scale();
}
- void shorten(FX_FLOAT s)
+ void shorten(float s)
{
base_type::generator().shorten(s);
}
- FX_FLOAT shorten() const
+ float shorten() const
{
return base_type::generator().shorten();
}
diff --git a/third_party/agg23/agg_curves.cpp b/third_party/agg23/agg_curves.cpp
index b86cf630c3..4bfe457817 100644
--- a/third_party/agg23/agg_curves.cpp
+++ b/third_party/agg23/agg_curves.cpp
@@ -25,12 +25,12 @@
namespace agg
{
-const FX_FLOAT curve_collinearity_epsilon = 1e-30f;
+const float curve_collinearity_epsilon = 1e-30f;
enum curve_recursion_limit_e { curve_recursion_limit = 16 };
-void curve4_div::init(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4)
+void curve4_div::init(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4)
{
m_points.remove_all();
m_distance_tolerance_square = 1.0f / 4;
@@ -38,31 +38,31 @@ void curve4_div::init(FX_FLOAT x1, FX_FLOAT y1,
bezier(x1, y1, x2, y2, x3, y3, x4, y4);
m_count = 0;
}
-void curve4_div::recursive_bezier(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4,
+void curve4_div::recursive_bezier(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4,
unsigned level)
{
if(level > curve_recursion_limit) {
return;
}
- FX_FLOAT x12 = (x1 + x2) / 2;
- FX_FLOAT y12 = (y1 + y2) / 2;
- FX_FLOAT x23 = (x2 + x3) / 2;
- FX_FLOAT y23 = (y2 + y3) / 2;
- FX_FLOAT x34 = (x3 + x4) / 2;
- FX_FLOAT y34 = (y3 + y4) / 2;
- FX_FLOAT x123 = (x12 + x23) / 2;
- FX_FLOAT y123 = (y12 + y23) / 2;
- FX_FLOAT x234 = (x23 + x34) / 2;
- FX_FLOAT y234 = (y23 + y34) / 2;
- FX_FLOAT x1234 = (x123 + x234) / 2;
- FX_FLOAT y1234 = (y123 + y234) / 2;
- FX_FLOAT dx = x4 - x1;
- FX_FLOAT dy = y4 - y1;
- FX_FLOAT d2 = FXSYS_fabs(((x2 - x4) * dy) - ((y2 - y4) * dx));
- FX_FLOAT d3 = FXSYS_fabs(((x3 - x4) * dy) - ((y3 - y4) * dx));
+ float x12 = (x1 + x2) / 2;
+ float y12 = (y1 + y2) / 2;
+ float x23 = (x2 + x3) / 2;
+ float y23 = (y2 + y3) / 2;
+ float x34 = (x3 + x4) / 2;
+ float y34 = (y3 + y4) / 2;
+ float x123 = (x12 + x23) / 2;
+ float y123 = (y12 + y23) / 2;
+ float x234 = (x23 + x34) / 2;
+ float y234 = (y23 + y34) / 2;
+ float x1234 = (x123 + x234) / 2;
+ 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));
switch((int(d2 > curve_collinearity_epsilon) << 1) +
int(d3 > curve_collinearity_epsilon)) {
case 0:
@@ -99,10 +99,10 @@ void curve4_div::recursive_bezier(FX_FLOAT x1, FX_FLOAT y1,
recursive_bezier(x1, y1, x12, y12, x123, y123, x1234, y1234, level + 1);
recursive_bezier(x1234, y1234, x234, y234, x34, y34, x4, y4, level + 1);
}
-void curve4_div::bezier(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4)
+void curve4_div::bezier(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4)
{
m_points.add(point_type(x1, y1));
recursive_bezier(x1, y1, x2, y2, x3, y3, x4, y4, 0);
diff --git a/third_party/agg23/agg_curves.h b/third_party/agg23/agg_curves.h
index 495f7a6a8f..488db4a1ff 100644
--- a/third_party/agg23/agg_curves.h
+++ b/third_party/agg23/agg_curves.h
@@ -20,12 +20,12 @@
namespace agg
{
struct curve4_points {
- FX_FLOAT cp[8];
+ float cp[8];
curve4_points() {}
- curve4_points(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4)
+ curve4_points(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4)
{
cp[0] = x1;
cp[1] = y1;
@@ -36,10 +36,10 @@ struct curve4_points {
cp[6] = x4;
cp[7] = y4;
}
- void init(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4)
+ void init(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4)
{
cp[0] = x1;
cp[1] = y1;
@@ -50,11 +50,11 @@ struct curve4_points {
cp[6] = x4;
cp[7] = y4;
}
- FX_FLOAT operator [] (unsigned i) const
+ float operator [] (unsigned i) const
{
return cp[i];
}
- FX_FLOAT& operator [] (unsigned i)
+ float& operator [] (unsigned i)
{
return cp[i];
}
@@ -65,10 +65,10 @@ public:
curve4_div() :
m_count(0)
{}
- curve4_div(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4) :
+ curve4_div(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4) :
m_count(0)
{
init(x1, y1, x2, y2, x3, y3, x4, y4);
@@ -83,10 +83,10 @@ public:
m_points.remove_all();
m_count = 0;
}
- void init(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4);
+ void init(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4);
void init(const curve4_points& cp)
{
init(cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7]);
@@ -95,7 +95,7 @@ public:
{
m_count = 0;
}
- unsigned vertex(FX_FLOAT* x, FX_FLOAT* y)
+ unsigned vertex(float* x, float* y)
{
if(m_count >= m_points.size()) {
return path_cmd_stop;
@@ -105,7 +105,7 @@ public:
*y = p.y;
return (m_count == 1) ? path_cmd_move_to : path_cmd_line_to;
}
- unsigned vertex_flag(FX_FLOAT* x, FX_FLOAT* y, int& flag)
+ unsigned vertex_flag(float* x, float* y, int& flag)
{
if(m_count >= m_points.size()) {
return path_cmd_stop;
@@ -121,17 +121,17 @@ public:
return m_points.size();
}
private:
- void bezier(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4);
- void recursive_bezier(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4,
+ void bezier(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4);
+ void recursive_bezier(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4,
unsigned level);
- FX_FLOAT m_distance_tolerance_square;
- FX_FLOAT m_distance_tolerance_manhattan;
+ float m_distance_tolerance_square;
+ float m_distance_tolerance_manhattan;
unsigned m_count;
pod_deque<point_type> m_points;
};
@@ -139,10 +139,10 @@ class curve4
{
public:
curve4() {}
- curve4(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4)
+ curve4(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4)
{
init(x1, y1, x2, y2, x3, y3, x4, y4);
}
@@ -154,10 +154,10 @@ public:
{
m_curve_div.reset();
}
- void init(FX_FLOAT x1, FX_FLOAT y1,
- FX_FLOAT x2, FX_FLOAT y2,
- FX_FLOAT x3, FX_FLOAT y3,
- FX_FLOAT x4, FX_FLOAT y4)
+ void init(float x1, float y1,
+ float x2, float y2,
+ float x3, float y3,
+ float x4, float y4)
{
m_curve_div.init(x1, y1, x2, y2, x3, y3, x4, y4);
}
@@ -169,11 +169,11 @@ public:
{
m_curve_div.rewind(path_id);
}
- unsigned vertex(FX_FLOAT* x, FX_FLOAT* y)
+ unsigned vertex(float* x, float* y)
{
return m_curve_div.vertex(x, y);
}
- unsigned vertex_curve_flag(FX_FLOAT* x, FX_FLOAT* y, int& flag)
+ unsigned vertex_curve_flag(float* x, float* y, int& flag)
{
return m_curve_div.vertex_flag(x, y, flag);
}
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;
}
diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_stroke.h
index 2b06b1bfda..90c1153cc5 100644
--- a/third_party/agg23/agg_math_stroke.h
+++ b/third_party/agg23/agg_math_stroke.h
@@ -41,19 +41,19 @@ enum inner_join_e {
inner_jag,
inner_round
};
-const FX_FLOAT stroke_theta = 1.0f / 1000.0f;
+const float stroke_theta = 1.0f / 1000.0f;
template<class VertexConsumer>
void stroke_calc_arc(VertexConsumer& out_vertices,
- FX_FLOAT x, FX_FLOAT y,
- FX_FLOAT dx1, FX_FLOAT dy1,
- FX_FLOAT dx2, FX_FLOAT dy2,
- FX_FLOAT width,
- FX_FLOAT approximation_scale)
+ float x, float y,
+ float dx1, float dy1,
+ float dx2, float dy2,
+ float width,
+ float approximation_scale)
{
typedef typename VertexConsumer::value_type coord_type;
- FX_FLOAT a1 = FXSYS_atan2(dy1, dx1);
- FX_FLOAT a2 = FXSYS_atan2(dy2, dx2);
- FX_FLOAT da = a1 - a2;
+ float a1 = FXSYS_atan2(dy1, dx1);
+ float a2 = FXSYS_atan2(dy2, dx2);
+ float da = a1 - a2;
bool ccw = da > 0 && da < FX_PI;
if(width < 0) {
width = -width;
@@ -92,31 +92,31 @@ void stroke_calc_miter(VertexConsumer& out_vertices,
const vertex_dist& v0,
const vertex_dist& v1,
const vertex_dist& v2,
- FX_FLOAT dx1, FX_FLOAT dy1,
- FX_FLOAT dx2, FX_FLOAT dy2,
- FX_FLOAT width,
+ float dx1, float dy1,
+ float dx2, float dy2,
+ float width,
line_join_e line_join,
- FX_FLOAT miter_limit,
- FX_FLOAT approximation_scale)
+ float miter_limit,
+ float approximation_scale)
{
typedef typename VertexConsumer::value_type coord_type;
- FX_FLOAT xi = v1.x;
- FX_FLOAT yi = v1.y;
+ float xi = v1.x;
+ float yi = v1.y;
bool miter_limit_exceeded = true;
if(calc_intersection(v0.x + dx1, v0.y - dy1,
v1.x + dx1, v1.y - dy1,
v1.x + dx2, v1.y - dy2,
v2.x + dx2, v2.y - dy2,
&xi, &yi)) {
- FX_FLOAT d1 = calc_distance(v1.x, v1.y, xi, yi);
- FX_FLOAT lim = width * miter_limit;
+ float d1 = calc_distance(v1.x, v1.y, xi, yi);
+ float lim = width * miter_limit;
if(d1 <= lim) {
out_vertices.add(coord_type(xi, yi));
miter_limit_exceeded = false;
}
} else {
- FX_FLOAT x2 = v1.x + dx1;
- FX_FLOAT y2 = v1.y - dy1;
+ float x2 = v1.x + dx1;
+ float y2 = v1.y - dy1;
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));
@@ -147,17 +147,17 @@ template<class VertexConsumer>
void stroke_calc_cap(VertexConsumer& out_vertices,
const vertex_dist& v0,
const vertex_dist& v1,
- FX_FLOAT len,
+ float len,
line_cap_e line_cap,
- FX_FLOAT width,
- FX_FLOAT approximation_scale)
+ float width,
+ float approximation_scale)
{
typedef typename VertexConsumer::value_type coord_type;
out_vertices.remove_all();
- FX_FLOAT dx1 = (v1.y - v0.y) / len;
- FX_FLOAT dy1 = (v1.x - v0.x) / len;
- FX_FLOAT dx2 = 0;
- FX_FLOAT dy2 = 0;
+ float dx1 = (v1.y - v0.y) / len;
+ float dy1 = (v1.x - v0.x) / len;
+ float dx2 = 0;
+ float dy2 = 0;
dx1 = dx1 * width;
dy1 = dy1 * width;
if(line_cap != round_cap) {
@@ -168,9 +168,9 @@ 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 {
- FX_FLOAT a1 = FXSYS_atan2(dy1, -dx1);
- FX_FLOAT a2 = a1 + FX_PI;
- FX_FLOAT da =
+ 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));
@@ -189,17 +189,17 @@ void stroke_calc_join(VertexConsumer& out_vertices,
const vertex_dist& v0,
const vertex_dist& v1,
const vertex_dist& v2,
- FX_FLOAT len1,
- FX_FLOAT len2,
- FX_FLOAT width,
+ float len1,
+ float len2,
+ float width,
line_join_e line_join,
inner_join_e inner_join,
- FX_FLOAT miter_limit,
- FX_FLOAT inner_miter_limit,
- FX_FLOAT approximation_scale)
+ float miter_limit,
+ float inner_miter_limit,
+ float approximation_scale)
{
typedef typename VertexConsumer::value_type coord_type;
- FX_FLOAT dx1, dy1, dx2, dy2;
+ float dx1, dy1, dx2, dy2;
dx1 = width * (v1.y - v0.y) / len1;
dy1 = width * (v1.x - v0.x) / len1;
dx2 = width * (v2.y - v1.y) / len2;
@@ -221,7 +221,7 @@ void stroke_calc_join(VertexConsumer& out_vertices,
break;
case inner_jag:
case inner_round: {
- FX_FLOAT d = (dx1 - dx2) * (dx1 - dx2) + (dy1 - dy2) * (dy1 - dy2);
+ float d = (dx1 - dx2) * (dx1 - dx2) + (dy1 - dy2) * (dy1 - dy2);
if(d < len1 * len1 && d < len2 * len2) {
stroke_calc_miter(out_vertices,
v0, v1, v2, dx1, dy1, dx2, dy2,
diff --git a/third_party/agg23/agg_path_storage.cpp b/third_party/agg23/agg_path_storage.cpp
index 968746738a..747777d28e 100644
--- a/third_party/agg23/agg_path_storage.cpp
+++ b/third_party/agg23/agg_path_storage.cpp
@@ -32,7 +32,7 @@ namespace agg
path_storage::~path_storage()
{
if(m_total_blocks) {
- FX_FLOAT** coord_blk = m_coord_blocks + m_total_blocks - 1;
+ float** coord_blk = m_coord_blocks + m_total_blocks - 1;
while(m_total_blocks--) {
FX_Free(*coord_blk);
--coord_blk;
@@ -52,14 +52,14 @@ path_storage::path_storage() :
void path_storage::allocate_block(unsigned nb)
{
if(nb >= m_max_blocks) {
- FX_FLOAT** new_coords =
- FX_Alloc2D(FX_FLOAT*, m_max_blocks + block_pool, 2);
+ float** new_coords =
+ FX_Alloc2D(float*, m_max_blocks + block_pool, 2);
unsigned char** new_cmds =
(unsigned char**)(new_coords + m_max_blocks + block_pool);
if(m_coord_blocks) {
FXSYS_memcpy(new_coords,
m_coord_blocks,
- m_max_blocks * sizeof(FX_FLOAT*));
+ m_max_blocks * sizeof(float*));
FXSYS_memcpy(new_cmds,
m_cmd_blocks,
m_max_blocks * sizeof(unsigned char*));
@@ -70,9 +70,9 @@ void path_storage::allocate_block(unsigned nb)
m_max_blocks += block_pool;
}
m_coord_blocks[nb] =
- FX_Alloc( FX_FLOAT, block_size * 2 +
+ FX_Alloc( float, block_size * 2 +
block_size /
- (sizeof(FX_FLOAT) / sizeof(unsigned char)));
+ (sizeof(float) / sizeof(unsigned char)));
m_cmd_blocks[nb] =
(unsigned char*)(m_coord_blocks[nb] + block_size * 2);
m_total_blocks++;
@@ -81,9 +81,9 @@ void path_storage::rewind(unsigned path_id)
{
m_iterator = path_id;
}
-void path_storage::curve4(FX_FLOAT x_ctrl1, FX_FLOAT y_ctrl1,
- FX_FLOAT x_ctrl2, FX_FLOAT y_ctrl2,
- FX_FLOAT x_to, FX_FLOAT y_to)
+void path_storage::curve4(float x_ctrl1, float y_ctrl1,
+ float x_ctrl2, float y_ctrl2,
+ float x_to, float y_to)
{
add_vertex(x_ctrl1, y_ctrl1, path_cmd_curve4);
add_vertex(x_ctrl2, y_ctrl2, path_cmd_curve4);
diff --git a/third_party/agg23/agg_path_storage.h b/third_party/agg23/agg_path_storage.h
index 7f21bacd09..17e82d73e4 100644
--- a/third_party/agg23/agg_path_storage.h
+++ b/third_party/agg23/agg_path_storage.h
@@ -36,7 +36,7 @@ public:
{
m_vertex_idx = path_id;
}
- unsigned vertex(FX_FLOAT* x, FX_FLOAT* y)
+ unsigned vertex(float* x, float* y)
{
return (m_vertex_idx < m_path->total_vertices())
? m_path->vertex(m_vertex_idx++, x, y)
@@ -48,19 +48,19 @@ public:
};
~path_storage();
path_storage();
- unsigned last_vertex(FX_FLOAT* x, FX_FLOAT* y) const;
- unsigned prev_vertex(FX_FLOAT* x, FX_FLOAT* y) const;
- void move_to(FX_FLOAT x, FX_FLOAT y);
- void line_to(FX_FLOAT x, FX_FLOAT y);
- void curve4(FX_FLOAT x_ctrl1, FX_FLOAT y_ctrl1,
- FX_FLOAT x_ctrl2, FX_FLOAT y_ctrl2,
- FX_FLOAT x_to, FX_FLOAT y_to);
+ unsigned last_vertex(float* x, float* y) const;
+ unsigned prev_vertex(float* x, float* y) const;
+ void move_to(float x, float y);
+ void line_to(float x, float y);
+ void curve4(float x_ctrl1, float y_ctrl1,
+ float x_ctrl2, float y_ctrl2,
+ float x_to, float y_to);
template<class VertexSource>
void add_path(VertexSource& vs,
unsigned path_id = 0,
bool solid_path = true)
{
- FX_FLOAT x, y;
+ float x, y;
unsigned cmd;
vs.rewind(path_id);
while(!is_stop(cmd = vs.vertex(&x, &y))) {
@@ -75,7 +75,7 @@ public:
unsigned path_id = 0,
bool solid_path = true)
{
- FX_FLOAT x, y;
+ float x, y;
unsigned cmd;
int flag;
vs.rewind(path_id);
@@ -90,10 +90,10 @@ public:
{
return m_total_vertices;
}
- unsigned vertex(unsigned idx, FX_FLOAT* x, FX_FLOAT* y) const
+ unsigned vertex(unsigned idx, float* x, float* y) const
{
unsigned nb = idx >> block_shift;
- const FX_FLOAT* pv = m_coord_blocks[nb] + ((idx & block_mask) << 1);
+ const float* pv = m_coord_blocks[nb] + ((idx & block_mask) << 1);
*x = *pv++;
*y = *pv;
return m_cmd_blocks[nb][idx & block_mask];
@@ -107,42 +107,42 @@ public:
return m_cmd_blocks[idx >> block_shift][idx & block_mask] & path_flags_jr;
}
void rewind(unsigned path_id);
- unsigned vertex(FX_FLOAT* x, FX_FLOAT* y);
- void add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd);
+ unsigned vertex(float* x, float* y);
+ void add_vertex(float x, float y, unsigned cmd);
void end_poly();
private:
void allocate_block(unsigned nb);
- unsigned char* storage_ptrs(FX_FLOAT** xy_ptr);
+ unsigned char* storage_ptrs(float** xy_ptr);
private:
unsigned m_total_vertices;
unsigned m_total_blocks;
unsigned m_max_blocks;
- FX_FLOAT** m_coord_blocks;
+ float** m_coord_blocks;
unsigned char** m_cmd_blocks;
unsigned m_iterator;
};
-inline unsigned path_storage::vertex(FX_FLOAT* x, FX_FLOAT* y)
+inline unsigned path_storage::vertex(float* x, float* y)
{
if(m_iterator >= m_total_vertices) {
return path_cmd_stop;
}
return vertex(m_iterator++, x, y);
}
-inline unsigned path_storage::prev_vertex(FX_FLOAT* x, FX_FLOAT* y) const
+inline unsigned path_storage::prev_vertex(float* x, float* y) const
{
if(m_total_vertices > 1) {
return vertex(m_total_vertices - 2, x, y);
}
return path_cmd_stop;
}
-inline unsigned path_storage::last_vertex(FX_FLOAT* x, FX_FLOAT* y) const
+inline unsigned path_storage::last_vertex(float* x, float* y) const
{
if(m_total_vertices) {
return vertex(m_total_vertices - 1, x, y);
}
return path_cmd_stop;
}
-inline unsigned char* path_storage::storage_ptrs(FX_FLOAT** xy_ptr)
+inline unsigned char* path_storage::storage_ptrs(float** xy_ptr)
{
unsigned nb = m_total_vertices >> block_shift;
if(nb >= m_total_blocks) {
@@ -151,20 +151,20 @@ inline unsigned char* path_storage::storage_ptrs(FX_FLOAT** xy_ptr)
*xy_ptr = m_coord_blocks[nb] + ((m_total_vertices & block_mask) << 1);
return m_cmd_blocks[nb] + (m_total_vertices & block_mask);
}
-inline void path_storage::add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd)
+inline void path_storage::add_vertex(float x, float y, unsigned cmd)
{
- FX_FLOAT* coord_ptr = 0;
+ float* coord_ptr = 0;
unsigned char* cmd_ptr = storage_ptrs(&coord_ptr);
*cmd_ptr = (unsigned char)cmd;
*coord_ptr++ = x;
*coord_ptr = y;
m_total_vertices++;
}
-inline void path_storage::move_to(FX_FLOAT x, FX_FLOAT y)
+inline void path_storage::move_to(float x, float y)
{
add_vertex(x, y, path_cmd_move_to);
}
-inline void path_storage::line_to(FX_FLOAT x, FX_FLOAT y)
+inline void path_storage::line_to(float x, float y)
{
add_vertex(x, y, path_cmd_line_to);
}
diff --git a/third_party/agg23/agg_rasterizer_scanline_aa.h b/third_party/agg23/agg_rasterizer_scanline_aa.h
index fc28290f54..c747ee379e 100644
--- a/third_party/agg23/agg_rasterizer_scanline_aa.h
+++ b/third_party/agg23/agg_rasterizer_scanline_aa.h
@@ -45,7 +45,7 @@ enum poly_base_scale_e {
poly_base_size = 1 << poly_base_shift,
poly_base_mask = poly_base_size - 1
};
-inline int poly_coord(FX_FLOAT c)
+inline int poly_coord(float c)
{
return int(c * poly_base_size);
}
@@ -219,14 +219,14 @@ public:
m_outline.reset();
m_status = status_initial;
}
- void clip_box(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2)
+ void clip_box(float x1, float y1, float x2, float y2)
{
m_clip_box = rect(poly_coord(x1), poly_coord(y1),
poly_coord(x2), poly_coord(y2));
m_clip_box.normalize();
m_clipping = true;
}
- void add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd)
+ void add_vertex(float x, float y, unsigned cmd)
{
if(is_close(cmd)) {
close_polygon();
@@ -374,8 +374,8 @@ public:
template<class VertexSource>
void add_path(VertexSource& vs, unsigned path_id = 0)
{
- FX_FLOAT x;
- FX_FLOAT y;
+ float x;
+ float y;
unsigned cmd;
vs.rewind(path_id);
while(!is_stop(cmd = vs.vertex(&x, &y))) {
@@ -385,8 +385,8 @@ public:
template<class VertexSource>
void add_path_transformed(VertexSource& vs, const CFX_Matrix* pMatrix, unsigned path_id = 0)
{
- FX_FLOAT x;
- FX_FLOAT y;
+ float x;
+ float y;
unsigned cmd;
vs.rewind(path_id);
while(!is_stop(cmd = vs.vertex(&x, &y))) {
diff --git a/third_party/agg23/agg_shorten_path.h b/third_party/agg23/agg_shorten_path.h
index d7eb4be018..2f62ec52d2 100644
--- a/third_party/agg23/agg_shorten_path.h
+++ b/third_party/agg23/agg_shorten_path.h
@@ -20,11 +20,11 @@
namespace agg
{
template<class VertexSequence>
-void shorten_path(VertexSequence& vs, FX_FLOAT s, unsigned closed = 0)
+void shorten_path(VertexSequence& vs, float s, unsigned closed = 0)
{
typedef typename VertexSequence::value_type vertex_type;
if(s > 0 && vs.size() > 1) {
- FX_FLOAT d;
+ float d;
int n = int(vs.size() - 2);
while(n) {
d = vs[n].dist;
@@ -42,8 +42,8 @@ void shorten_path(VertexSequence& vs, FX_FLOAT s, unsigned closed = 0)
vertex_type& prev = vs[n - 1];
vertex_type& last = vs[n];
d = (prev.dist - s) / prev.dist;
- FX_FLOAT x = prev.x + (last.x - prev.x) * d;
- FX_FLOAT y = prev.y + (last.y - prev.y) * d;
+ float x = prev.x + (last.x - prev.x) * d;
+ float y = prev.y + (last.y - prev.y) * d;
last.x = x;
last.y = y;
if(!prev(last)) {
diff --git a/third_party/agg23/agg_vcgen_dash.cpp b/third_party/agg23/agg_vcgen_dash.cpp
index bd5a2122a2..cfeab0764e 100644
--- a/third_party/agg23/agg_vcgen_dash.cpp
+++ b/third_party/agg23/agg_vcgen_dash.cpp
@@ -44,7 +44,7 @@ void vcgen_dash::remove_all_dashes()
m_curr_dash_start = 0;
m_curr_dash = 0;
}
-void vcgen_dash::add_dash(FX_FLOAT dash_len, FX_FLOAT gap_len)
+void vcgen_dash::add_dash(float dash_len, float gap_len)
{
if(m_num_dashes < max_dashes) {
m_total_dash_len += dash_len + gap_len;
@@ -52,12 +52,12 @@ void vcgen_dash::add_dash(FX_FLOAT dash_len, FX_FLOAT gap_len)
m_dashes[m_num_dashes++] = gap_len;
}
}
-void vcgen_dash::dash_start(FX_FLOAT ds)
+void vcgen_dash::dash_start(float ds)
{
m_dash_start = ds;
calc_dash_start(FXSYS_fabs(ds));
}
-void vcgen_dash::calc_dash_start(FX_FLOAT ds)
+void vcgen_dash::calc_dash_start(float ds)
{
m_curr_dash = 0;
m_curr_dash_start = 0;
@@ -81,7 +81,7 @@ void vcgen_dash::remove_all()
m_src_vertices.remove_all();
m_closed = 0;
}
-void vcgen_dash::add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd)
+void vcgen_dash::add_vertex(float x, float y, unsigned cmd)
{
m_status = initial;
if(is_move_to(cmd)) {
@@ -103,7 +103,7 @@ void vcgen_dash::rewind(unsigned)
m_status = ready;
m_src_vertex = 0;
}
-unsigned vcgen_dash::vertex(FX_FLOAT* x, FX_FLOAT* y)
+unsigned vcgen_dash::vertex(float* x, float* y)
{
unsigned cmd = path_cmd_move_to;
while(!is_stop(cmd)) {
@@ -127,7 +127,7 @@ unsigned vcgen_dash::vertex(FX_FLOAT* x, FX_FLOAT* y)
}
return path_cmd_move_to;
case polyline: {
- FX_FLOAT dash_rest = m_dashes[m_curr_dash] - m_curr_dash_start;
+ float dash_rest = m_dashes[m_curr_dash] - m_curr_dash_start;
unsigned cmd = (m_curr_dash & 1) ?
path_cmd_move_to :
path_cmd_line_to;
diff --git a/third_party/agg23/agg_vcgen_dash.h b/third_party/agg23/agg_vcgen_dash.h
index 9c3aa630c2..7702fa7adc 100644
--- a/third_party/agg23/agg_vcgen_dash.h
+++ b/third_party/agg23/agg_vcgen_dash.h
@@ -38,9 +38,9 @@ public:
typedef vertex_sequence<vertex_dist, 6> vertex_storage;
vcgen_dash();
void remove_all_dashes();
- void add_dash(FX_FLOAT dash_len, FX_FLOAT gap_len);
- void dash_start(FX_FLOAT ds);
- void shorten(FX_FLOAT s)
+ void add_dash(float dash_len, float gap_len);
+ void dash_start(float ds);
+ void shorten(float s)
{
m_shorten = s;
}
@@ -49,21 +49,21 @@ public:
return m_shorten;
}
void remove_all();
- void add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd);
+ void add_vertex(float x, float y, unsigned cmd);
void rewind(unsigned path_id);
- unsigned vertex(FX_FLOAT* x, FX_FLOAT* y);
+ unsigned vertex(float* x, float* y);
private:
vcgen_dash(const vcgen_dash&);
const vcgen_dash& operator = (const vcgen_dash&);
- void calc_dash_start(FX_FLOAT ds);
- FX_FLOAT m_dashes[max_dashes];
- FX_FLOAT m_total_dash_len;
+ void calc_dash_start(float ds);
+ float m_dashes[max_dashes];
+ float m_total_dash_len;
unsigned m_num_dashes;
- FX_FLOAT m_dash_start;
- FX_FLOAT m_shorten;
- FX_FLOAT m_curr_dash_start;
+ float m_dash_start;
+ float m_shorten;
+ float m_curr_dash_start;
unsigned m_curr_dash;
- FX_FLOAT m_curr_rest;
+ float m_curr_rest;
const vertex_dist* m_v1;
const vertex_dist* m_v2;
vertex_storage m_src_vertices;
diff --git a/third_party/agg23/agg_vcgen_stroke.cpp b/third_party/agg23/agg_vcgen_stroke.cpp
index 03225b1649..a59abf0022 100644
--- a/third_party/agg23/agg_vcgen_stroke.cpp
+++ b/third_party/agg23/agg_vcgen_stroke.cpp
@@ -51,7 +51,7 @@ void vcgen_stroke::remove_all()
m_closed = 0;
m_status = initial;
}
-void vcgen_stroke::add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd)
+void vcgen_stroke::add_vertex(float x, float y, unsigned cmd)
{
m_status = initial;
if(is_move_to(cmd)) {
@@ -64,13 +64,13 @@ void vcgen_stroke::add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd)
}
}
}
-static inline void calc_butt_cap(FX_FLOAT* cap,
+static inline void calc_butt_cap(float* cap,
const vertex_dist& v0,
const vertex_dist& v1,
- FX_FLOAT len,
- FX_FLOAT width) {
- FX_FLOAT dx = (v1.y - v0.y) * width / len;
- FX_FLOAT dy = (v1.x - v0.x) * width / len;
+ float len,
+ float width) {
+ float dx = (v1.y - v0.y) * width / len;
+ float dy = (v1.x - v0.x) * width / len;
cap[0] = v0.x - dx;
cap[1] = v0.y + dy;
cap[2] = v0.x + dx;
@@ -88,7 +88,7 @@ void vcgen_stroke::rewind(unsigned)
m_src_vertex = 0;
m_out_vertex = 0;
}
-unsigned vcgen_stroke::vertex(FX_FLOAT* x, FX_FLOAT* y)
+unsigned vcgen_stroke::vertex(float* x, float* y)
{
unsigned cmd = path_cmd_line_to;
line_join_e curj;
diff --git a/third_party/agg23/agg_vcgen_stroke.h b/third_party/agg23/agg_vcgen_stroke.h
index 84fadd6ed8..23142d37f6 100644
--- a/third_party/agg23/agg_vcgen_stroke.h
+++ b/third_party/agg23/agg_vcgen_stroke.h
@@ -61,52 +61,52 @@ public:
{
return m_inner_join;
}
- void width(FX_FLOAT w)
+ void width(float w)
{
m_width = w / 2;
}
- void miter_limit(FX_FLOAT ml)
+ void miter_limit(float ml)
{
m_miter_limit = ml;
}
- void miter_limit_theta(FX_FLOAT t);
- void inner_miter_limit(FX_FLOAT ml)
+ void miter_limit_theta(float t);
+ void inner_miter_limit(float ml)
{
m_inner_miter_limit = ml;
}
- void approximation_scale(FX_FLOAT as)
+ void approximation_scale(float as)
{
m_approx_scale = as;
}
- FX_FLOAT width() const
+ float width() const
{
return m_width * 2;
}
- FX_FLOAT miter_limit() const
+ float miter_limit() const
{
return m_miter_limit;
}
- FX_FLOAT inner_miter_limit() const
+ float inner_miter_limit() const
{
return m_inner_miter_limit;
}
- FX_FLOAT approximation_scale() const
+ float approximation_scale() const
{
return m_approx_scale;
}
void remove_all();
- void add_vertex(FX_FLOAT x, FX_FLOAT y, unsigned cmd);
+ void add_vertex(float x, float y, unsigned cmd);
void rewind(unsigned path_id);
- unsigned vertex(FX_FLOAT* x, FX_FLOAT* y);
+ unsigned vertex(float* x, float* y);
private:
vcgen_stroke(const vcgen_stroke&);
const vcgen_stroke& operator = (const vcgen_stroke&);
vertex_storage m_src_vertices;
coord_storage m_out_vertices;
- FX_FLOAT m_width;
- FX_FLOAT m_miter_limit;
- FX_FLOAT m_inner_miter_limit;
- FX_FLOAT m_approx_scale;
+ float m_width;
+ float m_miter_limit;
+ float m_inner_miter_limit;
+ float m_approx_scale;
line_cap_e m_line_cap;
line_join_e m_line_join;
inner_join_e m_inner_join;
diff --git a/third_party/agg23/agg_vertex_sequence.h b/third_party/agg23/agg_vertex_sequence.h
index 6600bf2085..448e57b04d 100644
--- a/third_party/agg23/agg_vertex_sequence.h
+++ b/third_party/agg23/agg_vertex_sequence.h
@@ -69,13 +69,13 @@ void vertex_sequence<T, S>::close(bool closed)
}
}
}
-const FX_FLOAT vertex_dist_epsilon = 1e-14f;
+const float vertex_dist_epsilon = 1e-14f;
struct vertex_dist {
- FX_FLOAT x;
- FX_FLOAT y;
- FX_FLOAT dist;
+ float x;
+ float y;
+ float dist;
vertex_dist() {}
- vertex_dist(FX_FLOAT x_, FX_FLOAT y_) :
+ vertex_dist(float x_, float y_) :
x(x_),
y(y_),
dist(0)
@@ -90,7 +90,7 @@ struct vertex_dist {
struct vertex_dist_cmd : public vertex_dist {
unsigned cmd;
vertex_dist_cmd() {}
- vertex_dist_cmd(FX_FLOAT x_, FX_FLOAT y_, unsigned cmd_) :
+ vertex_dist_cmd(float x_, float y_, unsigned cmd_) :
vertex_dist(x_, y_),
cmd(cmd_)
{