Ejemplo n.º 1
0
 public static SKSurface Create(SKPixmap pixmap, SKSurfaceProps props)
 {
     if (pixmap == null)
     {
         throw new ArgumentNullException(nameof(pixmap));
     }
     return(Create(pixmap.Info, pixmap.GetPixels(), pixmap.RowBytes, props));
 }
Ejemplo n.º 2
0
		public static SKSurface Create (SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceProps props)
		{
			return GetObject<SKSurface> (SkiaApi.sk_surface_new_raster_direct (ref info, pixels, (IntPtr)rowBytes, ref props));
		}
Ejemplo n.º 3
0
		public static SKSurface Create (int width, int height, SKColorType colorType, SKAlphaType alphaType, IntPtr pixels, int rowBytes, SKSurfaceProps props) => Create (new SKImageInfo (width, height, colorType, alphaType), pixels, rowBytes, props);
Ejemplo n.º 4
0
 public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceProps props) =>
 Create(info, pixels, rowBytes, null, null, new SKSurfaceProperties(props));
Ejemplo n.º 5
0
 public static SKSurface Create(SKImageInfo info, SKSurfaceProps props) =>
 Create(info, 0, new SKSurfaceProperties(props));
Ejemplo n.º 6
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTextureDesc desc, SKSurfaceProps props) =>
 CreateAsRenderTarget(context, new GRBackendTexture(desc), desc.Origin, desc.SampleCount, desc.Config.ToColorType(), null, new SKSurfaceProperties(props));
Ejemplo n.º 7
0
        public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceReleaseDelegate releaseProc, object context, SKSurfaceProps 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, ref props)));
            }
            else
            {
                var ctx = new NativeDelegateContext(context, releaseProc);
                return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster_direct(ref cinfo, pixels, (IntPtr)rowBytes, releaseDelegate, ctx.NativeContext, ref props)));
            }
        }
Ejemplo n.º 8
0
        public static SKSurface Create(SKImageInfo info, SKSurfaceProps props)
        {
            var cinfo = SKImageInfoNative.FromManaged(ref info);

            return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster(ref cinfo, ref props)));
        }
Ejemplo n.º 9
0
        public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTextureDesc desc, SKSurfaceProps props)
        {
            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, props));
        }
Ejemplo n.º 10
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProps props)
 {
     return(CreateAsRenderTarget(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, props));
 }
Ejemplo n.º 11
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKSurfaceProps props)
 {
     return(CreateAsRenderTarget(context, texture, origin, sampleCount, colorType, null, props));
 }
Ejemplo n.º 12
0
        // GPU BACKEND TEXTURE AS RENDER TARGET surface

        public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProps props)
        {
            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_as_render_target(context.Handle, texture.Handle, origin, sampleCount, colorType, cs, ref props)));
        }
Ejemplo n.º 13
0
        public static SKSurface Create(GRContext context, GRBackendTextureDesc desc, SKSurfaceProps props)
        {
            var texture = new GRBackendTexture(desc);

            return(Create(context, texture, desc.Origin, desc.SampleCount, desc.Config.ToColorType(), null, props));
        }
Ejemplo n.º 14
0
 public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKSurfaceProps props)
 {
     return(Create(context, texture, origin, 0, colorType, null, props));
 }
Ejemplo n.º 15
0
 public static SKSurface Create(GRContext context, GRBackendRenderTarget renderTarget, SKColorType colorType, SKSurfaceProps props)
 {
     return(Create(context, renderTarget, GRSurfaceOrigin.BottomLeft, colorType, null, props));
 }
Ejemplo n.º 16
0
		public static SKSurface Create (GRContext context, bool budgeted, SKImageInfo info, int sampleCount, SKSurfaceProps props)
		{
			return GetObject<SKSurface> (SkiaApi.sk_surface_new_render_target (context.Handle, budgeted, ref info, sampleCount, ref props));
		}
Ejemplo n.º 17
0
 public static SKSurface Create(int width, int height, SKColorType colorType, SKAlphaType alphaType, SKSurfaceProps props) => Create(new SKImageInfo(width, height, colorType, alphaType), props);
Ejemplo n.º 18
0
        // GPU NEW surface

        public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, GRSurfaceOrigin origin, SKSurfaceProps 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, ref props, shouldCreateWithMips)));
        }
Ejemplo n.º 19
0
        public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceProps props)
        {
            var cinfo = SKImageInfoNative.FromManaged(ref info);

            return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster_direct(ref cinfo, pixels, (IntPtr)rowBytes, ref props)));
        }
Ejemplo n.º 20
0
 public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, SKSurfaceProps props)
 {
     return(Create(context, budgeted, info, 0, GRSurfaceOrigin.BottomLeft, props, false));
 }
Ejemplo n.º 21
0
        public static SKSurface Create(GRContext context, GRBackendRenderTargetDesc desc, SKSurfaceProps props)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var renderTarget = new GRBackendRenderTarget(context.Backend, desc);

            return(Create(context, renderTarget, desc.Origin, desc.Config.ToColorType(), null, new SKSurfaceProperties(props)));
        }
Ejemplo n.º 22
0
 public static SKSurface Create(SKImageInfo info, SKSurfaceProps props)
 {
     return(Create(info, 0, props));
 }
Ejemplo n.º 23
0
 public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, SKSurfaceProps props) =>
 Create(context, budgeted, info, sampleCount, GRSurfaceOrigin.BottomLeft, new SKSurfaceProperties(props), false);
Ejemplo n.º 24
0
		public extern static sk_surface_t sk_surface_new_render_target (gr_context_t context, bool budgeted, ref SKImageInfo info, int sampleCount, ref SKSurfaceProps props);
Ejemplo n.º 25
0
 public static SKSurface Create(SKPixmap pixmap, SKSurfaceProps props) =>
 Create(pixmap, new SKSurfaceProperties(props));
Ejemplo n.º 26
0
		public extern static sk_surface_t sk_surface_new_raster(ref SKImageInfo info, ref SKSurfaceProps pros);
Ejemplo n.º 27
0
		public static SKSurface Create (int width, int height, SKColorType colorType, SKAlphaType alphaType, SKSurfaceProps props) => Create (new SKImageInfo (width, height, colorType, alphaType), props);
Ejemplo n.º 28
0
		public extern static sk_surface_t sk_surface_new_raster_direct(ref SKImageInfo info, IntPtr pixels, IntPtr rowBytes, ref SKSurfaceProps props);
Ejemplo n.º 29
0
		public static SKSurface Create (SKImageInfo info, SKSurfaceProps props)
		{
			return GetObject<SKSurface> (SkiaApi.sk_surface_new_raster (ref info, ref props));
		}
Ejemplo n.º 30
0
		public extern static sk_surface_t sk_surface_new_backend_texture_as_render_target (gr_context_t context, ref GRBackendTextureDesc desc, ref SKSurfaceProps props);
Ejemplo n.º 31
0
		public static SKSurface CreateAsRenderTarget (GRContext context, GRBackendTextureDesc desc, SKSurfaceProps props)
		{
			return GetObject<SKSurface> (SkiaApi.sk_surface_new_backend_texture_as_render_target (context.Handle, ref desc, ref props));
		}
Ejemplo n.º 32
0
 public static SKSurface Create(GRContext context, GRGlBackendTextureDesc desc, SKSurfaceProps props)
 {
     unsafe {
         var h    = desc.TextureHandle;
         var hPtr = &h;
         var d    = new GRBackendTextureDesc {
             Flags         = desc.Flags,
             Origin        = desc.Origin,
             Width         = desc.Width,
             Height        = desc.Height,
             Config        = desc.Config,
             SampleCount   = desc.SampleCount,
             TextureHandle = (IntPtr)hPtr,
         };
         return(Create(context, d, props));
     }
 }
Ejemplo n.º 33
0
        public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, SKSurfaceProps props)
        {
            var cinfo = SKImageInfoNative.FromManaged(ref info);

            return(GetObject <SKSurface> (SkiaApi.sk_surface_new_render_target(context.Handle, budgeted, ref cinfo, sampleCount, ref props)));
        }
Ejemplo n.º 34
0
 public extern static sk_surface_t sk_surface_new_raster(ref SKImageInfo info, ref SKSurfaceProps pros);
Ejemplo n.º 35
0
 public static SKSurface Create(int width, int height, SKColorType colorType, SKAlphaType alphaType, IntPtr pixels, int rowBytes, SKSurfaceProps props) => Create(new SKImageInfo(width, height, colorType, alphaType), pixels, rowBytes, props);
Ejemplo n.º 36
0
 public extern static sk_surface_t sk_surface_new_raster_direct(ref SKImageInfo info, IntPtr pixels, IntPtr rowBytes, ref SKSurfaceProps props);
 public SKSurfaceProperties(SKSurfaceProps props)
     : this(props.Flags, props.PixelGeometry)
 {
 }
Ejemplo n.º 38
0
 public static SKSurface Create(SKImageInfo info, SKSurfaceProps props)
 {
     return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster(ref info, ref props)));
 }
Ejemplo n.º 39
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTextureDesc desc, SKSurfaceProps props)
 {
     return(GetObject <SKSurface> (SkiaApi.sk_surface_new_backend_texture_as_render_target(context.Handle, ref desc, ref props)));
 }
Ejemplo n.º 40
0
 public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceProps props)
 {
     return(Create(info, pixels, rowBytes, null, null, props));
 }