John Levon wrote:
On Mon, Oct 09, 2006 at 06:55:35PM +0200, Abdelrazak Younes wrote:
As the title says. I've been testing this patch for some days and I
didn't see any side effect. The contrary would be surprising as the
changes are pretty simple.
Is font metrics any faster these days? There's an extra metrics call in
your patch,
Are you sure?
Index: rowpainter.C
===================================================================
--- rowpainter.C (revision 15292)
+++ rowpainter.C (working copy)
@@ -316,12 +316,11 @@
// Draw text and set the new x position
//lyxerr << "paint row: yo_ " << yo_ << "\n";
- pain_.text(int(x_), yo_, &str[0], str.size(), font);
- x_ += theApp->fontLoader().metrics(font).width(&str[0], str.size());
+ int width = pain_.text(int(x_), yo_, &str[0], str.size(), font);
+ x_ += width;
and it used to be dog slow to get metrics.
Well on Linux the font metrics is very cheap nowadays apparently. It's a
bit slower on Windows and it is a lot slower on Mac. My patch doesn't
impact Windows scrolling performance. I am secretly hoping that by
calling the metrics attached to the current QPainter, width calculation
will be fast because Qt would cache the info (Qt itself surely need the
info for drawing). If it turns out to be slower on Mac I can still use
our font width cache and that is relatively quite cheap.
Abdel.