示例#1
0
        private static void SKBitmapReleaseInternal(IntPtr address, IntPtr context)
        {
            var ctx = SKBitmapReleaseDelegateContext.Unwrap(context);

            ctx.Release(address, ctx.Context);

            SKBitmapReleaseDelegateContext.Free(context);
        }
示例#2
0
        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));
            }
        }
示例#3
0
		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);
			}
		}