Beispiel #1
0
 public static TempContext <SvgArcSegment> Borrow(out SvgArcSegment arc)
 {
     if (!Temp <SvgArcSegment> .IsInit())
     {
         Temp <SvgArcSegment> .SetNewHandler(() => new SvgArcSegment());
     }
     return(Temp <SvgArcSegment> .Borrow(out arc));
 }
Beispiel #2
0
 public static TempContext <Arc> Borrow(out Arc arc)
 {
     if (!Temp <Arc> .IsInit())
     {
         Temp <Arc> .SetNewHandler(() => new Arc());
     }
     return(Temp <Arc> .Borrow(out arc));
 }
Beispiel #3
0
 class PrivatePool { } //this make sure we don't share the pool with others
 static Temp <PrivatePool, List <Poly2Tri.TriangulationPoint> > .TempContext Borrow(out List <Poly2Tri.TriangulationPoint> list)
 {
     if (!Temp <PrivatePool, List <Poly2Tri.TriangulationPoint> > .IsInit())
     {
         Temp <PrivatePool, List <Poly2Tri.TriangulationPoint> > .SetNewHandler(
             () => new List <Poly2Tri.TriangulationPoint>(),
             s => s.Clear());
     }
     return(Temp <PrivatePool, List <Poly2Tri.TriangulationPoint> > .Borrow(out list));
 }
Beispiel #4
0
 public static TempContext <Poly2TriTool> Borrow(out Poly2TriTool poly2TriTool)
 {
     if (!Temp <Poly2TriTool> .IsInit())
     {
         Temp <Poly2TriTool> .SetNewHandler(
             () => new Poly2TriTool(),
             s => s.Reset());
     }
     return(PixelFarm.Temp <Poly2TriTool> .Borrow(out poly2TriTool));
 }
Beispiel #5
0
 public static TempContext <ReusableCoordList> Borrow(out ReusableCoordList coordList)
 {
     if (!Temp <ReusableCoordList> .IsInit())
     {
         Temp <ReusableCoordList> .SetNewHandler(
             () => new ReusableCoordList(),
             s => s.Reset());
     }
     return(PixelFarm.Temp <ReusableCoordList> .Borrow(out coordList));
 }
Beispiel #6
0
 public static TempContext <VxsClipper> Borrow(out VxsClipper clipper)
 {
     if (!Temp <VxsClipper> .IsInit())
     {
         Temp <VxsClipper> .SetNewHandler(
             () => new VxsClipper(),
             c => c.Reset());
     }
     return(Temp <VxsClipper> .Borrow(out clipper));
 }
Beispiel #7
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));
 }
Beispiel #8
0
 public static TempContext <Stroke> Borrow(out Stroke stroke)
 {
     if (!Temp <Stroke> .IsInit())
     {
         Temp <Stroke> .SetNewHandler(() => new Stroke(1),
                                      s =>
         {
             s.Width    = 1;
             s.LineCap  = LineCap.Butt;
             s.LineJoin = LineJoin.Miter;
             s.StrokeSideForClosedShape = StrokeSideForClosedShape.Both;
         }
                                      );//reset?
     }
     return(Temp <Stroke> .Borrow(out stroke));
 }