private static void SKBitmapReleaseInternal(IntPtr address, IntPtr context) { var ctx = SKBitmapReleaseDelegateContext.Unwrap(context); ctx.Release(address, ctx.Context); SKBitmapReleaseDelegateContext.Free(context); }
public bool InstallPixels(SKImageInfo info, IntPtr pixels, int rowBytes, SKColorTable ctable, SKBitmapReleaseDelegate releaseProc, object context) { IntPtr ct = ctable == null ? IntPtr.Zero : ctable.Handle; if (releaseProc == null) { return(SkiaApi.sk_bitmap_install_pixels(Handle, ref info, pixels, (IntPtr)rowBytes, ct, IntPtr.Zero, IntPtr.Zero)); } else { var del = Marshal.GetFunctionPointerForDelegate(releaseDelegate); var ctx = new SKBitmapReleaseDelegateContext(releaseProc, context); var ctxPtr = ctx.Wrap(); return(SkiaApi.sk_bitmap_install_pixels(Handle, ref info, pixels, (IntPtr)rowBytes, ct, del, ctxPtr)); } }
public bool InstallPixels (SKImageInfo info, IntPtr pixels, int rowBytes, SKColorTable ctable, SKBitmapReleaseDelegate releaseProc, object context) { IntPtr ct = ctable == null ? IntPtr.Zero : ctable.Handle; if (releaseProc == null) { return SkiaApi.sk_bitmap_install_pixels (Handle, ref info, pixels, (IntPtr)rowBytes, ct, IntPtr.Zero, IntPtr.Zero); } else { var del = Marshal.GetFunctionPointerForDelegate (releaseDelegate); var ctx = new SKBitmapReleaseDelegateContext (releaseProc, context); var ctxPtr = ctx.Wrap (); return SkiaApi.sk_bitmap_install_pixels (Handle, ref info, pixels, (IntPtr)rowBytes, ct, del, ctxPtr); } }