have looked at the cairo github
Well you are free to try cairo from gintro package, or maybe cairo from oldgtk3. The later is low level created with c2nim, the former is more high level, but may contain still some bugs. I used it for nim-chess4 and provided an real-time drawing example, but there is no other documentation yet. Note that cairo is slow compared to OpenGL/SDL and other libs with better GPU support.
Additional, there seems to exist an "unauthorized" version of the low level one from oldgtk3 with more basic examples at
https://github.com/treeform/cairo
Final note: Your question is not too smart, as you do not tell us if you want some drawing inside of a GUI, or if you intend only drawing to files in SVG, PDF, PNG...
I made the https://github.com/treeform/cairo after no other Cairo libs worked for me on windows.
Note that cairo is slow compared to OpenGL/SDL and other libs with better GPU support.
Cairo has GPU backend see: https://cairographics.org/backends/
But I do agree cairo is slow, because it uses a different paradigm of filling shapes. While openGL rasterization of SDL blitting is faster then shape fills.
after no other Cairo libs worked for me
Sorry I missed your detailed bug report concerning gintro cairo issues. When I have some spare time I may compare your hijacked copy with my original, maybe I can merge your patches back.
Cairo has GPU backend see
Of course we all know that well, but common sense is that experimental OpenGL cairo backend is generally slower than using CPU for cairo. I think OpenGL documentation is even hidden from official online docs.
But indeed recent cairo is not that slow any more, I recently did a test with Wayland on Linux, and it was better on my box than some years before.
From time to time I am watching experimental cairo alternatives
https://github.com/intel/fastuidraw
https://github.com/jpbruyere/vkvg
but I am not sure if creating Nim bindings already would make sense.