Lines Matching refs:cubic
100 static int coincident_line(const SkDCubic& cubic, SkDCubic& reduction) { in coincident_line() argument
101 reduction[0] = reduction[1] = cubic[0]; in coincident_line()
109 static int vertical_line(const SkDCubic& cubic, SkDCubic& reduction) { in vertical_line() argument
110 reduction[0] = cubic[0]; in vertical_line()
111 reduction[1] = cubic[3]; in vertical_line()
115 static int horizontal_line(const SkDCubic& cubic, SkDCubic& reduction) { in horizontal_line() argument
116 reduction[0] = cubic[0]; in horizontal_line()
117 reduction[1] = cubic[3]; in horizontal_line()
122 static int check_quadratic(const SkDCubic& cubic, SkDCubic& reduction) { in check_quadratic() argument
123 double dx10 = cubic[1].fX - cubic[0].fX; in check_quadratic()
124 double dx23 = cubic[2].fX - cubic[3].fX; in check_quadratic()
125 double midX = cubic[0].fX + dx10 * 3 / 2; in check_quadratic()
126 double sideAx = midX - cubic[3].fX; in check_quadratic()
132 double dy10 = cubic[1].fY - cubic[0].fY; in check_quadratic()
133 double dy23 = cubic[2].fY - cubic[3].fY; in check_quadratic()
134 double midY = cubic[0].fY + dy10 * 3 / 2; in check_quadratic()
135 double sideAy = midY - cubic[3].fY; in check_quadratic()
141 reduction[0] = cubic[0]; in check_quadratic()
144 reduction[2] = cubic[3]; in check_quadratic()
148 static int check_linear(const SkDCubic& cubic, in check_linear() argument
150 if (!cubic.isLinear(0, 3)) { in check_linear()
154 reduction[0] = cubic[0]; in check_linear()
155 reduction[1] = cubic[3]; in check_linear()
185 int SkReduceOrder::reduce(const SkDCubic& cubic, Quadratics allowQuadratics) { in reduce() argument
191 if (cubic[minX].fX > cubic[index].fX) { in reduce()
194 if (cubic[minY].fY > cubic[index].fY) { in reduce()
197 if (cubic[maxX].fX < cubic[index].fX) { in reduce()
200 if (cubic[maxY].fY < cubic[index].fY) { in reduce()
205 double cx = cubic[index].fX; in reduce()
206 double cy = cubic[index].fY; in reduce()
208 SkTMax(fabs(cubic[minX].fX), fabs(cubic[minY].fY)))); in reduce()
215 if (approximately_equal_half(cx * inv, cubic[minX].fX * inv)) { in reduce()
218 if (approximately_equal_half(cy * inv, cubic[minY].fY * inv)) { in reduce()
224 return coincident_line(cubic, fCubic); in reduce()
226 return vertical_line(cubic, fCubic); in reduce()
229 return horizontal_line(cubic, fCubic); in reduce()
231 int result = check_linear(cubic, minX, maxX, minY, maxY, fCubic); in reduce()
236 && (result = check_quadratic(cubic, fCubic))) { in reduce()
239 fCubic = cubic; in reduce()
270 SkDCubic cubic; in Cubic() local
271 cubic.set(a); in Cubic()
273 int order = reducer.reduce(cubic, kAllow_Quadratics); in Cubic()