On Friday 06 December 2002 9:17 am, Jean-Marc Lasgouttes wrote:
> >>>>> "John" == John Levon <[EMAIL PROTECTED]> writes:
>
> John> I have abjectly failed. Everything I tried increased resize
> John> time.
>
> John> xforms is averaging 1.5 seconds for first-time-resize. Qt is
> John> averaging 5.5. I can not bring this down.
>
> John> 4.5 seconds of this is time as a result of
> John> qfont_metrics::width() (checked using an empty ::width()
> John> function).
>
> John> Basically, our hands our tied by text.C's massive overuse of the
> John> metrics.
>
> John> This will have to stay, basically. Sorry.

And a totally different idea. This is for xforms, but the idea should also 
work for Qt. Here's the redraw function:

void XWorkArea::redraw(int width, int height)
{
        static int cur_width = -1;
        static int cur_height = -1;

        if (cur_width == width && cur_height == height && pixmap_) {
                XCopyArea(fl_get_display(),
                          getPixmap(), getWin(), copy_gc_,
                          0, 0, width, height, xpos(), ypos());
                return;
        }

        cur_width = width;
        cur_height = height;

        if (lyxerr.debugging(Debug::WORKAREA)) {
                lyxerr << "(Re)creating pixmap ("
                       << width << 'x' << height << ')' << endl;
        }

        if (pixmap_) {
                XFreePixmap(fl_get_display(), pixmap_);
        }

        pixmap_ = XCreatePixmap(fl_get_display(),
                                RootWindow(fl_get_display(), 0),
                                width,
                                height,
                                fl_get_visual_depth());

        workAreaResize();
}

Everything here is cheap except for the last call, to the LyX core. So why 
not shove it on a timer and discard FL_DRAW events that occur within 0.2 secs 
in the same way as we already fo for FL_DRAG events. Some thought may be 
needed, because we want to use the last event, but it can probably be made to 
work.

Angus

Reply via email to