pioneerspacesim/pioneer — pull request #1791 by robn (2012-12-08 03:00:29+00:00)
Title: Text rendering optimisations

Various optimisations to text rendering, based on profiling a simple test app (included)

* Don't look up glyphs more than we have to
* Store the low 256 glyphs in a vector for even faster lookup
* Cache Freetype char indexes for kerning. `FT_Get_Char_Index` is surprisingly (I read the FreeType code, it has to call down into the backend font driver, so there's a few levels of indirection there).
* Don't generate more vectors than we have to (should optimise better too)

Profiling now shows that most of the work is in `Graphics::VertexArray::Add`, so I've probably squeezed as much out of this I can without structural changes.