116 jint Y0 = (fY0) >> MDP_PREC; \ |
116 jint Y0 = (fY0) >> MDP_PREC; \ |
117 jint X1 = (fX1) >> MDP_PREC; \ |
117 jint X1 = (fX1) >> MDP_PREC; \ |
118 jint Y1 = (fY1) >> MDP_PREC; \ |
118 jint Y1 = (fY1) >> MDP_PREC; \ |
119 jint res; \ |
119 jint res; \ |
120 \ |
120 \ |
121 /* Checking bounds and clipping if necessary */ \ |
121 /* Checking bounds and clipping if necessary. \ |
|
122 * REMIND: It's temporary solution to avoid OOB in rendering code. \ |
|
123 * Current approach uses float equations which are unreliable for \ |
|
124 * clipping and makes assumptions about the line biases of the \ |
|
125 * rendering algorithm. Also, clipping code should be moved down \ |
|
126 * into only those output renderers that need it. \ |
|
127 */ \ |
122 if (checkBounds) { \ |
128 if (checkBounds) { \ |
123 TESTANDCLIP(hnd->dhnd->yMin, hnd->dhnd->yMax, Y0, X0, Y1, X1, \ |
129 jfloat xMinf = hnd->dhnd->xMinf + 0.5f; \ |
124 jint, res); \ |
130 jfloat yMinf = hnd->dhnd->yMinf + 0.5f; \ |
|
131 jfloat xMaxf = hnd->dhnd->xMaxf + 0.5f; \ |
|
132 jfloat yMaxf = hnd->dhnd->yMaxf + 0.5f; \ |
|
133 TESTANDCLIP(yMinf, yMaxf, Y0, X0, Y1, X1, jint, res); \ |
125 if (res == CRES_INVISIBLE) break; \ |
134 if (res == CRES_INVISIBLE) break; \ |
126 TESTANDCLIP(hnd->dhnd->yMin, hnd->dhnd->yMax, Y1, X1, Y0, X0, \ |
135 TESTANDCLIP(yMinf, yMaxf, Y1, X1, Y0, X0, jint, res); \ |
127 jint, res); \ |
|
128 if (res == CRES_INVISIBLE) break; \ |
136 if (res == CRES_INVISIBLE) break; \ |
129 TESTANDCLIP(hnd->dhnd->xMin, hnd->dhnd->xMax, X0, Y0, X1, Y1, \ |
137 TESTANDCLIP(xMinf, xMaxf, X0, Y0, X1, Y1, jint, res); \ |
130 jint, res); \ |
|
131 if (res == CRES_INVISIBLE) break; \ |
138 if (res == CRES_INVISIBLE) break; \ |
132 TESTANDCLIP(hnd->dhnd->xMin, hnd->dhnd->xMax, X1, Y1, X0, Y0, \ |
139 TESTANDCLIP(xMinf, xMaxf, X1, Y1, X0, Y0, jint, res); \ |
133 jint, res); \ |
|
134 if (res == CRES_INVISIBLE) break; \ |
140 if (res == CRES_INVISIBLE) break; \ |
135 } \ |
141 } \ |
136 \ |
142 \ |
137 /* Handling lines having just one pixel */ \ |
143 /* Handling lines having just one pixel */ \ |
138 if (((X0^X1) | (Y0^Y1)) == 0) { \ |
144 if (((X0^X1) | (Y0^Y1)) == 0) { \ |