Пример #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));
 }
Пример #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));
		}
Пример #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);
Пример #4
0
 public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceProps props) =>
 Create(info, pixels, rowBytes, null, null, new SKSurfaceProperties(props));
Пример #5
0
 public static SKSurface Create(SKImageInfo info, SKSurfaceProps props) =>
 Create(info, 0, new SKSurfaceProperties(props));
Пример #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));
Пример #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)));
            }
        }
Пример #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)));
        }
Пример #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));
        }
Пример #10
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProps props)
 {
     return(CreateAsRenderTarget(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, props));
 }
Пример #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));
 }
Пример #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)));
        }
Пример #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));
        }
Пример #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));
 }
Пример #15
0
 public static SKSurface Create(GRContext context, GRBackendRenderTarget renderTarget, SKColorType colorType, SKSurfaceProps props)
 {
     return(Create(context, renderTarget, GRSurfaceOrigin.BottomLeft, colorType, null, props));
 }
Пример #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));
		}
Пример #17
0
 public static SKSurface Create(int width, int height, SKColorType colorType, SKAlphaType alphaType, SKSurfaceProps props) => Create(new SKImageInfo(width, height, colorType, alphaType), props);
Пример #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)));
        }
Пример #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)));
        }
Пример #20
0
 public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, SKSurfaceProps props)
 {
     return(Create(context, budgeted, info, 0, GRSurfaceOrigin.BottomLeft, props, false));
 }
Пример #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)));
        }
Пример #22
0
 public static SKSurface Create(SKImageInfo info, SKSurfaceProps props)
 {
     return(Create(info, 0, props));
 }
Пример #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);
Пример #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);
Пример #25
0
 public static SKSurface Create(SKPixmap pixmap, SKSurfaceProps props) =>
 Create(pixmap, new SKSurfaceProperties(props));
Пример #26
0
		public extern static sk_surface_t sk_surface_new_raster(ref SKImageInfo info, ref SKSurfaceProps pros);
Пример #27
0
		public static SKSurface Create (int width, int height, SKColorType colorType, SKAlphaType alphaType, SKSurfaceProps props) => Create (new SKImageInfo (width, height, colorType, alphaType), props);
Пример #28
0
		public extern static sk_surface_t sk_surface_new_raster_direct(ref SKImageInfo info, IntPtr pixels, IntPtr rowBytes, ref SKSurfaceProps props);
Пример #29
0
		public static SKSurface Create (SKImageInfo info, SKSurfaceProps props)
		{
			return GetObject<SKSurface> (SkiaApi.sk_surface_new_raster (ref info, ref props));
		}
Пример #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);
Пример #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));
		}
Пример #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));
     }
 }
Пример #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)));
        }
Пример #34
0
 public extern static sk_surface_t sk_surface_new_raster(ref SKImageInfo info, ref SKSurfaceProps pros);
Пример #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);
Пример #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)
 {
 }
Пример #38
0
 public static SKSurface Create(SKImageInfo info, SKSurfaceProps props)
 {
     return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster(ref info, ref props)));
 }
Пример #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)));
 }
Пример #40
0
 public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceProps props)
 {
     return(Create(info, pixels, rowBytes, null, null, props));
 }