Returns a compatible Surface, or null. Returned Surface contains the same raster, GPU, or null properties as the original. Returned Surface does not share the same pixels. Returns null if imageInfo width or height are zero, or if imageInfo is incompatible with Surface. @param
(ImageInfo imageInfo)
| 685 | * @see <a href="https://fiddle.skia.org/c/@Surface_makeSurface">https://fiddle.skia.org/c/@Surface_makeSurface</a> |
| 686 | */ |
| 687 | @Nullable |
| 688 | public Surface makeSurface(ImageInfo imageInfo) { |
| 689 | try { |
| 690 | Stats.onNativeCall(); |
| 691 | long ptr = _nMakeSurfaceI(_ptr, |
| 692 | imageInfo._width, |
| 693 | imageInfo._height, |
| 694 | imageInfo._colorInfo._colorType.ordinal(), |
| 695 | imageInfo._colorInfo._alphaType.ordinal(), |
| 696 | Native.getPtr(imageInfo._colorInfo._colorSpace)); |
| 697 | return new Surface(ptr); |
| 698 | } finally { |
| 699 | ReferenceUtil.reachabilityFence(this); |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | /** |
| 704 | * <p>Calls makeSurface(ImageInfo) with the same ImageInfo as this surface, |