Пример #1
0
 static TempContext <PixelFarm.CpuBlit.PathWriter> Borrow(out PixelFarm.CpuBlit.PathWriter pathWriter)
 {
     if (!Temp <PixelFarm.CpuBlit.PathWriter> .IsInit())
     {
         Temp <PixelFarm.CpuBlit.PathWriter> .SetNewHandler(
             () => new PixelFarm.CpuBlit.PathWriter(),
             w => w.UnbindVxs());
     }
     return(Temp <PixelFarm.CpuBlit.PathWriter> .Borrow(out pathWriter));
 }
 public static void GetFreePathWriter(out PixelFarm.CpuBlit.PathWriter p)
 {
     if (s_pathWriters.Count > 0)
     {
         p = s_pathWriters.Pop();
     }
     else
     {
         p = new CpuBlit.PathWriter();
     }
 }
Пример #3
0
        public static TempContext <PixelFarm.CpuBlit.PathWriter> Borrow(VertexStore vxs, out PixelFarm.CpuBlit.PathWriter pathWriter)
        {
            var tmpPw = Borrow(out pathWriter);

            tmpPw._tool.BindVxs(vxs);
            return(tmpPw);
        }
 public static void ReleasePathWriter(ref PixelFarm.CpuBlit.PathWriter p)
 {
     p.Clear();
     s_pathWriters.Push(p);
     p = null;
 }