MCPcopy Index your code
hub / github.com/HumbleUI/Skija / swap

Method swap

tests/java/BitmapTest.java:52–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 }
51
52 public void swap() throws Exception {
53 try (Bitmap a = new Bitmap(); Bitmap b = new Bitmap()) {
54 a.allocN32Pixels(10, 20);
55 b.allocN32Pixels(5, 6);
56 int aW = a.getWidth();
57 int aH = a.getHeight();
58 int bW = b.getWidth();
59 int bH = b.getHeight();
60 assertNotEquals(aW, bW);
61 a.swap(b);
62 // After swap, a should now have original b dimensions and vice versa
63 assertEquals(bW, a.getWidth());
64 assertEquals(bH, a.getHeight());
65 assertEquals(aW, b.getWidth());
66 assertEquals(aH, b.getHeight());
67 }
68 }
69
70 public void getSurfaceNull() throws Exception {
71 try (Bitmap a = new Bitmap()) {

Callers

nothing calls this directly

Calls 5

allocN32PixelsMethod · 0.80
assertNotEqualsMethod · 0.80
assertEqualsMethod · 0.80
getWidthMethod · 0.65
getHeightMethod · 0.65

Tested by

no test coverage detected