in shared/java/Surface.java [275:295]
public static Surface makeFromMTKView(@NotNull DirectContext context,
long mtkViewPtr,
@NotNull SurfaceOrigin origin,
int sampleCount,
@NotNull SurfaceColorFormat colorFormat,
@Nullable ColorSpace colorSpace,
@Nullable SurfaceProps surfaceProps) {
try {
assert context != null : "Can’t makeFromBackendRenderTarget with context == null";
assert origin != null : "Can’t makeFromBackendRenderTarget with origin == null";
assert colorFormat != null : "Can’t makeFromBackendRenderTarget with colorFormat == null";
Stats.onNativeCall();
long ptr = _nMakeFromMTKView(Native.getPtr(context), mtkViewPtr, origin.ordinal(), sampleCount, colorFormat.ordinal(), Native.getPtr(colorSpace), surfaceProps);
if (ptr == 0)
throw new IllegalArgumentException(String.format("Failed Surface.makeFromMTKView(%s, %s, %s, %s, %s, %s)", context, mtkViewPtr, origin, colorFormat, colorSpace, surfaceProps));
return new Surface(ptr, context);
} finally {
Reference.reachabilityFence(context);
Reference.reachabilityFence(colorSpace);
}
}