I’m seeing a performance issue when I build and run the Vice C64 emulator with a Gtk3 UI on macOS. It might be relevant that I am using Gtk3 as supplied by homebrew (brew install gtk+3).
The core issue is that gtk_gl_area_draw is calling gdk_cairo_draw_from_gl, which in turn is spending a lot of time inside glReadPixels and cairo_paint, which itself is spending a lot of time inside CGContextDrawImage.
So it appears to me that having rendered the C64 screen texture to a quad in hardware, the result is then pulled back to system memory and then re-rendered via CoreGraphics.
I see the same issue when running the following GtkGLArea example: https://www.bassi.io/articles/2015/02/17/using-opengl-with-gtk/
Is this expected behaviour for GtkGLArea on macOS?