Home
last modified time | relevance | path

Searched refs:cubic (Results 1 – 25 of 246) sorted by relevance

12345678910

/external/skia/tests/
DPathOpsCubicReduceOrderTest.cpp16 static bool controls_inside(const SkDCubic& cubic) {
17 return between(cubic[0].fX, cubic[1].fX, cubic[3].fX)
18 && between(cubic[0].fX, cubic[2].fX, cubic[3].fX)
19 && between(cubic[0].fY, cubic[1].fY, cubic[3].fY)
20 && between(cubic[0].fY, cubic[2].fY, cubic[3].fY);
23 static bool tiny(const SkDCubic& cubic) {
27 if (cubic[minX].fX > cubic[index].fX) {
30 if (cubic[minY].fY > cubic[index].fY) {
33 if (cubic[maxX].fX < cubic[index].fX) {
36 if (cubic[maxY].fY < cubic[index].fY) {
[all …]
DPathOpsCubicLineIntersectionTest.cpp17 CubicPts cubic; member
30 const CubicPts& cuPts = failLineCubicTests[iIndex].cubic; in testFail()
31 SkDCubic cubic; in testFail() local
32 cubic.debugSet(cuPts.fPts); in testFail()
33 SkASSERT(ValidCubic(cubic)); in testFail()
38 int order1 = reduce1.reduce(cubic, SkReduceOrder::kNo_Quadratics); in testFail()
50 int roots = i.intersect(cubic, line); in testFail()
103 static int doIntersect(SkIntersections& intersections, const SkDCubic& cubic, const SkDLine& line) { in doIntersect() argument
114 result = intersections.vertical(cubic, top, bottom, line[0].fX, flipped); in doIntersect()
123 result = intersections.horizontal(cubic, left, right, line[0].fY, flipped); in doIntersect()
[all …]
DPathOpsTestCommon.cpp19 static double calc_t_div(const SkDCubic& cubic, double precision, double start) { in calc_t_div() argument
24 cPtr = &cubic; in calc_t_div()
27 sub = cubic.subDivide(start, 1); in calc_t_div()
42 static bool add_simple_ts(const SkDCubic& cubic, double precision, SkTArray<double, true>* ts) { in add_simple_ts() argument
43 double tDiv = calc_t_div(cubic, precision, 0); in add_simple_ts()
54 static void addTs(const SkDCubic& cubic, double precision, double start, double end, in addTs() argument
56 double tDiv = calc_t_div(cubic, precision, 0); in addTs()
66 static void toQuadraticTs(const SkDCubic* cubic, double precision, SkTArray<double, true>* ts) { in toQuadraticTs() argument
68 int order = reducer.reduce(*cubic, SkReduceOrder::kAllow_Quadratics); in toQuadraticTs()
73 int inflections = cubic->findInflections(inflectT); in toQuadraticTs()
[all …]
DPathOpsDRectTest.cpp37 static void setRawBounds(const SkDCubic& cubic, SkDRect* rect) { in setRawBounds() argument
38 rect->set(cubic[0]); in setRawBounds()
39 rect->add(cubic[1]); in setRawBounds()
40 rect->add(cubic[2]); in setRawBounds()
41 rect->add(cubic[3]); in setRawBounds()
63 SkDCubic cubic; in DEF_TEST() local
64 cubic.debugSet(c.fPts); in DEF_TEST()
65 SkASSERT(ValidCubic(cubic)); in DEF_TEST()
66 setRawBounds(cubic, &rect); in DEF_TEST()
67 rect2.setBounds(cubic); in DEF_TEST()
DStrokerTest.cpp288 SkPoint cubic[4]; in DEF_TEST() local
289 cubic[0].fX = r.nextRangeF(0, 500); in DEF_TEST()
290 cubic[0].fY = r.nextRangeF(0, 500); in DEF_TEST()
293 cubic[1].fX = r.nextRangeF(0, 500); in DEF_TEST()
294 cubic[1].fY = r.nextRangeF(0, 500); in DEF_TEST()
295 } while (SkPointPriv::DistanceToSqd(cubic[0], cubic[1]) < halfSquared); in DEF_TEST()
297 cubic[2].fX = r.nextRangeF(0, 500); in DEF_TEST()
298 cubic[2].fY = r.nextRangeF(0, 500); in DEF_TEST()
299 } while ( SkPointPriv::DistanceToSqd(cubic[0], cubic[2]) < halfSquared in DEF_TEST()
300 || SkPointPriv::DistanceToSqd(cubic[1], cubic[2]) < halfSquared); in DEF_TEST()
[all …]
DPathOpsCubicLineIntersectionIdeas.cpp54 static double binary_search(const SkDCubic& cubic, double step, const SkDPoint& pt, double t, in binary_search() argument
59 SkDPoint cubicAtT = cubic.ptAtT(t); in binary_search()
68 cubic.dump(); in binary_search()
76 SkDPoint lessPt = cubic.ptAtT(t - lastStep); in binary_search()
85 SkDPoint morePt = cubic.ptAtT(t + lastStep); in binary_search()
155 SkDCubic cubic; in DEF_TEST() local
156 cubic.debugSet(cuPts.fPts); in DEF_TEST()
157 SkDPoint pt = cubic.ptAtT(t); in DEF_TEST()
161 SkDCubic::Coefficients(&cubic[0].fY, &A, &B, &C, &D); in DEF_TEST()
173 SkDPoint calcPt = cubic.ptAtT(t); in DEF_TEST()
[all …]
DPathOpsLineParametetersTest.cpp44 SkDCubic cubic; in DEF_TEST() local
45 cubic.debugSet(c.fPts); in DEF_TEST()
46 SkASSERT(ValidCubic(cubic)); in DEF_TEST()
47 lineParameters.cubicEndPoints(cubic, 0, 3); in DEF_TEST()
49 denormalizedDistance[0] = lineParameters.controlPtDistance(cubic, 1); in DEF_TEST()
50 denormalizedDistance[1] = lineParameters.controlPtDistance(cubic, 2); in DEF_TEST()
69 normalizedDistance[0] = lineParameters.controlPtDistance(cubic, 1); in DEF_TEST()
70 normalizedDistance[1] = lineParameters.controlPtDistance(cubic, 2); in DEF_TEST()
DPathOpsCubicConicIntersectionTest.cpp15 CubicPts cubic; member
46 const CubicPts& cu = cubicConicTests[index].cubic; in cubicConicIntersection()
47 SkDCubic cubic; in cubicConicIntersection() local
48 cubic.debugSet(cu.fPts); in cubicConicIntersection()
49 SkASSERT(ValidCubic(cubic)); in cubicConicIntersection()
56 int order1 = reduce1.reduce(cubic, SkReduceOrder::kNo_Quadratics); in cubicConicIntersection()
67 int roots = i.intersect(cubic, conic); in cubicConicIntersection()
70 SkDPoint xy1 = cubic.ptAtT(tt1); in cubicConicIntersection()
DPathOpsCubicQuadIntersectionTest.cpp16 CubicPts cubic; member
56 const CubicPts& c = quadCubicTests[index].cubic; in cubicQuadIntersection()
57 SkDCubic cubic; in cubicQuadIntersection() local
58 cubic.debugSet(c.fPts); in cubicQuadIntersection()
59 SkASSERT(ValidCubic(cubic)); in cubicQuadIntersection()
66 int order1 = reduce1.reduce(cubic, SkReduceOrder::kNo_Quadratics); in cubicQuadIntersection()
77 int roots = i.intersect(cubic, quad); in cubicQuadIntersection()
80 SkDPoint xy1 = cubic.ptAtT(tt1); in cubicQuadIntersection()
/external/skqp/tests/
DPathOpsCubicReduceOrderTest.cpp16 static bool controls_inside(const SkDCubic& cubic) {
17 return between(cubic[0].fX, cubic[1].fX, cubic[3].fX)
18 && between(cubic[0].fX, cubic[2].fX, cubic[3].fX)
19 && between(cubic[0].fY, cubic[1].fY, cubic[3].fY)
20 && between(cubic[0].fY, cubic[2].fY, cubic[3].fY);
23 static bool tiny(const SkDCubic& cubic) {
27 if (cubic[minX].fX > cubic[index].fX) {
30 if (cubic[minY].fY > cubic[index].fY) {
33 if (cubic[maxX].fX < cubic[index].fX) {
36 if (cubic[maxY].fY < cubic[index].fY) {
[all …]
DPathOpsCubicLineIntersectionTest.cpp17 CubicPts cubic; member
30 const CubicPts& cuPts = failLineCubicTests[iIndex].cubic; in testFail()
31 SkDCubic cubic; in testFail() local
32 cubic.debugSet(cuPts.fPts); in testFail()
33 SkASSERT(ValidCubic(cubic)); in testFail()
38 int order1 = reduce1.reduce(cubic, SkReduceOrder::kNo_Quadratics); in testFail()
50 int roots = i.intersect(cubic, line); in testFail()
103 static int doIntersect(SkIntersections& intersections, const SkDCubic& cubic, const SkDLine& line) { in doIntersect() argument
114 result = intersections.vertical(cubic, top, bottom, line[0].fX, flipped); in doIntersect()
123 result = intersections.horizontal(cubic, left, right, line[0].fY, flipped); in doIntersect()
[all …]
DPathOpsTestCommon.cpp19 static double calc_t_div(const SkDCubic& cubic, double precision, double start) { in calc_t_div() argument
24 cPtr = &cubic; in calc_t_div()
27 sub = cubic.subDivide(start, 1); in calc_t_div()
42 static bool add_simple_ts(const SkDCubic& cubic, double precision, SkTArray<double, true>* ts) { in add_simple_ts() argument
43 double tDiv = calc_t_div(cubic, precision, 0); in add_simple_ts()
54 static void addTs(const SkDCubic& cubic, double precision, double start, double end, in addTs() argument
56 double tDiv = calc_t_div(cubic, precision, 0); in addTs()
66 static void toQuadraticTs(const SkDCubic* cubic, double precision, SkTArray<double, true>* ts) { in toQuadraticTs() argument
68 int order = reducer.reduce(*cubic, SkReduceOrder::kAllow_Quadratics); in toQuadraticTs()
73 int inflections = cubic->findInflections(inflectT); in toQuadraticTs()
[all …]
DPathOpsDRectTest.cpp37 static void setRawBounds(const SkDCubic& cubic, SkDRect* rect) { in setRawBounds() argument
38 rect->set(cubic[0]); in setRawBounds()
39 rect->add(cubic[1]); in setRawBounds()
40 rect->add(cubic[2]); in setRawBounds()
41 rect->add(cubic[3]); in setRawBounds()
63 SkDCubic cubic; in DEF_TEST() local
64 cubic.debugSet(c.fPts); in DEF_TEST()
65 SkASSERT(ValidCubic(cubic)); in DEF_TEST()
66 setRawBounds(cubic, &rect); in DEF_TEST()
67 rect2.setBounds(cubic); in DEF_TEST()
DStrokerTest.cpp288 SkPoint cubic[4]; in DEF_TEST() local
289 cubic[0].fX = r.nextRangeF(0, 500); in DEF_TEST()
290 cubic[0].fY = r.nextRangeF(0, 500); in DEF_TEST()
293 cubic[1].fX = r.nextRangeF(0, 500); in DEF_TEST()
294 cubic[1].fY = r.nextRangeF(0, 500); in DEF_TEST()
295 } while (SkPointPriv::DistanceToSqd(cubic[0], cubic[1]) < halfSquared); in DEF_TEST()
297 cubic[2].fX = r.nextRangeF(0, 500); in DEF_TEST()
298 cubic[2].fY = r.nextRangeF(0, 500); in DEF_TEST()
299 } while ( SkPointPriv::DistanceToSqd(cubic[0], cubic[2]) < halfSquared in DEF_TEST()
300 || SkPointPriv::DistanceToSqd(cubic[1], cubic[2]) < halfSquared); in DEF_TEST()
[all …]
DPathOpsCubicLineIntersectionIdeas.cpp54 static double binary_search(const SkDCubic& cubic, double step, const SkDPoint& pt, double t, in binary_search() argument
59 SkDPoint cubicAtT = cubic.ptAtT(t); in binary_search()
68 cubic.dump(); in binary_search()
76 SkDPoint lessPt = cubic.ptAtT(t - lastStep); in binary_search()
85 SkDPoint morePt = cubic.ptAtT(t + lastStep); in binary_search()
155 SkDCubic cubic; in DEF_TEST() local
156 cubic.debugSet(cuPts.fPts); in DEF_TEST()
157 SkDPoint pt = cubic.ptAtT(t); in DEF_TEST()
161 SkDCubic::Coefficients(&cubic[0].fY, &A, &B, &C, &D); in DEF_TEST()
173 SkDPoint calcPt = cubic.ptAtT(t); in DEF_TEST()
[all …]
DPathOpsLineParametetersTest.cpp44 SkDCubic cubic; in DEF_TEST() local
45 cubic.debugSet(c.fPts); in DEF_TEST()
46 SkASSERT(ValidCubic(cubic)); in DEF_TEST()
47 lineParameters.cubicEndPoints(cubic, 0, 3); in DEF_TEST()
49 denormalizedDistance[0] = lineParameters.controlPtDistance(cubic, 1); in DEF_TEST()
50 denormalizedDistance[1] = lineParameters.controlPtDistance(cubic, 2); in DEF_TEST()
69 normalizedDistance[0] = lineParameters.controlPtDistance(cubic, 1); in DEF_TEST()
70 normalizedDistance[1] = lineParameters.controlPtDistance(cubic, 2); in DEF_TEST()
DPathOpsCubicConicIntersectionTest.cpp15 CubicPts cubic; member
46 const CubicPts& cu = cubicConicTests[index].cubic; in cubicConicIntersection()
47 SkDCubic cubic; in cubicConicIntersection() local
48 cubic.debugSet(cu.fPts); in cubicConicIntersection()
49 SkASSERT(ValidCubic(cubic)); in cubicConicIntersection()
56 int order1 = reduce1.reduce(cubic, SkReduceOrder::kNo_Quadratics); in cubicConicIntersection()
67 int roots = i.intersect(cubic, conic); in cubicConicIntersection()
70 SkDPoint xy1 = cubic.ptAtT(tt1); in cubicConicIntersection()
/external/skqp/src/pathops/
DSkReduceOrder.cpp103 static int coincident_line(const SkDCubic& cubic, SkDCubic& reduction) { in coincident_line() argument
104 reduction[0] = reduction[1] = cubic[0]; in coincident_line()
112 static int vertical_line(const SkDCubic& cubic, SkDCubic& reduction) { in vertical_line() argument
113 reduction[0] = cubic[0]; in vertical_line()
114 reduction[1] = cubic[3]; in vertical_line()
118 static int horizontal_line(const SkDCubic& cubic, SkDCubic& reduction) { in horizontal_line() argument
119 reduction[0] = cubic[0]; in horizontal_line()
120 reduction[1] = cubic[3]; in horizontal_line()
125 static int check_quadratic(const SkDCubic& cubic, SkDCubic& reduction) { in check_quadratic() argument
126 double dx10 = cubic[1].fX - cubic[0].fX; in check_quadratic()
[all …]
DSkOpCubicHull.cpp9 static bool rotate(const SkDCubic& cubic, int zero, int index, SkDCubic& rotPath) { in rotate() argument
10 double dy = cubic[index].fY - cubic[zero].fY; in rotate()
11 double dx = cubic[index].fX - cubic[zero].fX; in rotate()
16 rotPath = cubic; in rotate()
18 rotPath[index].fY = cubic[zero].fY; in rotate()
22 if (approximately_equal(cubic[side1].fY, cubic[zero].fY)) { in rotate()
23 rotPath[side1].fY = cubic[zero].fY; in rotate()
25 if (approximately_equal(cubic[side2].fY, cubic[zero].fY)) { in rotate()
26 rotPath[side2].fY = cubic[zero].fY; in rotate()
32 rotPath[index].fX = cubic[index].fX * dx + cubic[index].fY * dy; in rotate()
[all …]
/external/skia/src/pathops/
DSkReduceOrder.cpp103 static int coincident_line(const SkDCubic& cubic, SkDCubic& reduction) { in coincident_line() argument
104 reduction[0] = reduction[1] = cubic[0]; in coincident_line()
112 static int vertical_line(const SkDCubic& cubic, SkDCubic& reduction) { in vertical_line() argument
113 reduction[0] = cubic[0]; in vertical_line()
114 reduction[1] = cubic[3]; in vertical_line()
118 static int horizontal_line(const SkDCubic& cubic, SkDCubic& reduction) { in horizontal_line() argument
119 reduction[0] = cubic[0]; in horizontal_line()
120 reduction[1] = cubic[3]; in horizontal_line()
125 static int check_quadratic(const SkDCubic& cubic, SkDCubic& reduction) { in check_quadratic() argument
126 double dx10 = cubic[1].fX - cubic[0].fX; in check_quadratic()
[all …]
DSkOpCubicHull.cpp9 static bool rotate(const SkDCubic& cubic, int zero, int index, SkDCubic& rotPath) { in rotate() argument
10 double dy = cubic[index].fY - cubic[zero].fY; in rotate()
11 double dx = cubic[index].fX - cubic[zero].fX; in rotate()
16 rotPath = cubic; in rotate()
18 rotPath[index].fY = cubic[zero].fY; in rotate()
22 if (approximately_equal(cubic[side1].fY, cubic[zero].fY)) { in rotate()
23 rotPath[side1].fY = cubic[zero].fY; in rotate()
25 if (approximately_equal(cubic[side2].fY, cubic[zero].fY)) { in rotate()
26 rotPath[side2].fY = cubic[zero].fY; in rotate()
32 rotPath[index].fX = cubic[index].fX * dx + cubic[index].fY * dy; in rotate()
[all …]
/external/skqp/src/utils/win/
DSkDWriteGeometrySink.cpp91 static bool check_quadratic(const Cubic& cubic, Quadratic& reduction) { in check_quadratic() argument
92 float dx10 = cubic[1].x - cubic[0].x; in check_quadratic()
93 float dx23 = cubic[2].x - cubic[3].x; in check_quadratic()
94 float midX = cubic[0].x + dx10 * 3 / 2; in check_quadratic()
97 if (!approximately_equal(midX, (dx23 * 3 / 2) + cubic[3].x)) { in check_quadratic()
100 float dy10 = cubic[1].y - cubic[0].y; in check_quadratic()
101 float dy23 = cubic[2].y - cubic[3].y; in check_quadratic()
102 float midY = cubic[0].y + dy10 * 3 / 2; in check_quadratic()
103 if (!approximately_equal(midY, (dy23 * 3 / 2) + cubic[3].y)) { in check_quadratic()
106 reduction[0] = cubic[0]; in check_quadratic()
[all …]
/external/skia/src/utils/win/
DSkDWriteGeometrySink.cpp91 static bool check_quadratic(const Cubic& cubic, Quadratic& reduction) { in check_quadratic() argument
92 float dx10 = cubic[1].x - cubic[0].x; in check_quadratic()
93 float dx23 = cubic[2].x - cubic[3].x; in check_quadratic()
94 float midX = cubic[0].x + dx10 * 3 / 2; in check_quadratic()
97 if (!approximately_equal(midX, (dx23 * 3 / 2) + cubic[3].x)) { in check_quadratic()
100 float dy10 = cubic[1].y - cubic[0].y; in check_quadratic()
101 float dy23 = cubic[2].y - cubic[3].y; in check_quadratic()
102 float midY = cubic[0].y + dy10 * 3 / 2; in check_quadratic()
103 if (!approximately_equal(midY, (dy23 * 3 / 2) + cubic[3].y)) { in check_quadratic()
106 reduction[0] = cubic[0]; in check_quadratic()
[all …]
/external/skia/src/core/
DSkStroke.cpp206 static ReductionType CheckCubicLinear(const SkPoint cubic[4], SkPoint reduction[3],
210 ResultType compareQuadCubic(const SkPoint cubic[4], SkQuadConstruct* );
216 bool cubicMidOnLine(const SkPoint cubic[4], const SkQuadConstruct* ) const;
217 void cubicPerpRay(const SkPoint cubic[4], SkScalar t, SkPoint* tPt, SkPoint* onPt,
219 void cubicQuadEnds(const SkPoint cubic[4], SkQuadConstruct* );
220 void cubicQuadMid(const SkPoint cubic[4], const SkQuadConstruct* , SkPoint* mid) const;
221 bool cubicStroke(const SkPoint cubic[4], SkQuadConstruct* );
231 void setCubicEndNormal(const SkPoint cubic[4],
241 ResultType tangentsMeet(const SkPoint cubic[4], SkQuadConstruct* );
463 void SkPathStroker::setCubicEndNormal(const SkPoint cubic[4], const SkVector& normalAB, in setCubicEndNormal()
[all …]
/external/skqp/src/core/
DSkStroke.cpp206 static ReductionType CheckCubicLinear(const SkPoint cubic[4], SkPoint reduction[3],
210 ResultType compareQuadCubic(const SkPoint cubic[4], SkQuadConstruct* );
216 bool cubicMidOnLine(const SkPoint cubic[4], const SkQuadConstruct* ) const;
217 void cubicPerpRay(const SkPoint cubic[4], SkScalar t, SkPoint* tPt, SkPoint* onPt,
219 void cubicQuadEnds(const SkPoint cubic[4], SkQuadConstruct* );
220 void cubicQuadMid(const SkPoint cubic[4], const SkQuadConstruct* , SkPoint* mid) const;
221 bool cubicStroke(const SkPoint cubic[4], SkQuadConstruct* );
231 void setCubicEndNormal(const SkPoint cubic[4],
241 ResultType tangentsMeet(const SkPoint cubic[4], SkQuadConstruct* );
463 void SkPathStroker::setCubicEndNormal(const SkPoint cubic[4], const SkVector& normalAB, in setCubicEndNormal()
[all …]

12345678910