public static SKSurface Create(SKPixmap pixmap, SKSurfaceProperties props) { if (pixmap == null) { throw new ArgumentNullException(nameof(pixmap)); } return(Create(pixmap.Info, pixmap.GetPixels(), pixmap.RowBytes, null, null, props)); }
public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKSurfaceProperties props) => Create(context, texture, origin, 0, colorType, null, props);
public static SKSurface Create(GRContext context, GRBackendRenderTarget renderTarget, GRSurfaceOrigin origin, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (renderTarget == null) { throw new ArgumentNullException(nameof(renderTarget)); } return(GetObject <SKSurface> (SkiaApi.sk_surface_new_backend_render_target(context.Handle, renderTarget.Handle, origin, colorType, colorspace?.Handle ?? IntPtr.Zero, props?.Handle ?? IntPtr.Zero))); }
public static SKSurface Create(GRRecordingContext context, GRBackendRenderTarget renderTarget, SKColorType colorType, SKSurfaceProperties props) => Create(context, renderTarget, GRSurfaceOrigin.BottomLeft, colorType, null, props);
public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceProperties props) => Create(info, pixels, rowBytes, null, null, props);
public static SKSurface Create(SKImageInfo info, int rowBytes, SKSurfaceProperties props) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster(ref cinfo, (IntPtr)rowBytes, props?.Handle ?? IntPtr.Zero))); }
public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, GRSurfaceOrigin origin, SKSurfaceProperties props, bool shouldCreateWithMips) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var cinfo = SKImageInfoNative.FromManaged(ref info); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_render_target(context.Handle, budgeted, ref cinfo, sampleCount, origin, props?.Handle ?? IntPtr.Zero, shouldCreateWithMips))); }
public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (texture == null) { throw new ArgumentNullException(nameof(texture)); } return(GetObject <SKSurface> (SkiaApi.sk_surface_new_backend_texture_as_render_target(context.Handle, texture.Handle, origin, sampleCount, colorType, colorspace?.Handle ?? IntPtr.Zero, props?.Handle ?? IntPtr.Zero))); }
public static SKSurface Create(GRContext context, CoreAnimation.CAMetalLayer layer, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props, out CoreAnimation.ICAMetalDrawable drawable) => Create((GRRecordingContext)context, layer, origin, sampleCount, colorType, colorspace, props, out drawable);
public static SKSurface Create(GRRecordingContext context, bool budgeted, SKImageInfo info, SKSurfaceProperties props) => Create(context, budgeted, info, 0, GRSurfaceOrigin.BottomLeft, props, false);
public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, GRSurfaceOrigin origin, SKSurfaceProperties props, bool shouldCreateWithMips) => Create((GRRecordingContext)context, budgeted, info, sampleCount, origin, props, false);
public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, SKSurfaceProperties props) => Create((GRRecordingContext)context, budgeted, info, sampleCount, props);
public static SKSurface Create(GRRecordingContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) => Create(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, props);
public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) => Create((GRRecordingContext)context, texture, origin, sampleCount, colorType, colorspace, props);
public static SKSurface Create(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) => Create((GRRecordingContext)context, texture, colorType, props);
public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) => CreateAsRenderTarget(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, props);
public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKSurfaceProperties props) => CreateAsRenderTarget(context, texture, origin, sampleCount, colorType, null, props);
public static SKSurface Create(GRRecordingContext context, MetalKit.MTKView view, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) => GetObject(SkiaApi.sk_surface_new_metal_view(context.Handle, (void *)view.Handle, origin, sampleCount, colorType.ToNative(), colorspace?.Handle ?? IntPtr.Zero, props?.Handle ?? IntPtr.Zero));
public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, SKSurfaceProperties props) => Create(context, budgeted, info, sampleCount, GRSurfaceOrigin.BottomLeft, props, false);
public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceReleaseDelegate releaseProc, object context, SKSurfaceProperties props) { var cinfo = SKImageInfoNative.FromManaged(ref info); if (releaseProc == null) { return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster_direct(ref cinfo, pixels, (IntPtr)rowBytes, IntPtr.Zero, IntPtr.Zero, props?.Handle ?? IntPtr.Zero))); } else { var ctx = new NativeDelegateContext(context, releaseProc); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster_direct(ref cinfo, pixels, (IntPtr)rowBytes, releaseDelegate, ctx.NativeContext, props?.Handle ?? IntPtr.Zero))); } }
public static SKSurface Create(SKImageInfo info, SKSurfaceProperties props) => Create(info, 0, props);
public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) => Create(context, texture, colorType, props);
public static SKSurface Create(GRContext context, CoreAnimation.CAMetalLayer layer, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props, out CoreAnimation.ICAMetalDrawable drawable) { void *drawablePtr; var surface = GetObject(SkiaApi.sk_surface_new_metal_layer(context.Handle, (void *)layer.Handle, origin, sampleCount, colorType.ToNative(), colorspace?.Handle ?? IntPtr.Zero, props?.Handle ?? IntPtr.Zero, &drawablePtr)); drawable = ObjCRuntime.Runtime.GetINativeObject <CoreAnimation.ICAMetalDrawable> ((IntPtr)drawablePtr, true); return(surface); }
public static SKSurface Create(GRContext context, GRBackendRenderTarget renderTarget, GRSurfaceOrigin origin, SKColorType colorType, SKSurfaceProperties props) => Create(context, renderTarget, origin, colorType, null, props);
public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceReleaseDelegate releaseProc, object context, SKSurfaceProperties props) { var cinfo = SKImageInfoNative.FromManaged(ref info); var del = releaseProc != null && context != null ? new SKSurfaceReleaseDelegate((addr, _) => releaseProc(addr, context)) : releaseProc; var proxy = DelegateProxies.Create(del, DelegateProxies.SKSurfaceReleaseDelegateProxy, out _, out var ctx); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster_direct(ref cinfo, pixels, (IntPtr)rowBytes, proxy, ctx, props?.Handle ?? IntPtr.Zero))); }
public static SKSurface Create(GRContext context, GRBackendRenderTarget renderTarget, GRSurfaceOrigin origin, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) => Create((GRRecordingContext)context, renderTarget, origin, colorType, colorspace, props);