What's The Library Blender Uses to Draw? ok, I tried to use PIL library in blender to render Particle system just by drawing circles in given locations, but this is not a good Idea, it takes much longer than expected, but the worst thing about it's the strange circles that the library makes with the Draw.ellipse() function, those are more like Exagons. 

I was wondering what's the Library that Blender uses to draw like preview or to make compositing too.
Blender's drawing code is all custom C code calling opengl functions. Even the ui widget toolkit is custom. There is no python library. 

As suggested by batfinger, you can use bgl, blender's opengl wrapper for python if you need custom drawing.