コード例 #1
0
 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));
 }
コード例 #2
0
 public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKSurfaceProperties props) =>
 Create(context, texture, origin, 0, colorType, null, props);
コード例 #3
0
        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)));
        }
コード例 #4
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 public static SKSurface Create(GRRecordingContext context, GRBackendRenderTarget renderTarget, SKColorType colorType, SKSurfaceProperties props) =>
 Create(context, renderTarget, GRSurfaceOrigin.BottomLeft, colorType, null, props);
コード例 #5
0
 public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceProperties props) =>
 Create(info, pixels, rowBytes, null, null, props);
コード例 #6
0
        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)));
        }
コード例 #7
0
        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)));
        }
コード例 #8
0
        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)));
        }
コード例 #9
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 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);
コード例 #10
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 public static SKSurface Create(GRRecordingContext context, bool budgeted, SKImageInfo info, SKSurfaceProperties props) =>
 Create(context, budgeted, info, 0, GRSurfaceOrigin.BottomLeft, props, false);
コード例 #11
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 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);
コード例 #12
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, SKSurfaceProperties props) =>
 Create((GRRecordingContext)context, budgeted, info, sampleCount, props);
コード例 #13
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 public static SKSurface Create(GRRecordingContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) =>
 Create(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, props);
コード例 #14
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 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);
コード例 #15
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 public static SKSurface Create(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) =>
 Create((GRRecordingContext)context, texture, colorType, props);
コード例 #16
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) =>
 CreateAsRenderTarget(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, props);
コード例 #17
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKSurfaceProperties props) =>
 CreateAsRenderTarget(context, texture, origin, sampleCount, colorType, null, props);
コード例 #18
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 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));
コード例 #19
0
 public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, SKSurfaceProperties props) =>
 Create(context, budgeted, info, sampleCount, GRSurfaceOrigin.BottomLeft, props, false);
コード例 #20
0
ファイル: SKSurface.cs プロジェクト: zschong/SkiaSharp
        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)));
            }
        }
コード例 #21
0
 public static SKSurface Create(SKImageInfo info, SKSurfaceProperties props) =>
 Create(info, 0, props);
コード例 #22
0
ファイル: SKSurface.cs プロジェクト: ricardoromaobr/SkiaSharp
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) =>
 Create(context, texture, colorType, props);
コード例 #23
0
ファイル: SKSurface.cs プロジェクト: ricardoromaobr/SkiaSharp
        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);
        }
コード例 #24
0
 public static SKSurface Create(GRContext context, GRBackendRenderTarget renderTarget, GRSurfaceOrigin origin, SKColorType colorType, SKSurfaceProperties props) =>
 Create(context, renderTarget, origin, colorType, null, props);
コード例 #25
0
        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)));
        }
コード例 #26
0
ファイル: SKSurface.cs プロジェクト: TheBrainTech/SkiaSharp
 public static SKSurface Create(GRContext context, GRBackendRenderTarget renderTarget, GRSurfaceOrigin origin, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) =>
 Create((GRRecordingContext)context, renderTarget, origin, colorType, colorspace, props);