Lines Matching defs:Edge
326 struct Edge {
337 Edge* fNext;
354 static void find_link(Edge* base, Edge* stop) {
357 if (base->fFlags == Edge::kCompleteLink) {
367 Edge* e = base;
368 if ((base->fFlags & Edge::kY0Link) == 0) {
371 if ((e->fFlags & Edge::kY1Link) == 0 && y0 == e->fY1) {
374 e->fFlags = SkToU8(e->fFlags | Edge::kY1Link);
381 if ((base->fFlags & Edge::kY1Link) == 0) {
384 if ((e->fFlags & Edge::kY0Link) == 0 && y1 == e->fY0) {
387 e->fFlags = SkToU8(e->fFlags | Edge::kY0Link);
393 base->fFlags = Edge::kCompleteLink;
396 static int extract_path(Edge* edge, Edge* stop, SkPath* path) {
397 while (0 == edge->fFlags) {
398 edge++; // skip over "used" edges
401 SkASSERT(edge < stop);
403 Edge* base = edge;
404 Edge* prev = edge;
405 edge = edge->fNext;
406 SkASSERT(edge != base);
412 if (prev->fX != edge->fX || prev->fY1 != edge->fY0) { // skip collinear
414 path->lineTo(SkIntToScalar(edge->fX), SkIntToScalar(edge->fY0)); // H
416 prev = edge;
417 edge = edge->fNext;
420 } while (edge != base);
428 static int EdgeProc(const Edge* a, const Edge* b) {
447 SkTDArray<Edge> edges;
450 Edge* edge = edges.append(2);
451 edge[0].set(r.fLeft, r.fBottom, r.fTop);
452 edge[1].set(r.fRight, r.fTop, r.fBottom);
454 SkQSort(edges.begin(), edges.count(), sizeof(Edge), (SkQSortCompareProc)EdgeProc);
457 Edge* start = edges.begin();
458 Edge* stop = start + count;
459 Edge* e;
468 SkASSERT(e->fFlags == Edge::kCompleteLink);