Martin Vermeer a écrit :
On Fri, May 19, 2006 at 11:50:50PM +0200, Abdelrazak Younes wrote:
| | | | + 510.6 ms LyXText::rowBreakPoint(int, Row&) const (lyx)
| | | | | + 457.7 ms font_metrics::width(char, LyXFont const&) (lyx)
| | | | + 2417.1 ms ::RowPainter::paintFromPos(int&) (lyx)
| | | | | + 2394.6 ms ::RowPainter::paintChars(int&, LyXFont, bool,
| | | | | | + 524.7 ms font_metrics::width(char const*, unsigned long,
| | | | | | + 1825.8 ms QLPainter::text(int, int, std::basic_string<
| | | | | | | + 1824.8 ms QLPainter::text(int, int, char const*,
| | | | | | | | - 1710.0 ms QPainter::drawText(int, int, QString const&,
OK, this means that this "drawImage" should definitely not be in the
update routine. I'll see to it but the slowest part of
"LyXScreen::redraw" is not in there but in "paintText()" or more exactly
in "font_metrics::width" and in QPainter::drawText. I am afraid there is
not much I can do about that, it is Qt4 API. I'll google a bit to see if
there's some solution to that drawText slowness.
It seems that font_metrics::width is called two times within
LyXText::redoParagraph, once in LyXText::rowBreakPoint and another in
::RowPainter::paintChars; I think this could be optimized out, Martin?
I'm not convinced. How? And isn't this (font metrics) being cached in Qt?
In "qfont_metrics.C: width(char const * s, size_t ls, LyXFont const &
f)" I see three lines that could potentially takes some time:
Encoding const * encoding = fontencoding(f);
QLFontInfo & fi = fontloader.fontinfo(f);
if (ls == 1)
return fi.width(encoding->ucs(s[0]));
Which one do you think it is?