void createNativeStructures(out Span <float> p, out sPathSegment s, out sPathFigure f, out sPathData pd) { p = data.AsSpan(); s = new sPathSegment(); s.kind = segmentKind; s.pointsCount = pointsCount; s.flags = arcFlags; f = new sPathFigure(); f.startingPoint = startingPoint; f.segmentsCount = 1; f.isFilled = isFilled; f.isClosed = isClosed; pd = new sPathData(); pd.fillMode = fillMode; pd.figuresCount = 1; }
void addPoint(eSegmentKind kind, byte flags = 0) { sPathSegment segment; if (segmentsCount > 0) { int idx = pb.segments.Count - 1; segment = pb.segments[idx]; if (segment.kind == kind && segment.flags == flags) { segment.pointsCount++; pb.segments[idx] = segment; return; } } segment = new sPathSegment(); segment.kind = kind; segment.flags = flags; segment.pointsCount = 1; pb.segments.Add(segment); segmentsCount++; }