On Mon, 2005-03-14 at 10:44 +0000, Axel Simon wrote:
> Not bad,
> a quick question about the Regions:
> On Sun, 2005-03-13 at 17:59 +0000, Duncan Coutts wrote:
> > I've got a somewhat low-level repaint handler. It's rather clever about
> > minimising what has to redrawn. I changed the expose event to give me
> > the exposed GtkRegion rather than just the bounding rectangle (I guess
> > it was not previously given to the user for a good reason - more on that
> > in a sec). From the region you can get a set of rectangles that cover
> > the exposed area. Then I calculate for each rectangle which cells it
> > covers and mark those cells as invalidated. Then at the end I redraw all
> > the invalidated cells.
> What you said in your commit message below is that you don't want to
> marshal the Region every time the expose event is triggered because most
> people would use the rectangle. I agree with that but I also think there
> is an easy workaround. The Region you're passed is stored in the
> gdk_window (or DrawWindow) that you're drawing to. Could you try to use
> drawWindowGetUpdateArea from within the event handler? (It might always
> be empty at that point...)
In my quick experiment that does indeed seem to be the case.
drawWindowGetUpdateArea always returns Nothing (at least from inside the
> > Another thing I did was to turn off double buffering for the canvas
> > widget. This improves re-draw speed a bit and since I'm only re-drawing
> > the exact bit that was exposed it does not introduce significant
> > flicker.
> Interesting that double buffering makes it so much slower.
I wouldn't say it makes it much slower but it was noticeable, especially
on my old slow machine.
What was rather pleasing is that the visualiser works nicely over remote
X connections. Most of the traffic is one-way so the round-trip latency
doesn't matter too much.