jules wrote:I guess that the only way to do it is to have a factory base class that can create the right type of renderer, and a static method to register your new factory as the default producer of them. Unfortunately that means they all have to be heap-allocated, which is a bit inelegant, but not too big an overhead. Bit of a faff to write it all though, I was hoping to do this with minimal impact.
Yes, this is exactly what I had in mind. There would be a virtual function on the ComponentPeer that would act as the "Factory" to return a heap allocated renderer, and the default implementation would just return what it is making now.
Further refinements would virtualize the drawing so that the factory could be to create a graphics context for each CPU core and divide the area to be redrawn into strips, and render them in parallel on multiple CPUs.