Hey all! I’m working on an application which uses Gtk.jl and associated Graphics packages to render real-time simulations of spiking neural networks. The application is intended to be able to render a large number of different spike raster plots and voltage graphs at a time, each updating at somewhere between 10 and 30 FPS. I’m currently employing the Canvas widget to plot these graphics using a simple 2D grid of colored rectangles, with the average graph having a size of around 64 x 64 rectangles.
My issue right now, is that even with just 2 or 3 Canvases running at a slow 10 FPS, my Xorg process is eating up my poor fake-quad-core CPU’s resources (I’ve of course verified that I’m using GPU rendering, although it is an NVidia laptop GPU). I’ve read online that this can be fixed by rendering everything offscreen to an ImageSurface in Cairo, and then painting it all to the screen in one command. This sounds quite reasonable to me, but I have no idea how to actually do this, as all the tutorials I’ve found only show how to do this with the Cairo C interface.
Could anyone point me to an example of doing this sort of offscreen rendering, such that it can work in Gtk.jl? I’d very much appreciate it!