On Thursday 20 June 2002 6:13 pm, John Levon wrote:
> On Thu, Jun 20, 2002 at 05:51:56PM +0100, Angus Leeming wrote:
> > because of the loop in objects.c's mark_for_redraw / fl_redraw_form:
> >     for (ob = form->first; ob; ob = ob->next)
> >             ob->redraw = 1;
> > that is called by fl_handle_forms and flags all objects on the form for
> > redraw?
>
> Probably.
>
> > Doesn't the XEvent give us a bounding box. Things within the box should
> > be drawn, things outside it need not be. Couldn't that info be used to
> > flag which objects should be redrawn. Or am I dreaming here.
>
> Well I've only browsed your xforms email, but we need a sub-region not
> the entire workarea object, unless you fancy copying a massive pixmap on
> every cursor blink (didn't think so). 

That's what we do now. See the code in xscreen.C. Oh! you have ;-)

Moreover, this is what I'm trying to get a handle on. If we could define a 
"BoundingBox" then we could have the following psuedo code in objects.c:

void fl_redraw_form(FL_FORM * form)
{
        for (FL_OBJECT *ob = form->first; ob; ob = ob->next) {
                if (withinBoundingBox(ob, BoundingBox))
                ob->redraw = 1;
        }
        redraw_marked(form, 0, 0);
}

Furthermore, each object could decide whether it used this info or just 
regenerate the entire pixmap.

> xev != NULL, it's asking to draw the entire object. This is  so broken I
> don't know where to begin shouting ...

Sure. But this will be equally bad for all other toolkits too unless we can 
think of some way of telling them which area to redraw.

In other words, I don't think that you should back off just yet. 

First of all we should work out why we're still getting some FL_DRAW call to 
the work area handler that are NOT accompanied by a corresponding XEvent. I 
have an example and probable cause below.

Thereafter, this "clever" drawing is an optimization.

Here's example 1
Start LyX -> xev == 0.
presumably because LyXScreen::greyOut() doesn't call expose after it's called 
the painter.

Example 2.
Start LyX, open a buffer, close it. -> xev == 0 and
the displayed document is not replaced by a gray pixmap.
Same reasoning, since here the workarea paint method is called only if xev is 
non-zero.

Angus





Angus

Reply via email to