public static Surface makeRenderTarget()

in shared/java/Surface.java [428:459]


    public static Surface makeRenderTarget(@NotNull DirectContext context,
                                           boolean budgeted,
                                           @NotNull ImageInfo imageInfo,
                                           int sampleCount,
                                           @NotNull SurfaceOrigin origin,
                                           @Nullable SurfaceProps surfaceProps,
                                           boolean shouldCreateWithMips) {
        try {
            assert context != null : "Can’t makeFromBackendRenderTarget with context == null";
            assert imageInfo != null : "Can’t makeFromBackendRenderTarget with imageInfo == null";
            assert origin != null : "Can’t makeFromBackendRenderTarget with origin == null";
            Stats.onNativeCall();
            long ptr = _nMakeRenderTarget(
                Native.getPtr(context),
                budgeted,
                imageInfo._width,
                imageInfo._height,
                imageInfo._colorInfo._colorType.ordinal(),
                imageInfo._colorInfo._alphaType.ordinal(),
                Native.getPtr(imageInfo._colorInfo._colorSpace),
                sampleCount,
                origin.ordinal(),
                surfaceProps,
                shouldCreateWithMips);
            if (ptr == 0)
                throw new IllegalArgumentException(String.format("Failed Surface.makeRenderTarget(%s, %b, %s, %d, %s, %s, %b)", context, budgeted, imageInfo, sampleCount, origin, surfaceProps, shouldCreateWithMips));
            return new Surface(ptr, context);
        } finally {
            Reference.reachabilityFence(context);
            Reference.reachabilityFence(imageInfo._colorInfo._colorSpace);
        }
    }