mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-09 13:42:09 -05:00

Switching to server-side rendering of X fonts under Cairo turned out to make text rendering much slower, at least on my laptop. This appears to be because PuTTY was asking the X server to render text into a 1-bit-per-pixel (bpp) pixmap before having Cairo composite into the terminal surface. On modern X servers 1bpp pixmaps are slow, being largely un-accelerated. Happily, it is possible to get Cairo to use an 8bpp pixmap instead, and this is rather faster. It's a bit inconvenient, though, because first we have to confirm that that the X Rendering Extensions is present and find the correct picture format. That requires linking in libXrender, which means a bit of CMake faff. For now, I've make libXrender mandatory (for X11 builds), but it and the corresponding Cairo functions could be made optional fairly simply. This hasn't actually made text rendering as much faster as I'd like on my laptop. While creating 1bpp pixmaps is nearly free, creating 8bpp pixmaps takes significant time because they actually involve the GPU. So I think now I need to rework my persistent-pixmap patch to work on top of this one.