@@ -59,7 +59,7 @@ class EmbeddedQueue
59
59
{
60
60
}
61
61
62
- inline void set (const unsigned cmd_, const double & x_, const double & y_)
62
+ inline void set (const unsigned cmd_, const double x_, const double y_)
63
63
{
64
64
cmd = cmd_;
65
65
x = x_;
@@ -73,7 +73,7 @@ class EmbeddedQueue
73
73
int m_queue_write;
74
74
item m_queue[QueueSize];
75
75
76
- inline void queue_push (const unsigned cmd, const double & x, const double & y)
76
+ inline void queue_push (const unsigned cmd, const double x, const double y)
77
77
{
78
78
m_queue[m_queue_write++].set (cmd, x, y);
79
79
}
@@ -107,6 +107,14 @@ class EmbeddedQueue
107
107
}
108
108
};
109
109
110
+ /* Defines when path segment types have more than one vertex */
111
+ static const size_t num_extra_points_map[] =
112
+ {0 , 0 , 0 , 1 ,
113
+ 2 , 0 , 0 , 0 ,
114
+ 0 , 0 , 0 , 0 ,
115
+ 0 , 0 , 0 , 0
116
+ };
117
+
110
118
/*
111
119
PathNanRemover is a vertex converter that removes non-finite values
112
120
from the vertices list, and inserts MOVETO commands as necessary to
@@ -119,7 +127,6 @@ class PathNanRemover : protected EmbeddedQueue<4>
119
127
VertexSource *m_source;
120
128
bool m_remove_nans;
121
129
bool m_has_curves;
122
- static const unsigned char num_extra_points_map[16 ];
123
130
124
131
public:
125
132
/* has_curves should be true if the path contains bezier curve
@@ -171,11 +178,12 @@ class PathNanRemover : protected EmbeddedQueue<4>
171
178
size_t num_extra_points = num_extra_points_map[code & 0xF ];
172
179
bool has_nan = (MPL_notisfinite64 (*x) || MPL_notisfinite64 (*y));
173
180
queue_push (code, *x, *y);
181
+
174
182
/* Note: this test can not be short-circuited, since we need to
175
183
advance through the entire curve no matter what */
176
184
for (size_t i = 0 ; i < num_extra_points; ++i) {
177
185
m_source->vertex (x, y);
178
- has_nan |= (MPL_notisfinite64 (*x) || MPL_notisfinite64 (*y));
186
+ has_nan = has_nan || (MPL_notisfinite64 (*x) || MPL_notisfinite64 (*y));
179
187
queue_push (code, *x, *y);
180
188
}
181
189
@@ -227,15 +235,6 @@ class PathNanRemover : protected EmbeddedQueue<4>
227
235
}
228
236
};
229
237
230
- /* Defines when path segment types have more than one vertex */
231
- template <class VertexSource >
232
- const unsigned char PathNanRemover<VertexSource>::num_extra_points_map[] =
233
- {0 , 0 , 0 , 1 ,
234
- 2 , 0 , 0 , 0 ,
235
- 0 , 0 , 0 , 0 ,
236
- 0 , 0 , 0 , 0
237
- };
238
-
239
238
/* ***********************************************************
240
239
PathClipper uses the Liang-Barsky line clipping algorithm (as
241
240
implemented in Agg) to clip the path to a given rectangle. Lines
0 commit comments