Lines Matching refs:test
54 SkPath test, result;
55 test.addRect({1, 2, 3, 4});
56 // if test is winding
57 REPORTER_ASSERT(reporter, AsWinding(test, &result));
58 REPORTER_ASSERT(reporter, test == result);
59 // if test is empty
60 test.reset();
61 test.setFillType(SkPathFillType::kEvenOdd);
62 REPORTER_ASSERT(reporter, AsWinding(test, &result));
65 // if test is convex
66 test.addCircle(5, 5, 10);
67 REPORTER_ASSERT(reporter, AsWinding(test, &result));
69 test.setFillType(SkPathFillType::kWinding);
70 REPORTER_ASSERT(reporter, test == result);
71 // if test has infinity
72 test.reset();
73 test.addRect({1, 2, 3, SK_ScalarInfinity});
74 test.setFillType(SkPathFillType::kEvenOdd);
75 REPORTER_ASSERT(reporter, !AsWinding(test, &result));
76 // if test has only one contour
77 test.reset();
79 test.addPoly(ell, SK_ARRAY_COUNT(ell), true);
80 test.setFillType(SkPathFillType::kEvenOdd);
81 REPORTER_ASSERT(reporter, AsWinding(test, &result));
83 test.setFillType(SkPathFillType::kWinding);
84 REPORTER_ASSERT(reporter, test == result);
85 // test two contours that do not overlap or share bounds
86 test.addRect({5, 2, 6, 3});
87 test.setFillType(SkPathFillType::kEvenOdd);
88 REPORTER_ASSERT(reporter, AsWinding(test, &result));
90 test.setFillType(SkPathFillType::kWinding);
91 REPORTER_ASSERT(reporter, test == result);
92 // test two contours that do not overlap but share bounds
93 test.reset();
94 test.addPoly(ell, SK_ARRAY_COUNT(ell), true);
95 test.addRect({2, 2, 3, 3});
96 test.setFillType(SkPathFillType::kEvenOdd);
97 REPORTER_ASSERT(reporter, AsWinding(test, &result));
99 test.setFillType(SkPathFillType::kWinding);
100 REPORTER_ASSERT(reporter, test == result);
101 // test two contours that partially overlap
102 test.reset();
103 test.addRect({0, 0, 3, 3});
104 test.addRect({1, 1, 4, 4});
105 test.setFillType(SkPathFillType::kEvenOdd);
106 REPORTER_ASSERT(reporter, AsWinding(test, &result));
108 test.setFillType(SkPathFillType::kWinding);
109 REPORTER_ASSERT(reporter, test == result);
110 // test that result may be input
111 SkPath copy = test;
112 test.setFillType(SkPathFillType::kEvenOdd);
113 REPORTER_ASSERT(reporter, AsWinding(test, &test));
114 REPORTER_ASSERT(reporter, !test.isConvex());
115 REPORTER_ASSERT(reporter, test == copy);
116 // test a in b, b in a, cw/ccw
124 test.reset();
125 test.setFillType(SkPathFillType::kEvenOdd);
127 test.addRect(rectA, dirA);
128 test.addRect(rectB, dirB);
130 test.addRect(rectB, dirB);
131 test.addRect(rectA, dirA);
133 SkPath original = test;
134 REPORTER_ASSERT(reporter, AsWinding(test, &result));
136 test.reset();
138 test.addRect(rectA, dirA);
141 test.addRect(rectB, dirB);
143 test.addPoly(SkPathDirection::kCW == dirA ? revBccw : revBcw, true);
146 test.addRect(rectA, dirA);
148 REPORTER_ASSERT(reporter, test == result);
149 // test that result may be input
166 test = aFirst ? pathA : SkPath();
167 test.addPath(build_squircle(curveB, rectB, dirB));
169 test.addPath(pathA);
171 test.setFillType(SkPathFillType::kEvenOdd);
172 REPORTER_ASSERT(reporter, AsWinding(test, &result));
176 bool evenOddContains = test.contains(x, y);