When my ComponentPeer paints the RectangleList of invalid areas, I want to calculate the drawing throughput measured in pixels per second. The number of pixels should be equal to the sum of the areas of the rectangles in the RectangleList of the area requiring update (usually retrieved from the operating system for example GetUpdateRgn() on Windows). The time spent should be measured by subtracting the value of the performance counter before from after the call to component->paintEntireComponent() in ComponentPeer (or something similar). I would like to keep a small array of moving history of these pixel/time value pairs so I can display the throughput in a label or something.
It seems there isn’t enough API exposed in LowLevelGraphicsContext to extract the RectangleList, and certain members in ComponentPeer are non virtual, so my question is what would be the cleanest way of doing this, preferably without changing any Juce code (i.e. some subclassing) but if I do have to change Juce code what’s the minimal amount of changes?