MCPcopy Create free account
hub / github.com/HumbleUI/Skija / storage

Method storage

tests/java/PathTest.java:192–224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190 }
191
192 public void storage() {
193 Path subpath = new PathBuilder().lineTo(40, 40).lineTo(40, 0).lineTo(0, 40).lineTo(0, 0).closePath().build();
194 for (PathBuilder b: new PathBuilder[] {
195 new PathBuilder().addPath(subpath),
196 new PathBuilder().incReserve(10).addPath(subpath).closePath()
197 })
198 {
199 TestRunner.pushStack(b.toString());
200 try {
201 Point p0 = new Point(0, 0);
202 Point p1 = new Point(40, 40);
203 Point p2 = new Point(40, 0);
204 Point p3 = new Point(0, 40);
205 Point p4 = new Point(0, 0);
206 Point p5 = new Point(10, 10);
207
208 assertArrayEquals(new Point[] { p0, p1, p2, p3, p4 }, b.getPoints());
209 assertEquals(p4, b.getLastPt());
210 b.setLastPt(p5);
211 assertArrayEquals(new Point[] { p0, p1, p2, p3, p5 }, b.getPoints());
212 assertEquals(p5, b.getLastPt());
213
214 assertArrayEquals(new PathVerb[] { PathVerb.MOVE, PathVerb.LINE, PathVerb.LINE, PathVerb.LINE, PathVerb.LINE, PathVerb.CLOSE }, b.getVerbs());
215
216 Path p = b.build();
217 assertNotEquals(0L, p.getApproximateBytesUsed());
218
219 assertArrayEquals(new PathSegmentType[] { PathSegmentType.LINE }, p.getSegmentTypes());
220 } finally {
221 TestRunner.popStack();
222 }
223 }
224 }
225
226 public void swap() {
227 try (Path p1 = new PathBuilder().lineTo(40, 40).lineTo(40, 0).lineTo(0, 40).lineTo(0, 0).closePath().build();

Callers

nothing calls this directly

Calls 15

pushStackMethod · 0.95
getSegmentTypesMethod · 0.95
popStackMethod · 0.95
closePathMethod · 0.80
lineToMethod · 0.80
addPathMethod · 0.80
incReserveMethod · 0.80
assertArrayEqualsMethod · 0.80
assertEqualsMethod · 0.80
setLastPtMethod · 0.80
assertNotEqualsMethod · 0.80

Tested by

no test coverage detected