Exemplo n.º 1
0
        public GRBackendTexture(GRGlBackendTextureDesc desc)
            : this(IntPtr.Zero, true)
        {
            var handle = desc.TextureHandle;

            if (handle.Format == 0)
            {
                handle.Format = desc.Config.ToGlSizedFormat();
            }
            CreateGl(desc.Width, desc.Height, false, handle);
        }
Exemplo n.º 2
0
        public static SKSurface CreateAsRenderTarget(GRContext context, GRGlBackendTextureDesc 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.º 3
0
 public static SKImage FromAdoptedTexture(GRContext context, GRGlBackendTextureDesc desc, SKAlphaType alpha)
 {
     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(FromAdoptedTexture(context, d, alpha));
     }
 }
Exemplo n.º 4
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));
     }
 }
Exemplo n.º 5
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.º 6
0
 public static SKImage FromAdoptedTexture(GRContext context, GRGlBackendTextureDesc desc)
 {
     return(FromAdoptedTexture(context, desc, SKAlphaType.Premul));
 }
Exemplo n.º 7
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.º 8
0
 public static SKImage FromTexture(GRContext context, GRGlBackendTextureDesc desc, SKAlphaType alpha, SKImageTextureReleaseDelegate releaseProc)
 {
     return(FromTexture(context, desc, alpha, releaseProc, null));
 }
Exemplo n.º 9
0
 public static SKImage FromTexture(GRContext context, GRGlBackendTextureDesc desc, SKAlphaType alpha)
 {
     return(FromTexture(context, desc, alpha, null, null));
 }
Exemplo n.º 10
0
 public static SKSurface CreateAsRenderTarget(GRContext context, GRGlBackendTextureDesc desc, SKSurfaceProps props) =>
 CreateAsRenderTarget(context, new GRBackendTexture(desc), desc.Origin, desc.SampleCount, desc.Config.ToColorType(), null, new SKSurfaceProperties(props));
Exemplo n.º 11
0
 public static SKSurface Create(GRContext context, GRGlBackendTextureDesc desc) =>
 Create(context, new GRBackendTexture(desc), desc.Origin, desc.SampleCount, desc.Config.ToColorType(), null, null);
Exemplo n.º 12
0
        public static SKSurface Create(GRContext context, GRGlBackendTextureDesc desc)
        {
            var texture = new GRBackendTexture(desc);

            return(Create(context, texture, desc.Origin, desc.SampleCount, desc.Config.ToColorType(), null));
        }