On Wed, Nov 01, 2006 at 11:03:18AM +0100, Abdelrazak Younes wrote: > Martin Vermeer wrote: > >On Wed, 2006-11-01 at 08:26 +0100, Asger Ottar Alstrup wrote: > >>Abdelrazak Younes wrote: > >>>No, I was interested in the details of QLPainter::text(), especially the > >>>QPainter::drawText(). This info was not there. It is in your newer > >>>screenshot. > >>This profile matches what I found on Windows. > >> > >>>If we manage to speed-up Qt drawing operation, we will win. I can't > >>>imagine that there is nothing we can't do. There must be some Qt > >>>settings. > >>As I said before, I believe the best is to draw less. There is > >>absolutely no need for redrawing the entire screen on every key press. > > > >Yes, I notice this too. I did the work in rowpainter to draw only one > >row when needed (no paragraph break) or one paragraph when needed (when > >the paragraph's height didn't change). Now, all that has been messed up. > > > >Just run LyX with -dbg PAINTING and you'll see what I mean. It prints a > >"#" for every row re-painted, and a "." for every paragraph re-painted. > > > >It paints WAY too much now. I believe the code in rowpainter is still > >good... somehow updates are triggered unnecessarily elsewhere. > > The problem lies in the new Paint strategy. Andre eliminated the backing > pixmap. This means that all expose() calls are simply ignored.
No, this is not the explanation. See my other mail. > The nice thing about it is that we draw directly on screen thus > eliminating the transfer of the old backing pixmap onto the screen. > On the other hand, the screen estate is not saved. This means that, if > part of the WorkArea is masked, the widget will receive a paint Event > and everything will be redrawn, not only the part that is not masked. > > I have some idea how to solve that problem. I don't think it's on the critical path. > >>I just added a debug statement to QLPainter.C: > >> > >> if (isDrawingEnabled()) { > >> lyxerr << "draw " << std::string(str.toUtf8()) << " > >> at " << x << "," << y << std::endl; > >> drawText(x, y, str); > >> } > >> > >>You should try this. On every cursor blink, we redraw the entire screen. > > > >I can confirm this. Not sure it's the entire screen though... sometimes > >it appears to be even more :-( > > What do you mean by more? Could you elaborate? It paints also up to one paragraph above and one below the screen. (No essential difference) > I will fix the cursor. OK good > > > >>This might be a result of André's reorganisation of how we paint, or it > >>may be an old bug. In any case, it is very wasteful. > >> > >>If I disable cursor blinking by adding a return in WorkArea::showCursor, > >>the result is that we redraw exactly once per key press. > > > >Confirmed, sort of (there may be several redraws per keypress) > > Yes, the number of lyx-redraws depend now on the number of Qt > paintEvent(). paintEvent() can be triggered by other thing than > WorkArea::redraw(). > > Abdel. - Martin
pgpOGbZiRB6kD.pgp
Description: PGP signature