static int check_linear(const SkDQuad& quad, int minX, int maxX, int minY, int maxY, SkDQuad& reduction) { if (!quad.isLinear(0, 2)) { return 0; } // four are colinear: return line formed by outside reduction[0] = quad[0]; reduction[1] = quad[2]; return reductionLineCount(reduction); }
static int check_linear(const SkDCubic& cubic, int minX, int maxX, int minY, int maxY, SkDCubic& reduction) { if (!cubic.isLinear(0, 3)) { return 0; } // four are colinear: return line formed by outside reduction[0] = cubic[0]; reduction[1] = cubic[3]; return reductionLineCount(reduction); }
static int check_linear(const SkDQuad& quad, int minX, int maxX, int minY, int maxY, SkDQuad& reduction) { int startIndex = 0; int endIndex = 2; while (quad[startIndex].approximatelyEqual(quad[endIndex])) { --endIndex; if (endIndex == 0) { SkDebugf("%s shouldn't get here if all four points are about equal", __FUNCTION__); SkASSERT(0); } } if (!quad.isLinear(startIndex, endIndex)) { return 0; } // four are colinear: return line formed by outside reduction[0] = quad[0]; reduction[1] = quad[2]; return reductionLineCount(reduction); }
static int check_linear(const SkDCubic& cubic, int minX, int maxX, int minY, int maxY, SkDCubic& reduction) { int startIndex = 0; int endIndex = 3; while (cubic[startIndex].approximatelyEqual(cubic[endIndex])) { --endIndex; if (endIndex == 0) { endIndex = 3; break; } } if (!cubic.isLinear(startIndex, endIndex)) { return 0; } // four are colinear: return line formed by outside reduction[0] = cubic[0]; reduction[1] = cubic[3]; return reductionLineCount(reduction); }
static int horizontal_line(const SkDQuad& quad, SkDQuad& reduction) { reduction[0] = quad[0]; reduction[1] = quad[2]; return reductionLineCount(reduction); }
static int horizontal_line(const SkDCubic& cubic, SkDCubic& reduction) { reduction[0] = cubic[0]; reduction[1] = cubic[3]; return reductionLineCount(reduction); }