v2: Better version which creates per-drawable DCs instead and fixes missing offscreen drawable resize.
Fwiw this fixes GL display when DPI scaling is used, and will also work for display mode virtualization, which I also intend to implement with DPI, similarly to how Windows now implements it.
I understand that using a display DC blit isn't great but it allows us to use XRender and to perform not too badly. Ideally this would be using some composition mechanism, but this will require a lot more work and could hopefully later replace it.
It's also not clear whether a compositor is doable in every case, as for instance it will require being able to export/import surfaces as DMA buffers, which simply may not be possible with remote X sessions.