Some profiling on Mac with Qt 4.2.x tells me:

* 18% QPainter::drawTextItem
* 18% QTextEngine::shape
* 70% paintPar (includes the upper two)
* 11% updateMetrics

So 70% of the whole painting process goes into paintPar. Am I wrong that this part would go down more or less linearly in the number of paragraphs we draw? Only 36% seem to be spent in Qt though.

Those numbers come from sliding around the User Manual with the scrollbar. Probably all that needs a deeper analysis, e.g. maybe the numbers for other items go up without drawing (by caching effects...).

Instead of doing partial redraw, I would use a QPixmapCache to cache word painting. The main problem in Mac is that Qt is damned slow at font metrics calculation. And Qt needs to recalculate the font metrics for each text painting. But caching small transparent pixmaps of painted words inside QLPainter we can speedup painting tremendously. I've played a bit with this approach some months ago and it is certainly doable.

Interesting approach. One should implement a prototype and see what happens.
Stefan

Attachment: PGP.sig
Description: Signierter Teil der Nachricht

Reply via email to