Lines Matching defs:cell
155 int cell;
190 /* A cell records the effect on pixel coverage of polygon edges
231 struct cell {
232 struct cell *next;
238 /* A cell list represents the scan line sparsely as cells ordered by
242 struct cell *cursor;
244 /* Points to the left-most cell in the scan line. */
245 struct cell head, tail;
249 struct cell *cells;
250 struct cell embedded[256];
268 /* Rewinds the cell list's cursor to the beginning. After rewinding
269 * we're good to cell_list_find() the cell any x coordinate. */
291 cells->cells = malloc(cells->size * sizeof(struct cell));
311 inline static struct cell *
313 struct cell *tail,
316 struct cell *cell;
319 cell = cells->cells + cells->count++;
320 cell->next = tail->next;
321 tail->next = cell;
323 cell->x = x;
324 cell->covered_height = 0;
325 cell->uncovered_area = 0;
326 return cell;
329 /* Find a cell at the given x-coordinate. Returns %NULL if a new cell
331 * non-decreasing x-coordinate until the cell list is rewound using
332 * cell_list_rewind(). Ownership of the returned cell is retained by
333 * the cell list. */
334 inline static struct cell *
337 struct cell *tail;
374 struct cell *cell;
387 cell = cell_list_find(cells, ix1);
389 cell->uncovered_area += 2*fx1;
390 ++cell->covered_height;
392 cell = cell_list_find(cells, ix2);
393 cell->uncovered_area -= 2*fx2;
394 --cell->covered_height;
396 cell->uncovered_area += 2*(fx1-fx2);
402 struct cell *cell;
412 cell = cell_list_find(cells, ix1);
414 cell->uncovered_area += 2*fx1*SAMPLES_Y;
415 cell->covered_height += SAMPLES_Y;
417 cell = cell_list_find(cells, ix2);
418 cell->uncovered_area -= 2*fx2*SAMPLES_Y;
419 cell->covered_height -= SAMPLES_Y;
421 cell->uncovered_area += 2*(fx1-fx2)*SAMPLES_Y;
541 e->cell = pixman_fixed_to_grid_x(edge->p1.x) + dx;
589 e->cell = edge_to_cell(e);
591 __DBG(("%s: x=%lld.%lld + %lld.%lld %lld -> cell=%d\n",
597 (long long)Ey, e->cell));
651 e->cell = pixman_fixed_to_grid_x(p1->x);
691 e->cell = edge_to_cell(e);
693 __DBG(("%s: x=%lld.%lld + %lld.%lld %lld -> cell=%d\n",
699 (long long)Ey, e->cell));
708 e->cell == prev->cell &&
730 active->head.cell = INT_MIN;
737 active->tail.cell = INT_MAX;
753 if (head_a->cell <= head_b->cell) {
762 x = head_b->cell;
763 while (head_a != NULL && head_a->cell <= x) {
775 x = head_a->cell;
776 while (head_b != NULL && head_b->cell <= x) {
804 if (list->cell <= head_other->cell) {
832 e->cell == n->cell &&
915 int winding = 0, xstart = edge->cell;
923 if (0 == winding && edge->next->cell != edge->cell) {
924 cell_list_add_subspan(coverages, xstart, edge->cell);
925 xstart = edge->next->cell;
931 edge->cell = edge_advance(edge);
933 if (edge->cell < prev_x) {
939 } while (edge->cell < pos->cell);
945 prev_x = edge->cell;
987 cell_list_add_span(coverages, left->cell, right->cell);
1120 struct cell *cell;
1132 for (cell = cells->head.next; cell != &cells->tail; cell = cell->next) {
1133 int x = cell->x;
1137 __DBG(("%s: cell=(%d, %d, %d), cover=%d\n", __FUNCTION__,
1138 cell->x, cell->covered_height, cell->uncovered_area,
1141 if (cell->covered_height || cell->uncovered_area) {
1152 cover += cell->covered_height*SAMPLES_X*2;
1155 if (cell->uncovered_area) {
1156 int area = cover - cell->uncovered_area;
1299 if (0 == winding && right->cell != right->next->cell)
1305 if (left->cell < 0) {
1307 } else if (left->cell >= width * SAMPLES_X) {
1311 SAMPLES_X_TO_INT_FRAC(left->cell, lix, lfx);
1313 if (right->cell < 0) {
1315 } else if (right->cell >= width * SAMPLES_X) {
1319 SAMPLES_X_TO_INT_FRAC(right->cell, rix, rfx);
1396 if (edge->cell < 0) {
1398 } else if (edge->cell >= width * SAMPLES_X) {
1402 SAMPLES_X_TO_INT_FRAC(edge->cell, lix, lfx);
1407 edge->cell = edge_advance(edge);
1409 if (edge->cell < prev_x) {
1415 } while (edge->cell < pos->cell);
1421 prev_x = edge->cell;
1431 if (0 == winding && edge->cell != next->cell)
1437 edge->cell = edge_advance(edge);
1439 if (edge->cell < prev_x) {
1445 } while (edge->cell < pos->cell);
1451 prev_x = edge->cell;
1460 if (edge->cell < 0) {
1462 } else if (edge->cell >= width * SAMPLES_X) {
1466 SAMPLES_X_TO_INT_FRAC(edge->cell, rix, rfx);
1471 edge->cell = edge_advance(edge);
1473 if (edge->cell < prev_x) {
1479 } while (edge->cell < pos->cell);
1485 prev_x = edge->cell;