Primitives

I am doing a major overhaul of the graphic system to increase flexibility and performance. So far the primitives are being worked on and the image below shows the number of microseconds it takes to draw the supported primitives.

As seen, draw a filled circle and text is the slowest primitives. That text is slow is no surprise since I draw the letters pixel by pixel but that the filled circle was so slow is a bit surprising. The algorithm used is the same as the non-filled circle but I’m using DMA2D to draw the lines that makes up the circle. Each call crates a lot of overhead which is probably why the filled circles is so slow. I will take a look and check if I can remove some of the overhead. It should be almost as fast as the none-filled circle.

A filled rectangle is drawn in only 8 us but that is completly rendered through DMA2D so no big surprise when it comes to performance. DMA2D is lightning fast!

Overall, a good start. Most games will probably use bitmaps anyhow so I will not put much more work in to this right now (except fixing the filled circle). Getting bitmaps to render as fast as possible is much more critical.