Lines Matching defs:Edge
344 struct Edge {
355 Edge* fNext;
372 static void find_link(Edge* base, Edge* stop) {
375 if (base->fFlags == Edge::kCompleteLink) {
385 Edge* e = base;
386 if ((base->fFlags & Edge::kY0Link) == 0) {
389 if ((e->fFlags & Edge::kY1Link) == 0 && y0 == e->fY1) {
392 e->fFlags = SkToU8(e->fFlags | Edge::kY1Link);
399 if ((base->fFlags & Edge::kY1Link) == 0) {
402 if ((e->fFlags & Edge::kY0Link) == 0 && y1 == e->fY0) {
405 e->fFlags = SkToU8(e->fFlags | Edge::kY0Link);
411 base->fFlags = Edge::kCompleteLink;
414 static int extract_path(Edge* edge, Edge* stop, SkPath* path) {
415 while (0 == edge->fFlags) {
416 edge++; // skip over "used" edges
419 SkASSERT(edge < stop);
421 Edge* base = edge;
422 Edge* prev = edge;
423 edge = edge->fNext;
424 SkASSERT(edge != base);
430 if (prev->fX != edge->fX || prev->fY1 != edge->fY0) { // skip collinear
432 path->lineTo(SkIntToScalar(edge->fX), SkIntToScalar(edge->fY0)); // H
434 prev = edge;
435 edge = edge->fNext;
438 } while (edge != base);
446 static int EdgeProc(const Edge* a, const Edge* b) {
469 SkTDArray<Edge> edges;
472 Edge* edge = edges.append(2);
473 edge[0].set(r.fLeft, r.fBottom, r.fTop);
474 edge[1].set(r.fRight, r.fTop, r.fBottom);
476 qsort(edges.begin(), edges.count(), sizeof(Edge), SkCastForQSort(EdgeProc));
479 Edge* start = edges.begin();
480 Edge* stop = start + count;
481 Edge* e;
490 SkASSERT(e->fFlags == Edge::kCompleteLink);