After analysing text drawing performance two things seem to take up most
of the time. The first is font lookup, the second is QVector
initialization.
To address the first point a per paint engine instance font cache is
introduced. At the moment no mechanism exists to clear this cache and
it is unbounded.
To address the second point, we simply switch to using QVarLengthArray
instead of QVector.
In an artificial benchmark that draws text in a tight loop, the first
change raised fps from ~70 to ~100. The second change further raised this
number to ~115 fps.
Change-Id: Iafa25c3e35bc42bd7c1582b0636e721c5193b494
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>