Line | Source Code | Coverage |
---|
1 | | - |
2 | typedef int TCoord; | - |
3 | typedef int TPos; | - |
4 | typedef int TArea; | - |
5 | typedef struct TCell_* PCell; | - |
6 | | - |
7 | typedef struct TCell_ | - |
8 | { | - |
9 | int x; | - |
10 | int cover; | - |
11 | TArea area; | - |
12 | PCell next; | - |
13 | | - |
14 | } TCell; | - |
15 | | - |
16 | | - |
17 | typedef struct TWorker_ | - |
18 | { | - |
19 | TCoord ex, ey; | - |
20 | TPos min_ex, max_ex; | - |
21 | TPos min_ey, max_ey; | - |
22 | TPos count_ex, count_ey; | - |
23 | | - |
24 | TArea area; | - |
25 | int cover; | - |
26 | int invalid; | - |
27 | | - |
28 | PCell cells; | - |
29 | int max_cells; | - |
30 | int num_cells; | - |
31 | | - |
32 | TCoord cx, cy; | - |
33 | TPos x, y; | - |
34 | | - |
35 | TPos last_ey; | - |
36 | | - |
37 | QT_FT_Vector bez_stack[32 * 3 + 1]; | - |
38 | int lev_stack[32]; | - |
39 | | - |
40 | QT_FT_Outline outline; | - |
41 | QT_FT_Bitmap target; | - |
42 | QT_FT_BBox clip_box; | - |
43 | | - |
44 | QT_FT_Span gray_spans[256]; | - |
45 | int num_gray_spans; | - |
46 | | - |
47 | QT_FT_SpanFunc render_span; | - |
48 | void* render_span_data; | - |
49 | | - |
50 | int band_size; | - |
51 | int band_shoot; | - |
52 | int conic_level; | - |
53 | int cubic_level; | - |
54 | | - |
55 | jmp_buf jump_buffer; | - |
56 | | - |
57 | void* buffer; | - |
58 | long buffer_size; | - |
59 | | - |
60 | PCell* ycells; | - |
61 | int ycount; | - |
62 | | - |
63 | int skip_spans; | - |
64 | } TWorker, *PWorker; | - |
65 | | - |
66 | | - |
67 | typedef struct TRaster_ | - |
68 | { | - |
69 | void* buffer; | - |
70 | long buffer_size; | - |
71 | long buffer_allocated_size; | - |
72 | int band_size; | - |
73 | void* memory; | - |
74 | PWorker worker; | - |
75 | | - |
76 | } TRaster, *PRaster; | - |
77 | | - |
78 | int q_gray_rendered_spans(TRaster *raster) | - |
79 | { | - |
80 | if ( raster && raster->worker ) never evaluated: raster->worker | 0 |
81 | return raster->worker->skip_spans > 0 ? 0 : -raster->worker->skip_spans; never executed: return raster->worker->skip_spans > 0 ? 0 : -raster->worker->skip_spans; | 0 |
82 | return 0; never executed: return 0; | 0 |
83 | } | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | static void | - |
90 | gray_init_cells( PWorker worker, void* buffer, | - |
91 | long byte_size ) | - |
92 | { | - |
93 | (*worker).buffer = buffer; | - |
94 | (*worker).buffer_size = byte_size; | - |
95 | | - |
96 | (*worker).ycells = (PCell*) buffer; | - |
97 | (*worker).cells = ((void *)0); | - |
98 | (*worker).max_cells = 0; | - |
99 | (*worker).num_cells = 0; | - |
100 | (*worker).area = 0; | - |
101 | (*worker).cover = 0; | - |
102 | (*worker).invalid = 1; | - |
103 | } executed: } Execution Count:16545 | 16545 |
104 | | - |
105 | | - |
106 | | - |
107 | | - |
108 | | - |
109 | | - |
110 | static void | - |
111 | gray_compute_cbox( PWorker worker ) | - |
112 | { | - |
113 | QT_FT_Outline* outline = &(*worker).outline; | - |
114 | QT_FT_Vector* vec = outline->points; | - |
115 | QT_FT_Vector* limit = vec + outline->n_points; | - |
116 | | - |
117 | | - |
118 | if ( outline->n_points <= 0 ) partially evaluated: outline->n_points <= 0 no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
119 | { | - |
120 | (*worker).min_ex = (*worker).max_ex = 0; | - |
121 | (*worker).min_ey = (*worker).max_ey = 0; | - |
122 | return; | 0 |
123 | } | - |
124 | | - |
125 | (*worker).min_ex = (*worker).max_ex = vec->x; | - |
126 | (*worker).min_ey = (*worker).max_ey = vec->y; | - |
127 | | - |
128 | vec++; | - |
129 | | - |
130 | for ( ; vec < limit; vec++ ) evaluated: vec < limit yes Evaluation Count:323169 | yes Evaluation Count:16545 |
| 16545-323169 |
131 | { | - |
132 | TPos x = vec->x; | - |
133 | TPos y = vec->y; | - |
134 | | - |
135 | | - |
136 | if ( x < (*worker).min_ex ) (*worker).min_ex = x; evaluated: x < (*worker).min_ex yes Evaluation Count:7833 | yes Evaluation Count:315336 |
executed: (*worker).min_ex = x; Execution Count:7833 | 7833-315336 |
137 | if ( x > (*worker).max_ex ) (*worker).max_ex = x; evaluated: x > (*worker).max_ex yes Evaluation Count:62259 | yes Evaluation Count:260910 |
executed: (*worker).max_ex = x; Execution Count:62259 | 62259-260910 |
138 | if ( y < (*worker).min_ey ) (*worker).min_ey = y; evaluated: y < (*worker).min_ey yes Evaluation Count:3372 | yes Evaluation Count:319797 |
executed: (*worker).min_ey = y; Execution Count:3372 | 3372-319797 |
139 | if ( y > (*worker).max_ey ) (*worker).max_ey = y; evaluated: y > (*worker).max_ey yes Evaluation Count:56267 | yes Evaluation Count:266902 |
executed: (*worker).max_ey = y; Execution Count:56267 | 56267-266902 |
140 | } executed: } Execution Count:323169 | 323169 |
141 | | - |
142 | | - |
143 | (*worker).min_ex = (*worker).min_ex >> 6; | - |
144 | (*worker).min_ey = (*worker).min_ey >> 6; | - |
145 | (*worker).max_ex = ( (*worker).max_ex + 63 ) >> 6; | - |
146 | (*worker).max_ey = ( (*worker).max_ey + 63 ) >> 6; | - |
147 | } executed: } Execution Count:16545 | 16545 |
148 | | - |
149 | | - |
150 | | - |
151 | | - |
152 | | - |
153 | | - |
154 | static void | - |
155 | gray_record_cell( PWorker worker ) | - |
156 | { | - |
157 | PCell *pcell, cell; | - |
158 | int x = (*worker).ex; | - |
159 | | - |
160 | if ( (*worker).invalid || !( (*worker).area | (*worker).cover ) ) evaluated: (*worker).invalid yes Evaluation Count:34045 | yes Evaluation Count:135192 |
evaluated: !( (*worker).area | (*worker).cover ) yes Evaluation Count:41983 | yes Evaluation Count:93209 |
| 34045-135192 |
161 | return; executed: return; Execution Count:76028 | 76028 |
162 | | - |
163 | if ( x > (*worker).max_ex ) partially evaluated: x > (*worker).max_ex no Evaluation Count:0 | yes Evaluation Count:93209 |
| 0-93209 |
164 | x = (*worker).max_ex; never executed: x = (*worker).max_ex; | 0 |
165 | | - |
166 | pcell = &(*worker).ycells[(*worker).ey]; | - |
167 | | - |
168 | for (;;) | - |
169 | { | - |
170 | cell = *pcell; | - |
171 | if ( cell == ((void *)0) || cell->x > x ) evaluated: cell == ((void *)0) yes Evaluation Count:59901 | yes Evaluation Count:199887 |
evaluated: cell->x > x yes Evaluation Count:29904 | yes Evaluation Count:169983 |
| 29904-199887 |
172 | break; executed: break; Execution Count:89805 | 89805 |
173 | | - |
174 | if ( cell->x == x ) { evaluated: cell->x == x yes Evaluation Count:3404 | yes Evaluation Count:166579 |
| 3404-166579 |
175 | cell->area += (*worker).area; | - |
176 | cell->cover += (*worker).cover; | - |
177 | return; executed: return; Execution Count:3404 | 3404 |
178 | } | - |
179 | | - |
180 | pcell = &cell->next; | - |
181 | } executed: } Execution Count:166579 | 166579 |
182 | | - |
183 | if ( (*worker).num_cells >= (*worker).max_cells ) evaluated: (*worker).num_cells >= (*worker).max_cells yes Evaluation Count:66 | yes Evaluation Count:89739 |
| 66-89739 |
184 | longjmp( (*worker).jump_buffer, 1 ); executed: longjmp( (*worker).jump_buffer, 1 ); Execution Count:66 | 66 |
185 | | - |
186 | cell = (*worker).cells + (*worker).num_cells++; | - |
187 | cell->x = x; | - |
188 | cell->area = (*worker).area; | - |
189 | cell->cover = (*worker).cover; | - |
190 | | - |
191 | cell->next = *pcell; | - |
192 | *pcell = cell; | - |
193 | } executed: } Execution Count:89739 | 89739 |
194 | | - |
195 | | - |
196 | | - |
197 | | - |
198 | | - |
199 | | - |
200 | static void | - |
201 | gray_set_cell( PWorker worker, TCoord ex, | - |
202 | TCoord ey ) | - |
203 | { | - |
204 | ey -= (*worker).min_ey; | - |
205 | | - |
206 | if ( ex > (*worker).max_ex ) evaluated: ex > (*worker).max_ex yes Evaluation Count:49711 | yes Evaluation Count:327303 |
| 49711-327303 |
207 | ex = (*worker).max_ex; executed: ex = (*worker).max_ex; Execution Count:49711 | 49711 |
208 | | - |
209 | ex -= (*worker).min_ex; | - |
210 | if ( ex < 0 ) evaluated: ex < 0 yes Evaluation Count:19528 | yes Evaluation Count:357486 |
| 19528-357486 |
211 | ex = -1; executed: ex = -1; Execution Count:19528 | 19528 |
212 | | - |
213 | | - |
214 | if ( ex != (*worker).ex || ey != (*worker).ey ) evaluated: ex != (*worker).ex yes Evaluation Count:85653 | yes Evaluation Count:291361 |
evaluated: ey != (*worker).ey yes Evaluation Count:174984 | yes Evaluation Count:116377 |
| 85653-291361 |
215 | { | - |
216 | | - |
217 | if ( !(*worker).invalid ) evaluated: !(*worker).invalid yes Evaluation Count:102159 | yes Evaluation Count:158478 |
| 102159-158478 |
218 | gray_record_cell( worker ); executed: gray_record_cell( worker ); Execution Count:102159 | 102159 |
219 | | - |
220 | (*worker).area = 0; | - |
221 | (*worker).cover = 0; | - |
222 | } executed: } Execution Count:260571 | 260571 |
223 | | - |
224 | (*worker).ex = ex; | - |
225 | (*worker).ey = ey; | - |
226 | (*worker).invalid = ( (unsigned)ey >= (unsigned)(*worker).count_ey || | - |
227 | ex >= (*worker).count_ex ); | - |
228 | } executed: } Execution Count:376948 | 376948 |
229 | | - |
230 | | - |
231 | | - |
232 | | - |
233 | | - |
234 | | - |
235 | static void | - |
236 | gray_start_cell( PWorker worker, TCoord ex, | - |
237 | TCoord ey ) | - |
238 | { | - |
239 | if ( ex > (*worker).max_ex ) evaluated: ex > (*worker).max_ex yes Evaluation Count:8255 | yes Evaluation Count:42020 |
| 8255-42020 |
240 | ex = (TCoord)( (*worker).max_ex ); executed: ex = (TCoord)( (*worker).max_ex ); Execution Count:8255 | 8255 |
241 | | - |
242 | if ( ex < (*worker).min_ex ) evaluated: ex < (*worker).min_ex yes Evaluation Count:57 | yes Evaluation Count:50218 |
| 57-50218 |
243 | ex = (TCoord)( (*worker).min_ex - 1 ); executed: ex = (TCoord)( (*worker).min_ex - 1 ); Execution Count:57 | 57 |
244 | | - |
245 | (*worker).area = 0; | - |
246 | (*worker).cover = 0; | - |
247 | (*worker).ex = ex - (*worker).min_ex; | - |
248 | (*worker).ey = ey - (*worker).min_ey; | - |
249 | (*worker).last_ey = ( (TPos)(ey) << 8 ); | - |
250 | (*worker).invalid = 0; | - |
251 | | - |
252 | gray_set_cell( worker, ex, ey ); | - |
253 | } executed: } Execution Count:50275 | 50275 |
254 | | - |
255 | | - |
256 | | - |
257 | | - |
258 | | - |
259 | | - |
260 | static void | - |
261 | gray_render_scanline( PWorker worker, TCoord ey, | - |
262 | TPos x1, | - |
263 | TCoord y1, | - |
264 | TPos x2, | - |
265 | TCoord y2 ) | - |
266 | { | - |
267 | TCoord ex1, ex2, fx1, fx2, delta; | - |
268 | int p, first, dx; | - |
269 | int incr, lift, mod, rem; | - |
270 | | - |
271 | | - |
272 | dx = x2 - x1; | - |
273 | | - |
274 | ex1 = ( (TCoord)( (x1) >> 8 ) ); | - |
275 | ex2 = ( (TCoord)( (x2) >> 8 ) ); | - |
276 | fx1 = (TCoord)( x1 - ( (TPos)(ex1) << 8 ) ); | - |
277 | fx2 = (TCoord)( x2 - ( (TPos)(ex2) << 8 ) ); | - |
278 | | - |
279 | | - |
280 | if ( y1 == y2 ) evaluated: y1 == y2 yes Evaluation Count:103921 | yes Evaluation Count:120980 |
| 103921-120980 |
281 | { | - |
282 | gray_set_cell( worker, ex2, ey ); | - |
283 | return; executed: return; Execution Count:103921 | 103921 |
284 | } | - |
285 | | - |
286 | | - |
287 | | - |
288 | if ( ex1 == ex2 ) evaluated: ex1 == ex2 yes Evaluation Count:102839 | yes Evaluation Count:18141 |
| 18141-102839 |
289 | { | - |
290 | delta = y2 - y1; | - |
291 | (*worker).area += (TArea)( fx1 + fx2 ) * delta; | - |
292 | (*worker).cover += delta; | - |
293 | return; executed: return; Execution Count:102839 | 102839 |
294 | } | - |
295 | | - |
296 | | - |
297 | | - |
298 | | - |
299 | p = ( ( 1L << 8 ) - fx1 ) * ( y2 - y1 ); | - |
300 | first = ( 1L << 8 ); | - |
301 | incr = 1; | - |
302 | | - |
303 | if ( dx < 0 ) evaluated: dx < 0 yes Evaluation Count:8667 | yes Evaluation Count:9474 |
| 8667-9474 |
304 | { | - |
305 | p = fx1 * ( y2 - y1 ); | - |
306 | first = 0; | - |
307 | incr = -1; | - |
308 | dx = -dx; | - |
309 | } executed: } Execution Count:8667 | 8667 |
310 | | - |
311 | delta = (TCoord)( p / dx ); | - |
312 | mod = (TCoord)( p % dx ); | - |
313 | if ( mod < 0 ) evaluated: mod < 0 yes Evaluation Count:6807 | yes Evaluation Count:11334 |
| 6807-11334 |
314 | { | - |
315 | delta--; | - |
316 | mod += (TCoord)dx; | - |
317 | } executed: } Execution Count:6807 | 6807 |
318 | | - |
319 | (*worker).area += (TArea)( fx1 + first ) * delta; | - |
320 | (*worker).cover += delta; | - |
321 | | - |
322 | ex1 += incr; | - |
323 | gray_set_cell( worker, ex1, ey ); | - |
324 | y1 += delta; | - |
325 | | - |
326 | if ( ex1 != ex2 ) evaluated: ex1 != ex2 yes Evaluation Count:2098 | yes Evaluation Count:16021 |
| 2098-16021 |
327 | { | - |
328 | p = ( 1L << 8 ) * ( y2 - y1 + delta ); | - |
329 | lift = (TCoord)( p / dx ); | - |
330 | rem = (TCoord)( p % dx ); | - |
331 | if ( rem < 0 ) evaluated: rem < 0 yes Evaluation Count:987 | yes Evaluation Count:1111 |
| 987-1111 |
332 | { | - |
333 | lift--; | - |
334 | rem += (TCoord)dx; | - |
335 | } executed: } Execution Count:987 | 987 |
336 | | - |
337 | mod -= (int)dx; | - |
338 | | - |
339 | while ( ex1 != ex2 ) evaluated: ex1 != ex2 yes Evaluation Count:3784 | yes Evaluation Count:2098 |
| 2098-3784 |
340 | { | - |
341 | delta = lift; | - |
342 | mod += rem; | - |
343 | if ( mod >= 0 ) evaluated: mod >= 0 yes Evaluation Count:1839 | yes Evaluation Count:1945 |
| 1839-1945 |
344 | { | - |
345 | mod -= (TCoord)dx; | - |
346 | delta++; | - |
347 | } executed: } Execution Count:1839 | 1839 |
348 | | - |
349 | (*worker).area += (TArea)( 1L << 8 ) * delta; | - |
350 | (*worker).cover += delta; | - |
351 | y1 += delta; | - |
352 | ex1 += incr; | - |
353 | gray_set_cell( worker, ex1, ey ); | - |
354 | } executed: } Execution Count:3784 | 3784 |
355 | } executed: } Execution Count:2098 | 2098 |
356 | | - |
357 | delta = y2 - y1; | - |
358 | (*worker).area += (TArea)( fx2 + ( 1L << 8 ) - first ) * delta; | - |
359 | (*worker).cover += delta; | - |
360 | } executed: } Execution Count:18119 | 18119 |
361 | | - |
362 | | - |
363 | | - |
364 | | - |
365 | | - |
366 | | - |
367 | static void | - |
368 | gray_render_line( PWorker worker, TPos to_x, | - |
369 | TPos to_y ) | - |
370 | { | - |
371 | TCoord ey1, ey2, fy1, fy2; | - |
372 | TPos dx, dy, x, x2; | - |
373 | int p, first; | - |
374 | int delta, rem, mod, lift, incr; | - |
375 | | - |
376 | | - |
377 | ey1 = ( (TCoord)( ((*worker).last_ey) >> 8 ) ); | - |
378 | ey2 = ( (TCoord)( (to_y) >> 8 ) ); | - |
379 | fy1 = (TCoord)( (*worker).y - (*worker).last_ey ); | - |
380 | fy2 = (TCoord)( to_y - ( (TPos)(ey2) << 8 ) ); | - |
381 | | - |
382 | dx = to_x - (*worker).x; | - |
383 | dy = to_y - (*worker).y; | - |
384 | | - |
385 | | - |
386 | | - |
387 | | - |
388 | | - |
389 | { | - |
390 | TCoord min, max; | - |
391 | | - |
392 | | - |
393 | min = ey1; | - |
394 | max = ey2; | - |
395 | if ( ey1 > ey2 ) evaluated: ey1 > ey2 yes Evaluation Count:82399 | yes Evaluation Count:725033 |
| 82399-725033 |
396 | { | - |
397 | min = ey2; | - |
398 | max = ey1; | - |
399 | } executed: } Execution Count:82399 | 82399 |
400 | if ( min >= (*worker).max_ey || max < (*worker).min_ey ) evaluated: min >= (*worker).max_ey yes Evaluation Count:396244 | yes Evaluation Count:411188 |
evaluated: max < (*worker).min_ey yes Evaluation Count:139954 | yes Evaluation Count:271234 |
| 139954-411188 |
401 | goto End; executed: goto End; Execution Count:536198 | 536198 |
402 | } | - |
403 | | - |
404 | | - |
405 | if ( ey1 == ey2 ) evaluated: ey1 == ey2 yes Evaluation Count:175792 | yes Evaluation Count:95442 |
| 95442-175792 |
406 | { | - |
407 | gray_render_scanline( worker, ey1, (*worker).x, fy1, to_x, fy2 ); | - |
408 | goto End; executed: goto End; Execution Count:175776 | 175776 |
409 | } | - |
410 | | - |
411 | | - |
412 | incr = 1; | - |
413 | | - |
414 | if ( dx == 0 ) evaluated: dx == 0 yes Evaluation Count:83924 | yes Evaluation Count:11518 |
| 11518-83924 |
415 | { | - |
416 | TCoord ex = ( (TCoord)( ((*worker).x) >> 8 ) ); | - |
417 | TCoord two_fx = (TCoord)( ( (*worker).x - ( (TPos)(ex) << 8 ) ) << 1 ); | - |
418 | TPos area; | - |
419 | | - |
420 | | - |
421 | first = ( 1L << 8 ); | - |
422 | if ( dy < 0 ) evaluated: dy < 0 yes Evaluation Count:41881 | yes Evaluation Count:42043 |
| 41881-42043 |
423 | { | - |
424 | first = 0; | - |
425 | incr = -1; | - |
426 | } executed: } Execution Count:41881 | 41881 |
427 | | - |
428 | delta = (int)( first - fy1 ); | - |
429 | (*worker).area += (TArea)two_fx * delta; | - |
430 | (*worker).cover += delta; | - |
431 | ey1 += incr; | - |
432 | | - |
433 | gray_set_cell( &(*worker), ex, ey1 ); | - |
434 | | - |
435 | delta = (int)( first + first - ( 1L << 8 ) ); | - |
436 | area = (TArea)two_fx * delta; | - |
437 | while ( ey1 != ey2 ) evaluated: ey1 != ey2 yes Evaluation Count:79350 | yes Evaluation Count:83908 |
| 79350-83908 |
438 | { | - |
439 | (*worker).area += area; | - |
440 | (*worker).cover += delta; | - |
441 | ey1 += incr; | - |
442 | | - |
443 | gray_set_cell( &(*worker), ex, ey1 ); | - |
444 | } executed: } Execution Count:79336 | 79336 |
445 | | - |
446 | delta = (int)( fy2 - ( 1L << 8 ) + first ); | - |
447 | (*worker).area += (TArea)two_fx * delta; | - |
448 | (*worker).cover += delta; | - |
449 | | - |
450 | goto End; executed: goto End; Execution Count:83908 | 83908 |
451 | } | - |
452 | | - |
453 | | - |
454 | p = ( ( 1L << 8 ) - fy1 ) * dx; | - |
455 | first = ( 1L << 8 ); | - |
456 | incr = 1; | - |
457 | | - |
458 | if ( dy < 0 ) evaluated: dy < 0 yes Evaluation Count:5498 | yes Evaluation Count:6020 |
| 5498-6020 |
459 | { | - |
460 | p = fy1 * dx; | - |
461 | first = 0; | - |
462 | incr = -1; | - |
463 | dy = -dy; | - |
464 | } executed: } Execution Count:5498 | 5498 |
465 | | - |
466 | delta = (int)( p / dy ); | - |
467 | mod = (int)( p % dy ); | - |
468 | if ( mod < 0 ) evaluated: mod < 0 yes Evaluation Count:3531 | yes Evaluation Count:7987 |
| 3531-7987 |
469 | { | - |
470 | delta--; | - |
471 | mod += (TCoord)dy; | - |
472 | } executed: } Execution Count:3531 | 3531 |
473 | | - |
474 | x = (*worker).x + delta; | - |
475 | gray_render_scanline( worker, ey1, (*worker).x, fy1, x, (TCoord)first ); | - |
476 | | - |
477 | ey1 += incr; | - |
478 | gray_set_cell( worker, ( (TCoord)( (x) >> 8 ) ), ey1 ); | - |
479 | | - |
480 | if ( ey1 != ey2 ) evaluated: ey1 != ey2 yes Evaluation Count:2624 | yes Evaluation Count:8872 |
| 2624-8872 |
481 | { | - |
482 | p = ( 1L << 8 ) * dx; | - |
483 | lift = (int)( p / dy ); | - |
484 | rem = (int)( p % dy ); | - |
485 | if ( rem < 0 ) evaluated: rem < 0 yes Evaluation Count:1039 | yes Evaluation Count:1585 |
| 1039-1585 |
486 | { | - |
487 | lift--; | - |
488 | rem += (int)dy; | - |
489 | } executed: } Execution Count:1039 | 1039 |
490 | mod -= (int)dy; | - |
491 | | - |
492 | while ( ey1 != ey2 ) evaluated: ey1 != ey2 yes Evaluation Count:26104 | yes Evaluation Count:2615 |
| 2615-26104 |
493 | { | - |
494 | delta = lift; | - |
495 | mod += rem; | - |
496 | if ( mod >= 0 ) evaluated: mod >= 0 yes Evaluation Count:13752 | yes Evaluation Count:12352 |
| 12352-13752 |
497 | { | - |
498 | mod -= (int)dy; | - |
499 | delta++; | - |
500 | } executed: } Execution Count:13752 | 13752 |
501 | | - |
502 | x2 = x + delta; | - |
503 | gray_render_scanline( worker, ey1, x, | - |
504 | (TCoord)( ( 1L << 8 ) - first ), x2, | - |
505 | (TCoord)first ); | - |
506 | x = x2; | - |
507 | | - |
508 | ey1 += incr; | - |
509 | gray_set_cell( worker, ( (TCoord)( (x) >> 8 ) ), ey1 ); | - |
510 | } executed: } Execution Count:26095 | 26095 |
511 | } executed: } Execution Count:2615 | 2615 |
512 | | - |
513 | gray_render_scanline( worker, ey1, x, | - |
514 | (TCoord)( ( 1L << 8 ) - first ), to_x, | - |
515 | fy2 ); | - |
516 | | - |
517 | End: code before this statement executed: End: Execution Count:11484 | 11484 |
518 | (*worker).x = to_x; | - |
519 | (*worker).y = to_y; | - |
520 | (*worker).last_ey = ( (TPos)(ey2) << 8 ); | - |
521 | } executed: } Execution Count:807366 | 807366 |
522 | | - |
523 | | - |
524 | static void | - |
525 | gray_split_conic( QT_FT_Vector* base ) | - |
526 | { | - |
527 | TPos a, b; | - |
528 | | - |
529 | | - |
530 | base[4].x = base[2].x; | - |
531 | b = base[1].x; | - |
532 | a = base[3].x = ( base[2].x + b ) / 2; | - |
533 | b = base[1].x = ( base[0].x + b ) / 2; | - |
534 | base[2].x = ( a + b ) / 2; | - |
535 | | - |
536 | base[4].y = base[2].y; | - |
537 | b = base[1].y; | - |
538 | a = base[3].y = ( base[2].y + b ) / 2; | - |
539 | b = base[1].y = ( base[0].y + b ) / 2; | - |
540 | base[2].y = ( a + b ) / 2; | - |
541 | } | 0 |
542 | | - |
543 | | - |
544 | static void | - |
545 | gray_render_conic( PWorker worker, const QT_FT_Vector* control, | - |
546 | const QT_FT_Vector* to ) | - |
547 | { | - |
548 | TPos dx, dy; | - |
549 | int top, level; | - |
550 | int* levels; | - |
551 | QT_FT_Vector* arc; | - |
552 | | - |
553 | | - |
554 | dx = ( ((*worker).x) >> ( 8 - 6 ) ) + to->x - ( control->x << 1 ); | - |
555 | if ( dx < 0 ) | 0 |
556 | dx = -dx; never executed: dx = -dx; | 0 |
557 | dy = ( ((*worker).y) >> ( 8 - 6 ) ) + to->y - ( control->y << 1 ); | - |
558 | if ( dy < 0 ) | 0 |
559 | dy = -dy; never executed: dy = -dy; | 0 |
560 | if ( dx < dy ) | 0 |
561 | dx = dy; | 0 |
562 | | - |
563 | level = 1; | - |
564 | dx = dx / (*worker).conic_level; | - |
565 | while ( dx > 0 ) | 0 |
566 | { | - |
567 | dx >>= 2; | - |
568 | level++; | - |
569 | } | 0 |
570 | | - |
571 | | - |
572 | if ( level <= 1 ) never evaluated: level <= 1 | 0 |
573 | { | - |
574 | | - |
575 | | - |
576 | TPos to_x, to_y, mid_x, mid_y; | - |
577 | | - |
578 | | - |
579 | to_x = ( (to->x) << ( 8 - 6 ) ); | - |
580 | to_y = ( (to->y) << ( 8 - 6 ) ); | - |
581 | mid_x = ( (*worker).x + to_x + 2 * ( (control->x) << ( 8 - 6 ) ) ) / 4; | - |
582 | mid_y = ( (*worker).y + to_y + 2 * ( (control->y) << ( 8 - 6 ) ) ) / 4; | - |
583 | | - |
584 | gray_render_line( worker, mid_x, mid_y ); | - |
585 | gray_render_line( worker, to_x, to_y ); | - |
586 | | - |
587 | return; | 0 |
588 | } | - |
589 | | - |
590 | arc = (*worker).bez_stack; | - |
591 | levels = (*worker).lev_stack; | - |
592 | top = 0; | - |
593 | levels[0] = level; | - |
594 | | - |
595 | arc[0].x = ( (to->x) << ( 8 - 6 ) ); | - |
596 | arc[0].y = ( (to->y) << ( 8 - 6 ) ); | - |
597 | arc[1].x = ( (control->x) << ( 8 - 6 ) ); | - |
598 | arc[1].y = ( (control->y) << ( 8 - 6 ) ); | - |
599 | arc[2].x = (*worker).x; | - |
600 | arc[2].y = (*worker).y; | - |
601 | | - |
602 | while ( top >= 0 ) never evaluated: top >= 0 | 0 |
603 | { | - |
604 | level = levels[top]; | - |
605 | if ( level > 1 ) never evaluated: level > 1 | 0 |
606 | { | - |
607 | | - |
608 | TPos min, max, y; | - |
609 | | - |
610 | | - |
611 | min = max = arc[0].y; | - |
612 | | - |
613 | y = arc[1].y; | - |
614 | if ( y < min ) min = y; | 0 |
615 | if ( y > max ) max = y; | 0 |
616 | | - |
617 | y = arc[2].y; | - |
618 | if ( y < min ) min = y; | 0 |
619 | if ( y > max ) max = y; | 0 |
620 | | - |
621 | if ( ( (TCoord)( (min) >> 8 ) ) >= (*worker).max_ey || ( (TCoord)( (max) >> 8 ) ) < (*worker).min_ey ) never evaluated: ( (TCoord)( (min) >> 8 ) ) >= (*worker).max_ey never evaluated: ( (TCoord)( (max) >> 8 ) ) < (*worker).min_ey | 0 |
622 | goto Draw; never executed: goto Draw; | 0 |
623 | | - |
624 | gray_split_conic( arc ); | - |
625 | arc += 2; | - |
626 | top++; | - |
627 | levels[top] = levels[top - 1] = level - 1; | - |
628 | continue; never executed: continue; | 0 |
629 | } | - |
630 | | - |
631 | Draw: code before this statement never executed: Draw: | 0 |
632 | { | - |
633 | TPos to_x, to_y, mid_x, mid_y; | - |
634 | | - |
635 | | - |
636 | to_x = arc[0].x; | - |
637 | to_y = arc[0].y; | - |
638 | mid_x = ( (*worker).x + to_x + 2 * arc[1].x ) / 4; | - |
639 | mid_y = ( (*worker).y + to_y + 2 * arc[1].y ) / 4; | - |
640 | | - |
641 | gray_render_line( worker, mid_x, mid_y ); | - |
642 | gray_render_line( worker, to_x, to_y ); | - |
643 | | - |
644 | top--; | - |
645 | arc -= 2; | - |
646 | } | - |
647 | } | 0 |
648 | | - |
649 | return; | 0 |
650 | } | - |
651 | | - |
652 | | - |
653 | static void | - |
654 | gray_split_cubic( QT_FT_Vector* base ) | - |
655 | { | - |
656 | TPos a, b, c, d; | - |
657 | | - |
658 | | - |
659 | base[6].x = base[3].x; | - |
660 | c = base[1].x; | - |
661 | d = base[2].x; | - |
662 | base[1].x = a = ( base[0].x + c ) / 2; | - |
663 | base[5].x = b = ( base[3].x + d ) / 2; | - |
664 | c = ( c + d ) / 2; | - |
665 | base[2].x = a = ( a + c ) / 2; | - |
666 | base[4].x = b = ( b + c ) / 2; | - |
667 | base[3].x = ( a + b ) / 2; | - |
668 | | - |
669 | base[6].y = base[3].y; | - |
670 | c = base[1].y; | - |
671 | d = base[2].y; | - |
672 | base[1].y = a = ( base[0].y + c ) / 2; | - |
673 | base[5].y = b = ( base[3].y + d ) / 2; | - |
674 | c = ( c + d ) / 2; | - |
675 | base[2].y = a = ( a + c ) / 2; | - |
676 | base[4].y = b = ( b + c ) / 2; | - |
677 | base[3].y = ( a + b ) / 2; | - |
678 | } | 0 |
679 | | - |
680 | | - |
681 | static void | - |
682 | gray_render_cubic( PWorker worker, const QT_FT_Vector* control1, | - |
683 | const QT_FT_Vector* control2, | - |
684 | const QT_FT_Vector* to ) | - |
685 | { | - |
686 | TPos dx, dy, da, db; | - |
687 | int top, level; | - |
688 | int* levels; | - |
689 | QT_FT_Vector* arc; | - |
690 | | - |
691 | | - |
692 | dx = ( ((*worker).x) >> ( 8 - 6 ) ) + to->x - ( control1->x << 1 ); | - |
693 | if ( dx < 0 ) | 0 |
694 | dx = -dx; never executed: dx = -dx; | 0 |
695 | dy = ( ((*worker).y) >> ( 8 - 6 ) ) + to->y - ( control1->y << 1 ); | - |
696 | if ( dy < 0 ) | 0 |
697 | dy = -dy; never executed: dy = -dy; | 0 |
698 | if ( dx < dy ) | 0 |
699 | dx = dy; | 0 |
700 | da = dx; | - |
701 | | - |
702 | dx = ( ((*worker).x) >> ( 8 - 6 ) ) + to->x - 3 * ( control1->x + control2->x ); | - |
703 | if ( dx < 0 ) | 0 |
704 | dx = -dx; never executed: dx = -dx; | 0 |
705 | dy = ( ((*worker).y) >> ( 8 - 6 ) ) + to->y - 3 * ( control1->y + control2->y ); | - |
706 | if ( dy < 0 ) | 0 |
707 | dy = -dy; never executed: dy = -dy; | 0 |
708 | if ( dx < dy ) | 0 |
709 | dx = dy; | 0 |
710 | db = dx; | - |
711 | | - |
712 | level = 1; | - |
713 | da = da / (*worker).cubic_level; | - |
714 | db = db / (*worker).conic_level; | - |
715 | while ( da > 0 || db > 0 ) | 0 |
716 | { | - |
717 | da >>= 2; | - |
718 | db >>= 3; | - |
719 | level++; | - |
720 | } | 0 |
721 | | - |
722 | if ( level <= 1 ) never evaluated: level <= 1 | 0 |
723 | { | - |
724 | TPos to_x, to_y, mid_x, mid_y; | - |
725 | | - |
726 | | - |
727 | to_x = ( (to->x) << ( 8 - 6 ) ); | - |
728 | to_y = ( (to->y) << ( 8 - 6 ) ); | - |
729 | mid_x = ( (*worker).x + to_x + | - |
730 | 3 * ( (control1->x + control2->x) << ( 8 - 6 ) ) ) / 8; | - |
731 | mid_y = ( (*worker).y + to_y + | - |
732 | 3 * ( (control1->y + control2->y) << ( 8 - 6 ) ) ) / 8; | - |
733 | | - |
734 | gray_render_line( worker, mid_x, mid_y ); | - |
735 | gray_render_line( worker, to_x, to_y ); | - |
736 | return; | 0 |
737 | } | - |
738 | | - |
739 | arc = (*worker).bez_stack; | - |
740 | arc[0].x = ( (to->x) << ( 8 - 6 ) ); | - |
741 | arc[0].y = ( (to->y) << ( 8 - 6 ) ); | - |
742 | arc[1].x = ( (control2->x) << ( 8 - 6 ) ); | - |
743 | arc[1].y = ( (control2->y) << ( 8 - 6 ) ); | - |
744 | arc[2].x = ( (control1->x) << ( 8 - 6 ) ); | - |
745 | arc[2].y = ( (control1->y) << ( 8 - 6 ) ); | - |
746 | arc[3].x = (*worker).x; | - |
747 | arc[3].y = (*worker).y; | - |
748 | | - |
749 | levels = (*worker).lev_stack; | - |
750 | top = 0; | - |
751 | levels[0] = level; | - |
752 | | - |
753 | while ( top >= 0 ) never evaluated: top >= 0 | 0 |
754 | { | - |
755 | level = levels[top]; | - |
756 | if ( level > 1 ) never evaluated: level > 1 | 0 |
757 | { | - |
758 | | - |
759 | TPos min, max, y; | - |
760 | | - |
761 | | - |
762 | min = max = arc[0].y; | - |
763 | y = arc[1].y; | - |
764 | if ( y < min ) min = y; | 0 |
765 | if ( y > max ) max = y; | 0 |
766 | y = arc[2].y; | - |
767 | if ( y < min ) min = y; | 0 |
768 | if ( y > max ) max = y; | 0 |
769 | y = arc[3].y; | - |
770 | if ( y < min ) min = y; | 0 |
771 | if ( y > max ) max = y; | 0 |
772 | if ( ( (TCoord)( (min) >> 8 ) ) >= (*worker).max_ey || ( (TCoord)( (max) >> 8 ) ) < 0 ) never evaluated: ( (TCoord)( (min) >> 8 ) ) >= (*worker).max_ey never evaluated: ( (TCoord)( (max) >> 8 ) ) < 0 | 0 |
773 | goto Draw; never executed: goto Draw; | 0 |
774 | gray_split_cubic( arc ); | - |
775 | arc += 3; | - |
776 | top ++; | - |
777 | levels[top] = levels[top - 1] = level - 1; | - |
778 | continue; never executed: continue; | 0 |
779 | } | - |
780 | | - |
781 | Draw: code before this statement never executed: Draw: | 0 |
782 | { | - |
783 | TPos to_x, to_y, mid_x, mid_y; | - |
784 | | - |
785 | | - |
786 | to_x = arc[0].x; | - |
787 | to_y = arc[0].y; | - |
788 | mid_x = ( (*worker).x + to_x + 3 * ( arc[1].x + arc[2].x ) ) / 8; | - |
789 | mid_y = ( (*worker).y + to_y + 3 * ( arc[1].y + arc[2].y ) ) / 8; | - |
790 | | - |
791 | gray_render_line( worker, mid_x, mid_y ); | - |
792 | gray_render_line( worker, to_x, to_y ); | - |
793 | top --; | - |
794 | arc -= 3; | - |
795 | } | - |
796 | } | 0 |
797 | | - |
798 | return; | 0 |
799 | } | - |
800 | | - |
801 | | - |
802 | | - |
803 | static int | - |
804 | gray_move_to( const QT_FT_Vector* to, | - |
805 | PWorker worker ) | - |
806 | { | - |
807 | TPos x, y; | - |
808 | | - |
809 | | - |
810 | | - |
811 | gray_record_cell( worker ); | - |
812 | | - |
813 | | - |
814 | x = ( (to->x) << ( 8 - 6 ) ); | - |
815 | y = ( (to->y) << ( 8 - 6 ) ); | - |
816 | | - |
817 | gray_start_cell( worker, ( (TCoord)( (x) >> 8 ) ), ( (TCoord)( (y) >> 8 ) ) ); | - |
818 | | - |
819 | worker->x = x; | - |
820 | worker->y = y; | - |
821 | return 0; executed: return 0; Execution Count:50275 | 50275 |
822 | } | - |
823 | | - |
824 | static void | - |
825 | gray_render_span( int count, | - |
826 | const QT_FT_Span* spans, | - |
827 | PWorker worker ) | - |
828 | { | - |
829 | unsigned char* p; | - |
830 | QT_FT_Bitmap* map = &worker->target; | - |
831 | | - |
832 | for ( ; count > 0; count--, spans++ ) never evaluated: count > 0 | 0 |
833 | { | - |
834 | unsigned char coverage = spans->coverage; | - |
835 | | - |
836 | | - |
837 | p = (unsigned char*)map->buffer - spans->y * map->pitch; | - |
838 | if ( map->pitch >= 0 ) never evaluated: map->pitch >= 0 | 0 |
839 | p += ( map->rows - 1 ) * map->pitch; never executed: p += ( map->rows - 1 ) * map->pitch; | 0 |
840 | | - |
841 | | - |
842 | if ( coverage ) never evaluated: coverage | 0 |
843 | { | - |
844 | | - |
845 | | - |
846 | | - |
847 | | - |
848 | if ( spans->len >= 8 ) never evaluated: spans->len >= 8 | 0 |
849 | memset( p + spans->x, (unsigned char)coverage, spans->len ); never executed: memset( p + spans->x, (unsigned char)coverage, spans->len ); | 0 |
850 | else | - |
851 | { | - |
852 | unsigned char* q = p + spans->x; | - |
853 | | - |
854 | | - |
855 | switch ( spans->len ) | - |
856 | { | - |
857 | case 7: *q++ = (unsigned char)coverage; | - |
858 | case 6: *q++ = (unsigned char)coverage; code before this statement never executed: case 6: | 0 |
859 | case 5: *q++ = (unsigned char)coverage; code before this statement never executed: case 5: | 0 |
860 | case 4: *q++ = (unsigned char)coverage; code before this statement never executed: case 4: | 0 |
861 | case 3: *q++ = (unsigned char)coverage; code before this statement never executed: case 3: | 0 |
862 | case 2: *q++ = (unsigned char)coverage; code before this statement never executed: case 2: | 0 |
863 | case 1: *q = (unsigned char)coverage; code before this statement never executed: case 1: | 0 |
864 | default: code before this statement never executed: default: | 0 |
865 | ; | - |
866 | } | 0 |
867 | } | 0 |
868 | } | - |
869 | } | 0 |
870 | } | 0 |
871 | | - |
872 | | - |
873 | static void | - |
874 | gray_hline( PWorker worker, TCoord x, | - |
875 | TCoord y, | - |
876 | TPos area, | - |
877 | int acount ) | - |
878 | { | - |
879 | QT_FT_Span* span; | - |
880 | int coverage; | - |
881 | int skip; | - |
882 | | - |
883 | | - |
884 | | - |
885 | | - |
886 | | - |
887 | | - |
888 | | - |
889 | coverage = (int)( area >> ( 8 * 2 + 1 - 8 ) ); | - |
890 | | - |
891 | if ( coverage < 0 ) evaluated: coverage < 0 yes Evaluation Count:78914 | yes Evaluation Count:1819 |
| 1819-78914 |
892 | coverage = -coverage; executed: coverage = -coverage; Execution Count:78914 | 78914 |
893 | | - |
894 | if ( (*worker).outline.flags & 0x2 ) evaluated: (*worker).outline.flags & 0x2 yes Evaluation Count:50824 | yes Evaluation Count:29909 |
| 29909-50824 |
895 | { | - |
896 | coverage &= 511; | - |
897 | | - |
898 | if ( coverage > 256 ) partially evaluated: coverage > 256 no Evaluation Count:0 | yes Evaluation Count:50824 |
| 0-50824 |
899 | coverage = 512 - coverage; never executed: coverage = 512 - coverage; | 0 |
900 | else if ( coverage == 256 ) evaluated: coverage == 256 yes Evaluation Count:38431 | yes Evaluation Count:12393 |
| 12393-38431 |
901 | coverage = 255; executed: coverage = 255; Execution Count:38431 | 38431 |
902 | } | - |
903 | else | - |
904 | { | - |
905 | | - |
906 | if ( coverage >= 256 ) evaluated: coverage >= 256 yes Evaluation Count:9857 | yes Evaluation Count:20052 |
| 9857-20052 |
907 | coverage = 255; executed: coverage = 255; Execution Count:9857 | 9857 |
908 | } executed: } Execution Count:29909 | 29909 |
909 | | - |
910 | y += (TCoord)(*worker).min_ey; | - |
911 | x += (TCoord)(*worker).min_ex; | - |
912 | | - |
913 | | - |
914 | if ( x >= 32768 ) partially evaluated: x >= 32768 no Evaluation Count:0 | yes Evaluation Count:80733 |
| 0-80733 |
915 | x = 32767; never executed: x = 32767; | 0 |
916 | | - |
917 | if ( coverage ) evaluated: coverage yes Evaluation Count:80712 | yes Evaluation Count:21 |
| 21-80712 |
918 | { | - |
919 | | - |
920 | span = (*worker).gray_spans + (*worker).num_gray_spans - 1; | - |
921 | if ( (*worker).num_gray_spans > 0 && evaluated: (*worker).num_gray_spans > 0 yes Evaluation Count:64172 | yes Evaluation Count:16540 |
| 16540-64172 |
922 | span->y == y && evaluated: span->y == y yes Evaluation Count:47454 | yes Evaluation Count:16718 |
| 16718-47454 |
923 | (int)span->x + span->len == (int)x && evaluated: (int)span->x + span->len == (int)x yes Evaluation Count:34531 | yes Evaluation Count:12923 |
| 12923-34531 |
924 | span->coverage == coverage ) evaluated: span->coverage == coverage yes Evaluation Count:3134 | yes Evaluation Count:31397 |
| 3134-31397 |
925 | { | - |
926 | span->len = (unsigned short)( span->len + acount ); | - |
927 | return; executed: return; Execution Count:3134 | 3134 |
928 | } | - |
929 | | - |
930 | if ( (*worker).num_gray_spans >= 256 ) evaluated: (*worker).num_gray_spans >= 256 yes Evaluation Count:102 | yes Evaluation Count:77476 |
| 102-77476 |
931 | { | - |
932 | if ( (*worker).render_span && (*worker).num_gray_spans > (*worker).skip_spans ) partially evaluated: (*worker).render_span yes Evaluation Count:102 | no Evaluation Count:0 |
partially evaluated: (*worker).num_gray_spans > (*worker).skip_spans yes Evaluation Count:102 | no Evaluation Count:0 |
| 0-102 |
933 | { | - |
934 | skip = (*worker).skip_spans > 0 ? (*worker).skip_spans : 0; partially evaluated: (*worker).skip_spans > 0 no Evaluation Count:0 | yes Evaluation Count:102 |
| 0-102 |
935 | (*worker).render_span( (*worker).num_gray_spans - skip, | - |
936 | (*worker).gray_spans + skip, | - |
937 | (*worker).render_span_data ); | - |
938 | } executed: } Execution Count:102 | 102 |
939 | | - |
940 | (*worker).skip_spans -= (*worker).num_gray_spans; | - |
941 | (*worker).num_gray_spans = 0; | - |
942 | | - |
943 | span = (*worker).gray_spans; | - |
944 | } executed: } Execution Count:102 | 102 |
945 | else | - |
946 | span++; executed: span++; Execution Count:77476 | 77476 |
947 | | - |
948 | | - |
949 | span->x = (short)x; | - |
950 | span->len = (unsigned short)acount; | - |
951 | span->y = (short)y; | - |
952 | span->coverage = (unsigned char)coverage; | - |
953 | | - |
954 | (*worker).num_gray_spans++; | - |
955 | } executed: } Execution Count:77578 | 77578 |
956 | } executed: } Execution Count:77599 | 77599 |
957 | static void | - |
958 | gray_sweep( PWorker worker, const QT_FT_Bitmap* target ) | - |
959 | { | - |
960 | int yindex; | - |
961 | | - |
962 | (target) = (target); | - |
963 | | - |
964 | | - |
965 | if ( (*worker).num_cells == 0 ) evaluated: (*worker).num_cells == 0 yes Evaluation Count:3 | yes Evaluation Count:16800 |
| 3-16800 |
966 | return; executed: return; Execution Count:3 | 3 |
967 | | - |
968 | for ( yindex = 0; yindex < (*worker).ycount; yindex++ ) evaluated: yindex < (*worker).ycount yes Evaluation Count:41536 | yes Evaluation Count:16800 |
| 16800-41536 |
969 | { | - |
970 | PCell cell = (*worker).ycells[yindex]; | - |
971 | TCoord cover = 0; | - |
972 | TCoord x = 0; | - |
973 | | - |
974 | | - |
975 | for ( ; cell != ((void *)0); cell = cell->next ) evaluated: cell != ((void *)0) yes Evaluation Count:77214 | yes Evaluation Count:41536 |
| 41536-77214 |
976 | { | - |
977 | TArea area; | - |
978 | | - |
979 | | - |
980 | if ( cell->x > x && cover != 0 ) evaluated: cell->x > x yes Evaluation Count:19010 | yes Evaluation Count:58204 |
evaluated: cover != 0 yes Evaluation Count:10769 | yes Evaluation Count:8241 |
| 8241-58204 |
981 | gray_hline( worker, x, yindex, cover * ( ( 1L << 8 ) * 2 ), | 10769 |
982 | cell->x - x ); executed: gray_hline( worker, x, yindex, cover * ( ( 1L << 8 ) * 2 ), cell->x - x ); Execution Count:10769 | 10769 |
983 | | - |
984 | cover += cell->cover; | - |
985 | area = cover * ( ( 1L << 8 ) * 2 ) - cell->area; | - |
986 | | - |
987 | if ( area != 0 && cell->x >= 0 ) evaluated: area != 0 yes Evaluation Count:68473 | yes Evaluation Count:8741 |
evaluated: cell->x >= 0 yes Evaluation Count:67822 | yes Evaluation Count:651 |
| 651-68473 |
988 | gray_hline( worker, cell->x, yindex, area, 1 ); executed: gray_hline( worker, cell->x, yindex, area, 1 ); Execution Count:67822 | 67822 |
989 | | - |
990 | x = cell->x + 1; | - |
991 | } executed: } Execution Count:77214 | 77214 |
992 | | - |
993 | if ( (*worker).count_ex > x && cover != 0 ) evaluated: (*worker).count_ex > x yes Evaluation Count:13686 | yes Evaluation Count:27850 |
evaluated: cover != 0 yes Evaluation Count:2142 | yes Evaluation Count:11544 |
| 2142-27850 |
994 | gray_hline( worker, x, yindex, cover * ( ( 1L << 8 ) * 2 ), | 2142 |
995 | (*worker).count_ex - x ); executed: gray_hline( worker, x, yindex, cover * ( ( 1L << 8 ) * 2 ), (*worker).count_ex - x ); Execution Count:2142 | 2142 |
996 | } executed: } Execution Count:41536 | 41536 |
997 | } executed: } Execution Count:16800 | 16800 |
998 | static | - |
999 | int QT_FT_Outline_Decompose( const QT_FT_Outline* outline, | - |
1000 | void* user ) | - |
1001 | { | - |
1002 | | - |
1003 | | - |
1004 | | - |
1005 | QT_FT_Vector v_last; | - |
1006 | QT_FT_Vector v_control; | - |
1007 | QT_FT_Vector v_start; | - |
1008 | | - |
1009 | QT_FT_Vector* point; | - |
1010 | QT_FT_Vector* limit; | - |
1011 | char* tags; | - |
1012 | | - |
1013 | int n; | - |
1014 | int first; | - |
1015 | int error; | - |
1016 | char tag; | - |
1017 | | - |
1018 | first = 0; | - |
1019 | | - |
1020 | for ( n = 0; n < outline->n_contours; n++ ) evaluated: n < outline->n_contours yes Evaluation Count:50275 | yes Evaluation Count:16803 |
| 16803-50275 |
1021 | { | - |
1022 | int last; | - |
1023 | | - |
1024 | | - |
1025 | last = outline->contours[n]; | - |
1026 | limit = outline->points + last; | - |
1027 | | - |
1028 | v_start = outline->points[first]; | - |
1029 | v_last = outline->points[last]; | - |
1030 | | - |
1031 | v_start.x = (v_start.x); | - |
1032 | v_start.y = (v_start.y); | - |
1033 | | - |
1034 | v_last.x = (v_last.x); | - |
1035 | v_last.y = (v_last.y); | - |
1036 | | - |
1037 | v_control = v_start; | - |
1038 | | - |
1039 | point = outline->points + first; | - |
1040 | tags = outline->tags + first; | - |
1041 | tag = ( tags[0] & 3 ); | - |
1042 | | - |
1043 | | - |
1044 | if ( tag == 2 ) partially evaluated: tag == 2 no Evaluation Count:0 | yes Evaluation Count:50275 |
| 0-50275 |
1045 | goto Invalid_Outline; never executed: goto Invalid_Outline; | 0 |
1046 | | - |
1047 | | - |
1048 | if ( tag == 0 ) partially evaluated: tag == 0 no Evaluation Count:0 | yes Evaluation Count:50275 |
| 0-50275 |
1049 | { | - |
1050 | | - |
1051 | if ( ( outline->tags[last] & 3 ) == 1 ) never evaluated: ( outline->tags[last] & 3 ) == 1 | 0 |
1052 | { | - |
1053 | | - |
1054 | v_start = v_last; | - |
1055 | limit--; | - |
1056 | } | 0 |
1057 | else | - |
1058 | { | - |
1059 | | - |
1060 | | - |
1061 | | - |
1062 | v_start.x = ( v_start.x + v_last.x ) / 2; | - |
1063 | v_start.y = ( v_start.y + v_last.y ) / 2; | - |
1064 | | - |
1065 | v_last = v_start; | - |
1066 | } | 0 |
1067 | point--; | - |
1068 | tags--; | - |
1069 | } | 0 |
1070 | | - |
1071 | error = gray_move_to( &v_start, user ); | - |
1072 | if ( error ) partially evaluated: error no Evaluation Count:0 | yes Evaluation Count:50275 |
| 0-50275 |
1073 | goto Exit; never executed: goto Exit; | 0 |
1074 | | - |
1075 | while ( point < limit ) evaluated: point < limit yes Evaluation Count:757223 | yes Evaluation Count:50209 |
| 50209-757223 |
1076 | { | - |
1077 | point++; | - |
1078 | tags++; | - |
1079 | | - |
1080 | tag = ( tags[0] & 3 ); | - |
1081 | switch ( tag ) | - |
1082 | { | - |
1083 | case 1: | - |
1084 | { | - |
1085 | QT_FT_Vector vec; | - |
1086 | | - |
1087 | | - |
1088 | vec.x = (point->x); | - |
1089 | vec.y = (point->y); | - |
1090 | | - |
1091 | gray_render_line(user, ( (vec.x) << ( 8 - 6 ) ), ( (vec.y) << ( 8 - 6 ) )); | - |
1092 | continue; executed: continue; Execution Count:757157 | 757157 |
1093 | } | - |
1094 | | - |
1095 | case 0: | - |
1096 | { | - |
1097 | v_control.x = (point->x); | - |
1098 | v_control.y = (point->y); | - |
1099 | | - |
1100 | Do_Conic: code before this statement never executed: Do_Conic: | 0 |
1101 | if ( point < limit ) never evaluated: point < limit | 0 |
1102 | { | - |
1103 | QT_FT_Vector vec; | - |
1104 | QT_FT_Vector v_middle; | - |
1105 | | - |
1106 | | - |
1107 | point++; | - |
1108 | tags++; | - |
1109 | tag = ( tags[0] & 3 ); | - |
1110 | | - |
1111 | vec.x = (point->x); | - |
1112 | vec.y = (point->y); | - |
1113 | | - |
1114 | if ( tag == 1 ) never evaluated: tag == 1 | 0 |
1115 | { | - |
1116 | gray_render_conic(user, &v_control, &vec); | - |
1117 | continue; never executed: continue; | 0 |
1118 | } | - |
1119 | | - |
1120 | if ( tag != 0 ) never evaluated: tag != 0 | 0 |
1121 | goto Invalid_Outline; never executed: goto Invalid_Outline; | 0 |
1122 | | - |
1123 | v_middle.x = ( v_control.x + vec.x ) / 2; | - |
1124 | v_middle.y = ( v_control.y + vec.y ) / 2; | - |
1125 | | - |
1126 | gray_render_conic(user, &v_control, &v_middle); | - |
1127 | v_control = vec; | - |
1128 | goto Do_Conic; never executed: goto Do_Conic; | 0 |
1129 | } | - |
1130 | | - |
1131 | gray_render_conic(user, &v_control, &v_start); | - |
1132 | goto Close; never executed: goto Close; | 0 |
1133 | } | - |
1134 | | - |
1135 | default: | - |
1136 | { | - |
1137 | QT_FT_Vector vec1, vec2; | - |
1138 | | - |
1139 | | - |
1140 | if ( point + 1 > limit || never evaluated: point + 1 > limit | 0 |
1141 | ( tags[1] & 3 ) != 2 ) never evaluated: ( tags[1] & 3 ) != 2 | 0 |
1142 | goto Invalid_Outline; never executed: goto Invalid_Outline; | 0 |
1143 | | - |
1144 | point += 2; | - |
1145 | tags += 2; | - |
1146 | | - |
1147 | vec1.x = (point[-2].x); | - |
1148 | vec1.y = (point[-2].y); | - |
1149 | | - |
1150 | vec2.x = (point[-1].x); | - |
1151 | vec2.y = (point[-1].y); | - |
1152 | | - |
1153 | if ( point <= limit ) never evaluated: point <= limit | 0 |
1154 | { | - |
1155 | QT_FT_Vector vec; | - |
1156 | | - |
1157 | | - |
1158 | vec.x = (point->x); | - |
1159 | vec.y = (point->y); | - |
1160 | | - |
1161 | gray_render_cubic(user, &vec1, &vec2, &vec); | - |
1162 | continue; never executed: continue; | 0 |
1163 | } | - |
1164 | | - |
1165 | gray_render_cubic(user, &vec1, &vec2, &v_start); | - |
1166 | goto Close; never executed: goto Close; | 0 |
1167 | } | - |
1168 | } | - |
1169 | } | 0 |
1170 | | - |
1171 | | - |
1172 | gray_render_line(user, ( (v_start.x) << ( 8 - 6 ) ), ( (v_start.y) << ( 8 - 6 ) )); | - |
1173 | | - |
1174 | Close: code before this statement executed: Close: Execution Count:50209 | 50209 |
1175 | first = last + 1; | - |
1176 | } executed: } Execution Count:50209 | 50209 |
1177 | | - |
1178 | return 0; executed: return 0; Execution Count:16803 | 16803 |
1179 | | - |
1180 | Exit: | - |
1181 | return error; never executed: return error; | 0 |
1182 | | - |
1183 | Invalid_Outline: | - |
1184 | return -1; never executed: return -1; | 0 |
1185 | } | - |
1186 | | - |
1187 | typedef struct TBand_ | - |
1188 | { | - |
1189 | TPos min, max; | - |
1190 | | - |
1191 | } TBand; | - |
1192 | | - |
1193 | | - |
1194 | static int | - |
1195 | gray_convert_glyph_inner( PWorker worker ) | - |
1196 | { | - |
1197 | volatile int error = 0; | - |
1198 | | - |
1199 | if ( _setjmp ((*worker).jump_buffer) == 0 ) evaluated: _setjmp ((*worker).jump_buffer) == 0 yes Evaluation Count:16869 | yes Evaluation Count:66 |
| 66-16869 |
1200 | { | - |
1201 | error = QT_FT_Outline_Decompose( &(*worker).outline, &(*worker) ); | - |
1202 | gray_record_cell( worker ); | - |
1203 | } executed: } Execution Count:16803 | 16803 |
1204 | else | - |
1205 | { | - |
1206 | error = -4; | - |
1207 | } executed: } Execution Count:66 | 66 |
1208 | | - |
1209 | return error; executed: return error; Execution Count:16869 | 16869 |
1210 | } | - |
1211 | | - |
1212 | | - |
1213 | static int | - |
1214 | gray_convert_glyph( PWorker worker ) | - |
1215 | { | - |
1216 | TBand bands[40]; | - |
1217 | TBand* volatile band; | - |
1218 | int volatile n, num_bands; | - |
1219 | TPos volatile min, max, max_y; | - |
1220 | QT_FT_BBox* clip; | - |
1221 | int skip; | - |
1222 | | - |
1223 | (*worker).num_gray_spans = 0; | - |
1224 | | - |
1225 | | - |
1226 | gray_compute_cbox( worker ); | - |
1227 | | - |
1228 | | - |
1229 | clip = &(*worker).clip_box; | - |
1230 | | - |
1231 | if ( (*worker).max_ex <= clip->xMin || (*worker).min_ex >= clip->xMax || partially evaluated: (*worker).max_ex <= clip->xMin no Evaluation Count:0 | yes Evaluation Count:16545 |
evaluated: (*worker).min_ex >= clip->xMax yes Evaluation Count:5 | yes Evaluation Count:16540 |
| 0-16545 |
1232 | (*worker).max_ey <= clip->yMin || (*worker).min_ey >= clip->yMax ) partially evaluated: (*worker).max_ey <= clip->yMin no Evaluation Count:0 | yes Evaluation Count:16540 |
partially evaluated: (*worker).min_ey >= clip->yMax no Evaluation Count:0 | yes Evaluation Count:16540 |
| 0-16540 |
1233 | return 0; executed: return 0; Execution Count:5 | 5 |
1234 | | - |
1235 | if ( (*worker).min_ex < clip->xMin ) (*worker).min_ex = clip->xMin; executed: (*worker).min_ex = clip->xMin; Execution Count:11 evaluated: (*worker).min_ex < clip->xMin yes Evaluation Count:11 | yes Evaluation Count:16529 |
| 11-16529 |
1236 | if ( (*worker).min_ey < clip->yMin ) (*worker).min_ey = clip->yMin; executed: (*worker).min_ey = clip->yMin; Execution Count:6 evaluated: (*worker).min_ey < clip->yMin yes Evaluation Count:6 | yes Evaluation Count:16534 |
| 6-16534 |
1237 | | - |
1238 | if ( (*worker).max_ex > clip->xMax ) (*worker).max_ex = clip->xMax; executed: (*worker).max_ex = clip->xMax; Execution Count:8208 evaluated: (*worker).max_ex > clip->xMax yes Evaluation Count:8208 | yes Evaluation Count:8332 |
| 8208-8332 |
1239 | if ( (*worker).max_ey > clip->yMax ) (*worker).max_ey = clip->yMax; executed: (*worker).max_ey = clip->yMax; Execution Count:8221 evaluated: (*worker).max_ey > clip->yMax yes Evaluation Count:8221 | yes Evaluation Count:8319 |
| 8221-8319 |
1240 | | - |
1241 | (*worker).count_ex = (*worker).max_ex - (*worker).min_ex; | - |
1242 | (*worker).count_ey = (*worker).max_ey - (*worker).min_ey; | - |
1243 | | - |
1244 | | - |
1245 | | - |
1246 | | - |
1247 | (*worker).conic_level = 32; | - |
1248 | (*worker).cubic_level = 16; | - |
1249 | | - |
1250 | { | - |
1251 | int level = 0; | - |
1252 | | - |
1253 | | - |
1254 | if ( (*worker).count_ex > 24 || (*worker).count_ey > 24 ) evaluated: (*worker).count_ex > 24 yes Evaluation Count:147 | yes Evaluation Count:16393 |
partially evaluated: (*worker).count_ey > 24 no Evaluation Count:0 | yes Evaluation Count:16393 |
| 0-16393 |
1255 | level++; executed: level++; Execution Count:147 | 147 |
1256 | if ( (*worker).count_ex > 120 || (*worker).count_ey > 120 ) evaluated: (*worker).count_ex > 120 yes Evaluation Count:38 | yes Evaluation Count:16502 |
evaluated: (*worker).count_ey > 120 yes Evaluation Count:3 | yes Evaluation Count:16499 |
| 3-16502 |
1257 | level++; executed: level++; Execution Count:41 | 41 |
1258 | | - |
1259 | (*worker).conic_level <<= level; | - |
1260 | (*worker).cubic_level <<= level; | - |
1261 | } | - |
1262 | | - |
1263 | | - |
1264 | num_bands = (int)( ( (*worker).max_ey - (*worker).min_ey ) / (*worker).band_size ); | - |
1265 | if ( num_bands == 0 ) num_bands = 1; executed: num_bands = 1; Execution Count:16416 evaluated: num_bands == 0 yes Evaluation Count:16416 | yes Evaluation Count:124 |
| 124-16416 |
1266 | if ( num_bands >= 39 ) num_bands = 39; never executed: num_bands = 39; partially evaluated: num_bands >= 39 no Evaluation Count:0 | yes Evaluation Count:16540 |
| 0-16540 |
1267 | | - |
1268 | (*worker).band_shoot = 0; | - |
1269 | | - |
1270 | min = (*worker).min_ey; | - |
1271 | max_y = (*worker).max_ey; | - |
1272 | | - |
1273 | for ( n = 0; n < num_bands; n++, min = max ) evaluated: n < num_bands yes Evaluation Count:16737 | yes Evaluation Count:16540 |
| 16540-16737 |
1274 | { | - |
1275 | max = min + (*worker).band_size; | - |
1276 | if ( n == num_bands - 1 || max > max_y ) evaluated: n == num_bands - 1 yes Evaluation Count:16540 | yes Evaluation Count:197 |
partially evaluated: max > max_y no Evaluation Count:0 | yes Evaluation Count:197 |
| 0-16540 |
1277 | max = max_y; executed: max = max_y; Execution Count:16540 | 16540 |
1278 | | - |
1279 | bands[0].min = min; | - |
1280 | bands[0].max = max; | - |
1281 | band = bands; | - |
1282 | | - |
1283 | while ( band >= bands ) evaluated: band >= bands yes Evaluation Count:16869 | yes Evaluation Count:16737 |
| 16737-16869 |
1284 | { | - |
1285 | TPos bottom, top, middle; | - |
1286 | int error; | - |
1287 | | - |
1288 | { | - |
1289 | PCell cells_max; | - |
1290 | int yindex; | - |
1291 | int cell_start, cell_end, cell_mod; | - |
1292 | | - |
1293 | | - |
1294 | (*worker).ycells = (PCell*)(*worker).buffer; | - |
1295 | (*worker).ycount = band->max - band->min; | - |
1296 | | - |
1297 | cell_start = sizeof ( PCell ) * (*worker).ycount; | - |
1298 | cell_mod = cell_start % sizeof ( TCell ); | - |
1299 | if ( cell_mod > 0 ) evaluated: cell_mod > 0 yes Evaluation Count:8359 | yes Evaluation Count:8510 |
| 8359-8510 |
1300 | cell_start += sizeof ( TCell ) - cell_mod; executed: cell_start += sizeof ( TCell ) - cell_mod; Execution Count:8359 | 8359 |
1301 | | - |
1302 | cell_end = (*worker).buffer_size; | - |
1303 | cell_end -= cell_end % sizeof( TCell ); | - |
1304 | | - |
1305 | cells_max = (PCell)( (char*)(*worker).buffer + cell_end ); | - |
1306 | (*worker).cells = (PCell)( (char*)(*worker).buffer + cell_start ); | - |
1307 | if ( (*worker).cells >= cells_max ) partially evaluated: (*worker).cells >= cells_max no Evaluation Count:0 | yes Evaluation Count:16869 |
| 0-16869 |
1308 | goto ReduceBands; never executed: goto ReduceBands; | 0 |
1309 | | - |
1310 | (*worker).max_cells = (int)(cells_max - (*worker).cells); | - |
1311 | if ( (*worker).max_cells < 2 ) partially evaluated: (*worker).max_cells < 2 no Evaluation Count:0 | yes Evaluation Count:16869 |
| 0-16869 |
1312 | goto ReduceBands; never executed: goto ReduceBands; | 0 |
1313 | | - |
1314 | for ( yindex = 0; yindex < (*worker).ycount; yindex++ ) evaluated: yindex < (*worker).ycount yes Evaluation Count:43193 | yes Evaluation Count:16869 |
| 16869-43193 |
1315 | (*worker).ycells[yindex] = ((void *)0); executed: (*worker).ycells[yindex] = ((void *)0); Execution Count:43193 | 43193 |
1316 | } | - |
1317 | | - |
1318 | (*worker).num_cells = 0; | - |
1319 | (*worker).invalid = 1; | - |
1320 | (*worker).min_ey = band->min; | - |
1321 | (*worker).max_ey = band->max; | - |
1322 | (*worker).count_ey = band->max - band->min; | - |
1323 | | - |
1324 | error = gray_convert_glyph_inner( worker ); | - |
1325 | | - |
1326 | if ( !error ) evaluated: !error yes Evaluation Count:16803 | yes Evaluation Count:66 |
| 66-16803 |
1327 | { | - |
1328 | gray_sweep( worker, &(*worker).target ); | - |
1329 | band--; | - |
1330 | continue; executed: continue; Execution Count:16803 | 16803 |
1331 | } | - |
1332 | else if ( error != -4 ) partially evaluated: error != -4 no Evaluation Count:0 | yes Evaluation Count:66 |
| 0-66 |
1333 | return 1; never executed: return 1; | 0 |
1334 | | - |
1335 | ReduceBands: code before this statement executed: ReduceBands: Execution Count:66 | 66 |
1336 | | - |
1337 | bottom = band->min; | - |
1338 | top = band->max; | - |
1339 | middle = bottom + ( ( top - bottom ) >> 1 ); | - |
1340 | | - |
1341 | | - |
1342 | | - |
1343 | if ( middle == bottom ) partially evaluated: middle == bottom no Evaluation Count:0 | yes Evaluation Count:66 |
| 0-66 |
1344 | { | - |
1345 | | - |
1346 | | - |
1347 | | - |
1348 | return -6; never executed: return -6; | 0 |
1349 | } | - |
1350 | | - |
1351 | if ( bottom-top >= (*worker).band_size ) partially evaluated: bottom-top >= (*worker).band_size no Evaluation Count:0 | yes Evaluation Count:66 |
| 0-66 |
1352 | (*worker).band_shoot++; never executed: (*worker).band_shoot++; | 0 |
1353 | | - |
1354 | band[1].min = bottom; | - |
1355 | band[1].max = middle; | - |
1356 | band[0].min = middle; | - |
1357 | band[0].max = top; | - |
1358 | band++; | - |
1359 | } executed: } Execution Count:66 | 66 |
1360 | } executed: } Execution Count:16737 | 16737 |
1361 | | - |
1362 | if ( (*worker).render_span && (*worker).num_gray_spans > (*worker).skip_spans ) partially evaluated: (*worker).render_span yes Evaluation Count:16540 | no Evaluation Count:0 |
partially evaluated: (*worker).num_gray_spans > (*worker).skip_spans yes Evaluation Count:16540 | no Evaluation Count:0 |
| 0-16540 |
1363 | { | - |
1364 | skip = (*worker).skip_spans > 0 ? (*worker).skip_spans : 0; partially evaluated: (*worker).skip_spans > 0 no Evaluation Count:0 | yes Evaluation Count:16540 |
| 0-16540 |
1365 | (*worker).render_span( (*worker).num_gray_spans - skip, | - |
1366 | (*worker).gray_spans + skip, | - |
1367 | (*worker).render_span_data ); | - |
1368 | } executed: } Execution Count:16540 | 16540 |
1369 | | - |
1370 | (*worker).skip_spans -= (*worker).num_gray_spans; | - |
1371 | | - |
1372 | if ( (*worker).band_shoot > 8 && (*worker).band_size > 16 ) partially evaluated: (*worker).band_shoot > 8 no Evaluation Count:0 | yes Evaluation Count:16540 |
never evaluated: (*worker).band_size > 16 | 0-16540 |
1373 | (*worker).band_size = (*worker).band_size / 2; never executed: (*worker).band_size = (*worker).band_size / 2; | 0 |
1374 | | - |
1375 | return 0; executed: return 0; Execution Count:16540 | 16540 |
1376 | } | - |
1377 | | - |
1378 | | - |
1379 | static int | - |
1380 | gray_raster_render( QT_FT_Raster raster, | - |
1381 | const QT_FT_Raster_Params* params ) | - |
1382 | { | - |
1383 | const QT_FT_Outline* outline = (const QT_FT_Outline*)params->source; | - |
1384 | const QT_FT_Bitmap* target_map = params->target; | - |
1385 | PWorker worker; | - |
1386 | | - |
1387 | | - |
1388 | if ( !raster || !raster->buffer || !raster->buffer_size ) partially evaluated: !raster no Evaluation Count:0 | yes Evaluation Count:16545 |
partially evaluated: !raster->buffer no Evaluation Count:0 | yes Evaluation Count:16545 |
partially evaluated: !raster->buffer_size no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
1389 | return -3; never executed: return -3; | 0 |
1390 | | - |
1391 | if ( raster->worker ) partially evaluated: raster->worker yes Evaluation Count:16545 | no Evaluation Count:0 |
| 0-16545 |
1392 | raster->worker->skip_spans = params->skip_spans; executed: raster->worker->skip_spans = params->skip_spans; Execution Count:16545 | 16545 |
1393 | | - |
1394 | | - |
1395 | | - |
1396 | | - |
1397 | if (raster->buffer_allocated_size < 8192 ) partially evaluated: raster->buffer_allocated_size < 8192 no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
1398 | return -6; never executed: return -6; | 0 |
1399 | | - |
1400 | | - |
1401 | if ( outline->n_points == 0 || outline->n_contours <= 0 ) partially evaluated: outline->n_points == 0 no Evaluation Count:0 | yes Evaluation Count:16545 |
partially evaluated: outline->n_contours <= 0 no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
1402 | return 0; never executed: return 0; | 0 |
1403 | | - |
1404 | if ( !outline || !outline->contours || !outline->points ) partially evaluated: !outline no Evaluation Count:0 | yes Evaluation Count:16545 |
partially evaluated: !outline->contours no Evaluation Count:0 | yes Evaluation Count:16545 |
partially evaluated: !outline->points no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
1405 | return -1; never executed: return -1; | 0 |
1406 | | - |
1407 | if ( outline->n_points != | 0-16545 |
1408 | outline->contours[outline->n_contours - 1] + 1 ) partially evaluated: outline->n_points != outline->contours[outline->n_contours - 1] + 1 no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
1409 | return -1; never executed: return -1; | 0 |
1410 | | - |
1411 | worker = raster->worker; | - |
1412 | | - |
1413 | | - |
1414 | if ( ( params->flags & 0x2 ) == 0 ) partially evaluated: ( params->flags & 0x2 ) == 0 no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
1415 | { | - |
1416 | if ( !target_map ) never evaluated: !target_map | 0 |
1417 | return -3; never executed: return -3; | 0 |
1418 | | - |
1419 | | - |
1420 | if ( !target_map->width || !target_map->rows ) never evaluated: !target_map->width never evaluated: !target_map->rows | 0 |
1421 | return 0; never executed: return 0; | 0 |
1422 | | - |
1423 | if ( !target_map->buffer ) never evaluated: !target_map->buffer | 0 |
1424 | return -3; never executed: return -3; | 0 |
1425 | } | 0 |
1426 | | - |
1427 | | - |
1428 | if ( !( params->flags & 0x1 ) ) partially evaluated: !( params->flags & 0x1 ) no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
1429 | return -2; never executed: return -2; | 0 |
1430 | | - |
1431 | | - |
1432 | if ( ( params->flags & 0x2 ) == 0 ) partially evaluated: ( params->flags & 0x2 ) == 0 no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
1433 | { | - |
1434 | | - |
1435 | (*worker).clip_box.xMin = 0; | - |
1436 | (*worker).clip_box.yMin = 0; | - |
1437 | (*worker).clip_box.xMax = target_map->width; | - |
1438 | (*worker).clip_box.yMax = target_map->rows; | - |
1439 | } | 0 |
1440 | else if ( params->flags & 0x4 ) partially evaluated: params->flags & 0x4 yes Evaluation Count:16545 | no Evaluation Count:0 |
| 0-16545 |
1441 | { | - |
1442 | (*worker).clip_box = params->clip_box; | - |
1443 | } executed: } Execution Count:16545 | 16545 |
1444 | else | - |
1445 | { | - |
1446 | (*worker).clip_box.xMin = -32768L; | - |
1447 | (*worker).clip_box.yMin = -32768L; | - |
1448 | (*worker).clip_box.xMax = 32767L; | - |
1449 | (*worker).clip_box.yMax = 32767L; | - |
1450 | } | 0 |
1451 | | - |
1452 | gray_init_cells( worker, raster->buffer, raster->buffer_size ); | - |
1453 | | - |
1454 | (*worker).outline = *outline; | - |
1455 | (*worker).num_cells = 0; | - |
1456 | (*worker).invalid = 1; | - |
1457 | (*worker).band_size = raster->band_size; | - |
1458 | | - |
1459 | if ( target_map ) partially evaluated: target_map no Evaluation Count:0 | yes Evaluation Count:16545 |
| 0-16545 |
1460 | (*worker).target = *target_map; never executed: (*worker).target = *target_map; | 0 |
1461 | | - |
1462 | (*worker).render_span = (QT_FT_SpanFunc)gray_render_span; | - |
1463 | (*worker).render_span_data = &(*worker); | - |
1464 | | - |
1465 | if ( params->flags & 0x2 ) partially evaluated: params->flags & 0x2 yes Evaluation Count:16545 | no Evaluation Count:0 |
| 0-16545 |
1466 | { | - |
1467 | (*worker).render_span = (QT_FT_SpanFunc)params->gray_spans; | - |
1468 | (*worker).render_span_data = params->user; | - |
1469 | } executed: } Execution Count:16545 | 16545 |
1470 | | - |
1471 | return gray_convert_glyph( worker ); executed: return gray_convert_glyph( worker ); Execution Count:16545 | 16545 |
1472 | } | - |
1473 | | - |
1474 | | - |
1475 | | - |
1476 | | - |
1477 | | - |
1478 | static int | - |
1479 | gray_raster_new( QT_FT_Raster* araster ) | - |
1480 | { | - |
1481 | *araster = malloc(sizeof(TRaster)); | - |
1482 | if (!*araster) { partially evaluated: !*araster no Evaluation Count:0 | yes Evaluation Count:5615 |
| 0-5615 |
1483 | *araster = 0; | - |
1484 | return -4; never executed: return -4; | 0 |
1485 | } | - |
1486 | memset( *araster, 0, sizeof(TRaster) ); | - |
1487 | | - |
1488 | return 0; executed: return 0; Execution Count:5615 | 5615 |
1489 | } | - |
1490 | | - |
1491 | | - |
1492 | static void | - |
1493 | gray_raster_done( QT_FT_Raster raster ) | - |
1494 | { | - |
1495 | free(raster); | - |
1496 | } executed: } Execution Count:5604 | 5604 |
1497 | | - |
1498 | | - |
1499 | static void | - |
1500 | gray_raster_reset( QT_FT_Raster raster, | - |
1501 | char* pool_base, | - |
1502 | long pool_size ) | - |
1503 | { | - |
1504 | PRaster rast = (PRaster)raster; | - |
1505 | | - |
1506 | if ( raster ) partially evaluated: raster yes Evaluation Count:16545 | no Evaluation Count:0 |
| 0-16545 |
1507 | { | - |
1508 | if ( pool_base && ( pool_size >= 8192 ) ) partially evaluated: pool_base yes Evaluation Count:16545 | no Evaluation Count:0 |
partially evaluated: ( pool_size >= 8192 ) yes Evaluation Count:16545 | no Evaluation Count:0 |
| 0-16545 |
1509 | { | - |
1510 | PWorker worker = (PWorker)pool_base; | - |
1511 | | - |
1512 | | - |
1513 | rast->worker = worker; | - |
1514 | rast->buffer = pool_base + | - |
1515 | ( ( sizeof ( TWorker ) + sizeof ( TCell ) - 1 ) & | - |
1516 | ~( sizeof ( TCell ) - 1 ) ); | - |
1517 | rast->buffer_size = (long)( ( pool_base + pool_size ) - | - |
1518 | (char*)rast->buffer ) & | - |
1519 | ~( sizeof ( TCell ) - 1 ); | - |
1520 | rast->band_size = (int)( rast->buffer_size / | - |
1521 | ( sizeof ( TCell ) * 8 ) ); | - |
1522 | } executed: } Execution Count:16545 | 16545 |
1523 | else if ( pool_base) never evaluated: pool_base | 0 |
1524 | { | - |
1525 | | - |
1526 | rast->buffer = pool_base; | - |
1527 | rast->worker = ((void *)0); | - |
1528 | rast->buffer_size = pool_size; | - |
1529 | } | 0 |
1530 | else | - |
1531 | { | - |
1532 | rast->buffer = ((void *)0); | - |
1533 | rast->buffer_size = 0; | - |
1534 | rast->worker = ((void *)0); | - |
1535 | } | 0 |
1536 | rast->buffer_allocated_size = pool_size; | - |
1537 | } executed: } Execution Count:16545 | 16545 |
1538 | } executed: } Execution Count:16545 | 16545 |
1539 | | - |
1540 | const QT_FT_Raster_Funcs qt_ft_grays_raster = | - |
1541 | { | - |
1542 | QT_FT_GLYPH_FORMAT_OUTLINE, | - |
1543 | | - |
1544 | (QT_FT_Raster_NewFunc) gray_raster_new, | - |
1545 | (QT_FT_Raster_ResetFunc) gray_raster_reset, | - |
1546 | (QT_FT_Raster_SetModeFunc)0, | - |
1547 | (QT_FT_Raster_RenderFunc) gray_raster_render, | - |
1548 | (QT_FT_Raster_DoneFunc) gray_raster_done | - |
1549 | }; | - |
1550 | | - |
| | |