Home | History | Annotate | Download | only in cts

Lines Matching refs:Path

29 import android.graphics.Path;
51 // new the Path instance
52 new Path();
54 // another the Path instance with different params
55 new Path(new Path());
60 Path path = new Path();
61 assertTrue(path.isEmpty());
63 path.addRect(rect, Path.Direction.CW);
64 assertFalse(path.isEmpty());
69 Path path = new Path();
70 assertTrue(path.isEmpty());
71 path.addRect(LEFT, TOP, RIGHT, BOTTOM, Path.Direction.CW);
72 assertFalse(path.isEmpty());
77 Path path = new Path();
78 path.moveTo(10.0f, 10.0f);
83 Path path = new Path();
84 assertTrue(path.isEmpty());
85 Path path1 = new Path();
87 path.set(path1);
88 verifyPathsAreEquivalent(path, path1);
93 Path path = new Path();
94 addRectToPath(path);
95 path.addRect(new RectF(0, 0, 10, 10), Path.Direction.CW);
96 Path path1 = new Path();
97 path1.addRect(new RectF(10, 10, 20, 20), Path.Direction.CW);
98 path.set(path1);
99 verifyPathsAreEquivalent(path, path1);
104 Path path = new Path();
105 addRectToPath(path);
106 Path path1 = new Path();
107 path.set(path1);
108 verifyPathsAreEquivalent(path, path1);
114 Path.FillType expected1 = Path.FillType.EVEN_ODD;
115 Path.FillType expected2 = Path.FillType.INVERSE_EVEN_ODD;
116 Path.FillType expected3 = Path.FillType.INVERSE_WINDING;
117 Path.FillType expected4 = Path.FillType.WINDING;
119 // new the Path instance
120 Path path = new Path();
121 // set FillType by {@link Path#setFillType(FillType)}
122 path.setFillType(Path.FillType.EVEN_ODD);
123 assertEquals(expected1, path.getFillType());
124 path.setFillType(Path.FillType.INVERSE_EVEN_ODD);
125 assertEquals(expected2, path.getFillType());
126 path.setFillType(Path.FillType.INVERSE_WINDING);
127 assertEquals(expected3, path.getFillType());
128 path.setFillType(Path.FillType.WINDING);
129 assertEquals(expected4, path.getFillType());
134 Path path = new Path();
135 assertTrue(path.isEmpty());
136 path.rQuadTo(5.0f, 5.0f, 10.0f, 10.0f);
137 assertFalse(path.isEmpty());
142 Path path = new Path();
143 assertTrue(path.isEmpty());
144 Path dst = new Path();
145 addRectToPath(path);
146 path.transform(new Matrix(), dst);
152 Path path = new Path();
153 assertTrue(path.isEmpty());
154 path.lineTo(XCOORD, YCOORD);
155 assertFalse(path.isEmpty());
160 Path path = new Path();
161 assertTrue(path.isEmpty());
162 addRectToPath(path);
163 path.close();
168 Path path = new Path();
169 assertTrue(path.isEmpty());
170 path.quadTo(20.0f, 20.0f, 40.0f, 40.0f);
171 assertFalse(path.isEmpty());
176 // new the Path instance
177 Path path = new Path();
178 assertTrue(path.isEmpty());
179 path.addCircle(XCOORD, YCOORD, 10.0f, Path.Direction.CW);
180 assertFalse(path.isEmpty());
185 Path path = new Path();
186 assertTrue(path.isEmpty());
188 path.arcTo(oval, 0.0f, 30.0f, true);
189 assertFalse(path.isEmpty());
194 Path path = new Path();
195 assertTrue(path.isEmpty());
197 path.arcTo(oval, 0.0f, 30.0f);
198 assertFalse(path.isEmpty());
204 Path path = new Path();
205 assertTrue(path.isEmpty());
207 path.computeBounds(bounds, true);
210 path.computeBounds(bounds, false);
218 Path path = new Path();
219 assertTrue(path.isEmpty());
221 path.addRect(bounds, Path.Direction.CW);
222 path.computeBounds(bounds, true);
225 path.computeBounds(bounds, false);
232 Path path = new Path();
233 path.setLastPoint(10.0f, 10.0f);
238 Path path = new Path();
239 assertTrue(path.isEmpty());
240 path.rLineTo(10.0f, 10.0f);
241 assertFalse(path.isEmpty());
247 Path path = new Path();
248 assertTrue(path.isEmpty());
249 addRectToPath(path);
250 assertFalse(path.isEmpty());
255 Path.FillType expected = Path.FillType.EVEN_ODD;
257 Path path = new Path();
258 assertTrue(path.isEmpty());
259 addRectToPath(path);
260 path.rewind();
261 path.setFillType(Path.FillType.EVEN_ODD);
262 assertTrue(path.isEmpty());
263 assertEquals(expected, path.getFillType());
268 Path path = new Path();
269 assertTrue(path.isEmpty());
271 path.addOval(oval, Path.Direction.CW);
272 assertFalse(path.isEmpty());
277 Path path = new Path();
278 assertTrue(path.isEmpty());
279 addRectToPath(path);
284 Path path = new Path();
285 assertTrue(path.isEmpty());
286 Path src = new Path();
288 path.addPath(src, 10.0f, 10.0f);
289 assertFalse(path.isEmpty());
294 Path path = new Path();
295 assertTrue(path.isEmpty());
296 Path src = new Path();
298 path.addPath(src);
299 assertFalse(path.isEmpty());
304 Path path = new Path();
305 assertTrue(path.isEmpty());
306 Path src = new Path();
309 path.addPath(src, matrix);
310 assertFalse(path.isEmpty());
315 Path path = new Path();
316 assertTrue(path.isEmpty());
318 path.addRoundRect(rect, XCOORD, YCOORD, Path.Direction.CW);
319 assertFalse(path.isEmpty());
324 Path path = new Path();
325 assertTrue(path.isEmpty());
331 path.addRoundRect(rect, radii, Path.Direction.CW);
332 assertFalse(path.isEmpty());
337 Path path = new Path();
338 path.addRect(0, 0, 100, 10, Path.Direction.CW);
339 assertTrue(path.isConvex());
341 path.addRect(0, 0, 10, 100, Path.Direction.CW);
342 assertFalse(path.isConvex()); // path is concave
347 Path path = new Path();
348 path.addRect(0, 0, 40, 40, Path.Direction.CW);
349 assertTrue(path.isConvex());
351 path.addRect(10, 10, 30, 30, Path.Direction.CCW);
352 assertFalse(path.isConvex()); // path has hole, isn't convex
357 Path path = new Path();
358 path.addRect(0, 0, 10, 10, Path.Direction.CW);
359 assertTrue(path.isConvex());
361 path.addRect(0, 20, 10, 10, Path.Direction.CW);
362 assertFalse(path.isConvex()); // path isn't one convex shape
367 Path path = new Path();
368 assertFalse(path.isInverseFillType());
369 path.setFillType(Path.FillType.INVERSE_EVEN_ODD);
370 assertTrue(path.isInverseFillType());
375 Path path = new Path();
376 assertTrue(path.isEmpty());
377 addRectToPath(path);
378 Path dst = new Path();
379 path.offset(XCOORD, YCOORD, dst);
385 Path path = new Path();
386 assertTrue(path.isEmpty());
387 path.cubicTo(10.0f, 10.0f, 20.0f, 20.0f, 30.0f, 30.0f);
388 assertFalse(path.isEmpty());
393 Path path = new Path();
394 assertTrue(path.isEmpty());
395 Path path1 = new Path();
397 path.set(path1);
398 assertFalse(path.isEmpty());
399 path.reset();
400 assertTrue(path.isEmpty());
405 Path path = new Path();
406 assertTrue(path.isEmpty());
407 path.toggleInverseFillType();
408 assertTrue(path.isInverseFillType());
413 Path path = new Path();
414 assertTrue(path.isEmpty());
416 path.addArc(oval, 0.0f, 30.0f);
417 assertFalse(path.isEmpty());
422 Path path = new Path();
423 assertTrue(path.isEmpty());
424 path.rCubicTo(10.0f, 10.0f, 11.0f, 11.0f, 12.0f, 12.0f);
425 assertFalse(path.isEmpty());
431 Path path = new Path();
434 paint.getTextPath(text, 0, text.length() - 1, 0, 0, path);
436 path.computeBounds(expectedRect, false);
441 path.offset(offset, offset);
443 path.computeBounds(offsettedRect, false);
449 new Path().approximate(-0.1f);
454 Path path = new Path();
455 path.addRect(0, 0, 100, 100, Path.Direction.CW);
462 }, path.approximate(1f), 0);
467 Path path = new Path();
468 path.addRect(0, 0, 100, 100, Path.Direction.CCW);
475 }, path.approximate(1f), 0);
480 Path path = new Path();
484 }, path.approximate(0.5f), 0);
489 Path path = new Path();
490 path.addCircle(0, 0, 50, Path.Direction.CW);
491 assertTrue(path.approximate(0.25f).length > 20);
502 // Basic test that we created a path successfully
518 private static final class PathAbuser extends Path {
524 private static void verifyPathsAreEquivalent(Path actual, Path expected) {
533 private static Bitmap drawAndGetBitmap(Path path) {
539 canvas.drawPath(path, paint);
543 private void addRectToPath(Path path) {
545 path.addRect(rect, Path.Direction.CW);