172 pixelInfo[1] = X0; \
173 pixelInfo[2] = Y0; \
174 pixelInfo[3] = X0; \
175 pixelInfo[4] = Y0; \
176 } \
177 \
178 /* Switch on last pixel of the line if it was already \
179 * drawn during rendering of the previous segments \
180 */ \
181 if ((pixelInfo[1] == X1 && pixelInfo[2] == Y1) || \
182 (pixelInfo[3] == X1 && pixelInfo[4] == Y1)) \
183 { \
184 hnd->dhnd->pDrawPixel(hnd->dhnd, X1, Y1); \
185 } \
186 pixelInfo[3] = X1; \
187 pixelInfo[4] = Y1; \
188 } while(0)
189
190 #define PROCESS_POINT(hnd, fX, fY, checkBounds, pixelInfo) \
191 do { \
192 jint _X = (fX)>> MDP_PREC; \
193 jint _Y = (fY)>> MDP_PREC; \
194 if (checkBounds && \
195 (hnd->dhnd->yMin > _Y || \
196 hnd->dhnd->yMax <= _Y || \
197 hnd->dhnd->xMin > _X || \
198 hnd->dhnd->xMax <= _X)) break; \
199 /* \
200 * (_X,_Y) should be inside boundaries \
201 * \
202 * assert(hnd->dhnd->yMin <= _Y && \
203 * hnd->dhnd->yMax > _Y && \
204 * hnd->dhnd->xMin <= _X && \
205 * hnd->dhnd->xMax > _X); \
206 * \
207 */ \
208 if (pixelInfo[0] == 0) { \
209 pixelInfo[0] = 1; \
210 pixelInfo[1] = _X; \
211 pixelInfo[2] = _Y; \
212 pixelInfo[3] = _X; \
213 pixelInfo[4] = _Y; \
214 hnd->dhnd->pDrawPixel(hnd->dhnd, _X, _Y); \
215 } else if ((_X != pixelInfo[3] || _Y != pixelInfo[4]) && \
216 (_X != pixelInfo[1] || _Y != pixelInfo[2])) { \
217 hnd->dhnd->pDrawPixel(hnd->dhnd, _X, _Y); \
218 pixelInfo[3] = _X; \
219 pixelInfo[4] = _Y; \
220 } \
221 } while(0)
222
223
224 /*
225 * Constants for the forward differencing
226 * of the cubic and quad curves
227 */
228
229 /* Maximum size of the cubic curve (calculated as the size of the bounding box
230 * of the control points) which could be rendered without splitting
231 */
232 #define MAX_CUB_SIZE 256
233
234 /* Maximum size of the quad curve (calculated as the size of the bounding box
235 * of the control points) which could be rendered without splitting
236 */
237 #define MAX_QUAD_SIZE 1024
238
239 /* Default power of 2 steps used in the forward differencing. Here DF prefix
|
172 pixelInfo[1] = X0; \
173 pixelInfo[2] = Y0; \
174 pixelInfo[3] = X0; \
175 pixelInfo[4] = Y0; \
176 } \
177 \
178 /* Switch on last pixel of the line if it was already \
179 * drawn during rendering of the previous segments \
180 */ \
181 if ((pixelInfo[1] == X1 && pixelInfo[2] == Y1) || \
182 (pixelInfo[3] == X1 && pixelInfo[4] == Y1)) \
183 { \
184 hnd->dhnd->pDrawPixel(hnd->dhnd, X1, Y1); \
185 } \
186 pixelInfo[3] = X1; \
187 pixelInfo[4] = Y1; \
188 } while(0)
189
190 #define PROCESS_POINT(hnd, fX, fY, checkBounds, pixelInfo) \
191 do { \
192 jint X_ = (fX)>> MDP_PREC; \
193 jint Y_ = (fY)>> MDP_PREC; \
194 if (checkBounds && \
195 (hnd->dhnd->yMin > Y_ || \
196 hnd->dhnd->yMax <= Y_ || \
197 hnd->dhnd->xMin > X_ || \
198 hnd->dhnd->xMax <= X_)) break; \
199 /* \
200 * (X_,Y_) should be inside boundaries \
201 * \
202 * assert(hnd->dhnd->yMin <= Y_ && \
203 * hnd->dhnd->yMax > Y_ && \
204 * hnd->dhnd->xMin <= X_ && \
205 * hnd->dhnd->xMax > X_); \
206 * \
207 */ \
208 if (pixelInfo[0] == 0) { \
209 pixelInfo[0] = 1; \
210 pixelInfo[1] = X_; \
211 pixelInfo[2] = Y_; \
212 pixelInfo[3] = X_; \
213 pixelInfo[4] = Y_; \
214 hnd->dhnd->pDrawPixel(hnd->dhnd, X_, Y_); \
215 } else if ((X_ != pixelInfo[3] || Y_ != pixelInfo[4]) && \
216 (X_ != pixelInfo[1] || Y_ != pixelInfo[2])) { \
217 hnd->dhnd->pDrawPixel(hnd->dhnd, X_, Y_); \
218 pixelInfo[3] = X_; \
219 pixelInfo[4] = Y_; \
220 } \
221 } while(0)
222
223
224 /*
225 * Constants for the forward differencing
226 * of the cubic and quad curves
227 */
228
229 /* Maximum size of the cubic curve (calculated as the size of the bounding box
230 * of the control points) which could be rendered without splitting
231 */
232 #define MAX_CUB_SIZE 256
233
234 /* Maximum size of the quad curve (calculated as the size of the bounding box
235 * of the control points) which could be rendered without splitting
236 */
237 #define MAX_QUAD_SIZE 1024
238
239 /* Default power of 2 steps used in the forward differencing. Here DF prefix
|