render: only do a full background fill on fresh buffers
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Before this patch, each and every frame would do the following: * Fill the entire buffer with the background buffer, including the rounded corners. * Render the contents (match list, prompt etc) We note the following: * Rounded corners is expensive to render on the CPU * The contents will actually replace much of the buffer Since we track buffer age, we can do a fairly simple optimization: * Skip the full background fill (and the rounded corners) if we're re-using the last frame's buffer (buffer age is 0). * Have each component (match entries, prompt etc) render its own background. This improves performance in two ways: * We only do the expensive rounded corners once * The background fill is now threaded (since the match list is rendered by multiple threads). Also fix an issue where a large border.radius value combined with small margins caused rendering glitches, where the corners were "overwritten" by e.g. the selected item box. The fix is to reduce the amount of roundness as the margins grow smaller.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+54 added−25 removed
- other:+54 added−25 removed