I've been working on a mobile app that uses a full-screen OpenGL view. And within that view, we do most of our UI using JUCE components. Unfortunately, we've found that JUCE doesn't paint these components very efficiently at all. For example, the time it takes to draw a rectangle seems orders of magnitude higher than it should be. Digging in to investigate...
When drawing a simple colored rectangle on the screen, you would expect the rendering to come down to sending two triangles to the GPU. Instead... RectangleListRegion::fillRectWithColour converts this rectangle to a SubRectangleIterator, which is passed to SavedState::fillWithSolidColour, which is eventually added to an EdgeTableRenderer via SubRectangleIterator::iterate. And when it's added to the EdgeTableRenderer, it's added one line at a time. And each line is rendered as a pair of triangles.
So the number of triangles actually drawn depends on the height of the rectangle. If you try to draw a rectangle with a height of 480, you end up rendering 960 triangles instead of 2. And with higher resolutions, drawing times increase proportionally.
The performance also gets much, much worse if you try to draw shapes that aren't so rectangular. As an example, text rendering. With text rendering, each pixel is individually rendered as a pair of triangles.
Because of the poor performance of simply rendering rectangles, rendering components to images isn't even that helpful. It still takes much longer to render the buffered components than it should.
Are there any plans to improve on this?