func (gc *GraphicContext) paint(rasterizer *raster.Rasterizer, color color.Color) { gc.painter.SetColor(color) rasterizer.Rasterize(gc.painter) rasterizer.Clear() gc.painter.Flush() gc.Current.Path.Clear() }
func contour(r *raster.Rasterizer, ns []node) { if len(ns) == 0 { return } i := 0 r.Start(p(ns[i])) for { switch ns[i].degree { case -1: // -1 signifies end-of-contour. return case 1: i += 1 r.Add1(p(ns[i])) case 2: i += 2 r.Add2(p(ns[i-1]), p(ns[i])) default: panic("bad degree") } } }