Interface Rendering Optimization?
-
I'm playing around with geometry and have noticed simple drawLine calls butchering my UI thread.
1ms for this drawLine call. It draws a line across the entire interface, so over 800px. It uses a gradient, so there's that; if I switch to solid colors using setColour, the performance improves dramatically.
I'm using gradients in other places, and they seem to be the culprit that butchers the performance. Can anything be done about this or should this just go straight into OpenGL?
Also, what's up with the redraw of the entire panel whenever I move a knob that's above it?
If the knob is moving, the entire paint routine of the panel is getting redrawn periodically. It's not the paint routine being executed, because things would be changing (I have some randomization in place), just a redraw. How is this efficient? Isn't it more efficient to store a screenshot and then paint that instead of redoing all the calculations?
Is it simply a draw call issue because I have 150 rectangles, and it's the drawing that takes time, not the calculations? Still, wouldn't it be easier to show a screenshot if the paint routine calculations haven't changed?
-
@aaronventure Partial question—are you using alpha channels (and if so, have you tried with and without the Opaque flag set for every panel)?
-
@clevername27 i tried it with the stock sliders without any LAF. they don't have the opaque flag. If there was an entire opaque panel covering it, I'm pretty sure it wouldn't be redrawing.