Returns Canvas that draws into Surface. Subsequent calls return the same Canvas. Canvas returned is managed and owned by Surface, and is deleted when Surface is deleted. @return Canvas for Surface
()
| 580 | * @return Canvas for Surface |
| 581 | */ |
| 582 | @NotNull |
| 583 | public Canvas getCanvas() { |
| 584 | try { |
| 585 | Stats.onNativeCall(); |
| 586 | long ptr = _nGetCanvas(_ptr); |
| 587 | return ptr == 0 ? null : new Canvas(ptr, false, this); |
| 588 | } finally { |
| 589 | Reference.reachabilityFence(this); |
| 590 | } |
| 591 | } |
| 592 | |
| 593 | /** |
| 594 | * <p>Returns a compatible Surface, or null.</p> |