public static SKImage FromTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha, SKColorSpace colorspace, SKImageTextureReleaseDelegate releaseProc) { return(FromTexture(context, texture, origin, colorType, alpha, colorspace, releaseProc, null)); }
public static SKImage FromTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha, SKColorSpace colorspace, SKImageTextureReleaseDelegate releaseProc, object releaseContext) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (texture == null) { throw new ArgumentNullException(nameof(texture)); } var cs = colorspace == null ? IntPtr.Zero : colorspace.Handle; var del = releaseProc != null && releaseContext != null ? new SKImageTextureReleaseDelegate((_) => releaseProc(releaseContext)) : releaseProc; var proxy = DelegateProxies.Create(del, DelegateProxies.SKImageTextureReleaseDelegateProxy, out _, out var ctx); return(GetObject <SKImage> (SkiaApi.sk_image_new_from_texture(context.Handle, texture.Handle, origin, colorType, alpha, cs, proxy, (void *)ctx))); }
public static SKImage FromTexture(GRContext context, GRGlBackendTextureDesc desc, SKAlphaType alpha, SKImageTextureReleaseDelegate releaseProc) { return(FromTexture(context, desc, alpha, releaseProc, null)); }
public static SKImage FromTexture(GRContext context, GRGlBackendTextureDesc desc, SKAlphaType alpha, SKImageTextureReleaseDelegate releaseProc, object releaseContext) { var texture = new GRBackendTexture(desc); return(FromTexture(context, texture, desc.Origin, desc.Config.ToColorType(), alpha, null, releaseProc, releaseContext)); }
public static SKImage FromTexture(GRContext context, GRBackendTextureDesc desc, SKAlphaType alpha, SKImageTextureReleaseDelegate releaseProc, object releaseContext) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var texture = new GRBackendTexture(desc); return(FromTexture(context, texture, desc.Origin, desc.Config.ToColorType(), alpha, null, releaseProc, releaseContext)); }
public static SKImage FromTexture(GRContext context, GRBackendTextureDesc desc, SKAlphaType alpha, SKImageTextureReleaseDelegate releaseProc, object releaseContext) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (releaseProc == null) { return(GetObject <SKImage> (SkiaApi.sk_image_new_from_texture(context.Handle, ref desc, alpha, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero))); } else { var ctx = new NativeDelegateContext(releaseContext, releaseProc); return(GetObject <SKImage> (SkiaApi.sk_image_new_from_texture(context.Handle, ref desc, alpha, IntPtr.Zero, textureReleaseDelegate, ctx.NativeContext))); } }
public static SKImage FromTexture(GRContext context, GRGlBackendTextureDesc desc, SKAlphaType alpha, SKImageTextureReleaseDelegate releaseProc, object releaseContext) { unsafe { var h = desc.TextureHandle; var hPtr = &h; var d = new GRBackendTextureDesc { Flags = desc.Flags, Origin = desc.Origin, Width = desc.Width, Height = desc.Height, Config = desc.Config, SampleCount = desc.SampleCount, TextureHandle = (IntPtr)hPtr, }; return(FromTexture(context, d, alpha, releaseProc, releaseContext)); } }
public static SKImage FromTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha, SKColorSpace colorspace, SKImageTextureReleaseDelegate releaseProc, object releaseContext) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (texture == null) { throw new ArgumentNullException(nameof(texture)); } var cs = colorspace == null ? IntPtr.Zero : colorspace.Handle; if (releaseProc == null) { return(GetObject <SKImage> (SkiaApi.sk_image_new_from_texture(context.Handle, texture.Handle, origin, colorType, alpha, cs, IntPtr.Zero, IntPtr.Zero))); } else { var ctx = new NativeDelegateContext(releaseContext, releaseProc); return(GetObject <SKImage> (SkiaApi.sk_image_new_from_texture(context.Handle, texture.Handle, origin, colorType, alpha, cs, textureReleaseDelegate, ctx.NativeContext))); } }
public static SKImage FromTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha, SKColorSpace colorspace, SKImageTextureReleaseDelegate releaseProc, object releaseContext) => FromTexture((GRRecordingContext)context, texture, origin, colorType, alpha, colorspace, releaseProc, releaseContext);