fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.46k stars 359 forks source link

Multi thread support #130

Open metehus opened 3 years ago

metehus commented 3 years ago

Hello!

I was wondering if there's support for multi thread rendering on this library. I've tried once using goroutines, but that never works because of problems on the rasterizer: image

I don't know if I'm doing anything wrong or is it a problem with routines. Anything solution is appreciatted

metehus commented 3 years ago

P.S.: This problem is the same i had on #125

fogleman commented 3 years ago

gg.Context is not thread safe. You can probably use multiple contexts in different threads, but not the same context.

metehus commented 3 years ago

That's a good idea! I will look deep into it, thanks!