MCPcopy Create free account
hub / github.com/JetBrains/skija / makeSurface

Method makeSurface

shared/java/Surface.java:605–619  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

603 * @see <a href="https://fiddle.skia.org/c/@Surface_makeSurface">https://fiddle.skia.org/c/@Surface_makeSurface</a>
604 */
605 @Nullable
606 public Surface makeSurface(ImageInfo imageInfo) {
607 try {
608 Stats.onNativeCall();
609 long ptr = _nMakeSurfaceI(_ptr,
610 imageInfo._width,
611 imageInfo._height,
612 imageInfo._colorInfo._colorType.ordinal(),
613 imageInfo._colorInfo._alphaType.ordinal(),
614 Native.getPtr(imageInfo._colorInfo._colorSpace));
615 return new Surface(ptr);
616 } finally {
617 Reference.reachabilityFence(this);
618 }
619 }
620
621 /**
622 * <p>Calls makeSurface(ImageInfo) with the same ImageInfo as this surface,

Calls 4

onNativeCallMethod · 0.95
_nMakeSurfaceIMethod · 0.95
getPtrMethod · 0.95
_nMakeSurfaceMethod · 0.95

Tested by 1

executeMethod · 0.64