Exemplo n.º 1
0
        public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTextureDesc desc)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var texture = new GRBackendTexture(desc);

            return(CreateAsRenderTarget(context, texture, desc.Origin, desc.SampleCount, desc.Config.ToColorType(), null));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
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)));
        }
Exemplo n.º 4
0
        public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (texture == null)
            {
                throw new ArgumentNullException(nameof(texture));
            }

            var cs = colorspace == null ? IntPtr.Zero : colorspace.Handle;

            return(GetObject <SKSurface> (SkiaApi.sk_surface_new_backend_texture(context.Handle, texture.Handle, origin, sampleCount, colorType, cs, IntPtr.Zero)));
        }
Exemplo n.º 5
0
        public static SKImage FromAdoptedTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha, SKColorSpace colorspace)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (texture == null)
            {
                throw new ArgumentNullException(nameof(texture));
            }

            var cs = colorspace == null ? IntPtr.Zero : colorspace.Handle;

            return(GetObject <SKImage> (SkiaApi.sk_image_new_from_adopted_texture(context.Handle, texture.Handle, origin, colorType, alpha, cs)));
        }
Exemplo n.º 6
0
        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)));
        }
Exemplo n.º 7
0
        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)));
            }
        }
Exemplo n.º 8
0
 public static SKImage FromAdoptedTexture(GRRecordingContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType) =>
 FromAdoptedTexture(context, texture, origin, colorType, SKAlphaType.Premul, null);
Exemplo n.º 9
0
 public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKSurfaceProps props)
 {
     return(Create(context, texture, origin, sampleCount, colorType, null, props));
 }
Exemplo n.º 10
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);
Exemplo n.º 11
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) =>
 CreateAsRenderTarget(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, props);
Exemplo n.º 12
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace) =>
 CreateAsRenderTarget(context, texture, origin, sampleCount, colorType, colorspace, null);
Exemplo n.º 13
0
        public static SKSurface Create(GRContext context, GRBackendTextureDesc desc)
        {
            var texture = new GRBackendTexture(desc);

            return(Create(context, texture, desc.Origin, desc.SampleCount, desc.Config.ToColorType(), null));
        }
Exemplo n.º 14
0
 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));
 }
Exemplo n.º 15
0
 public static SKImage FromAdoptedTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha)
 {
     return(FromAdoptedTexture(context, texture, origin, colorType, alpha, null));
 }
Exemplo n.º 16
0
        public static SKImage FromAdoptedTexture(GRContext context, GRGlBackendTextureDesc desc, SKAlphaType alpha)
        {
            var texture = new GRBackendTexture(desc);

            return(FromAdoptedTexture(context, texture, desc.Origin, desc.Config.ToColorType(), alpha, null));
        }
Exemplo n.º 17
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) =>
 Create(context, texture, colorType, props);
Exemplo n.º 18
0
 public static SKSurface Create(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProps props)
 {
     return(Create(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, props));
 }
Exemplo n.º 19
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType)
 {
     return(CreateAsRenderTarget(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null));
 }
Exemplo n.º 20
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKSurfaceProps props)
 {
     return(CreateAsRenderTarget(context, texture, origin, 0, colorType, null, props));
 }
Exemplo n.º 21
0
        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));
        }
Exemplo n.º 22
0
 public static SKImage FromAdoptedTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha, SKColorSpace colorspace) =>
 FromAdoptedTexture((GRRecordingContext)context, texture, origin, colorType, alpha, colorspace);
Exemplo n.º 23
0
 public static SKImage FromTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType)
 {
     return(FromTexture(context, texture, origin, colorType, SKAlphaType.Premul, null, null, null));
 }
Exemplo n.º 24
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType) =>
 CreateAsRenderTarget(context, texture, origin, 0, colorType, null, null);
Exemplo n.º 25
0
 public static SKSurface Create(GRContext context, GRBackendTexture texture, SKColorType colorType) =>
 Create(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, null);
Exemplo n.º 26
0
 public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType)
 {
     return(Create(context, texture, origin, 0, colorType, null));
 }
Exemplo n.º 27
0
 public static SKImage FromAdoptedTexture(GRContext context, GRBackendTexture texture, SKColorType colorType)
 {
     return(FromAdoptedTexture(context, texture, GRSurfaceOrigin.BottomLeft, colorType, SKAlphaType.Premul, null));
 }
Exemplo n.º 28
0
 public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType) =>
 Create(context, texture, origin, sampleCount, colorType, null, null);
Exemplo n.º 29
0
 public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKSurfaceProperties props) =>
 Create(context, texture, origin, 0, colorType, null, props);
Exemplo n.º 30
0
 public static SKImage FromAdoptedTexture(GRContext context, GRBackendTexture texture, SKColorType colorType) =>
 FromAdoptedTexture((GRRecordingContext)context, texture, colorType);