[Xastir-dev] feasibility of extra drawing threads?

Curt Mills archer at eskimo.com
Sat Sep 25 23:44:57 EDT 2004


On Sat, 25 Sep 2004, Derrick J Brashear wrote:

> As I was moving across Ohio at highway speed, and zoomed to level 16 on a
> set of 1:24k USGS DRGs, I had a thought: a predictive drawing thread or
> threads which prepared what would be the next screen image if the
> autopanning moved you in the direction the cursor is most likely to go off
> the screen in next.
>
> I can probably do the math to figure out what we should be drawing and by
> when,

The dead-reckoning code should be a good start for that.

> I don't think I can figure out how to draw an alternate image into
> an alternate pane. how feasible is this?

We use pixmaps in memory to draw into.  You'd need to create yet
another pixmap (we use three right now, but only one for the base
maps).  You'd need to tweak the drawing code so that you could
change the pixmaps they draw into at will.  All of that is do-able.

The hard part might be in separating all of the map drawing code
into another thread so that the main thread can still
transmit/receive/decode packets.

Another possibility, which wouldn't provide as nice a result but
would be much easier to code, would be to display intermediate map
drawing results as each map finished drawing, so that you'd see the
various layers forming on the screen after it decided to move.  As
long as you were using multiple vector map layers, this might work
well.  Throw in a single raster layer and it'd be way to slow again.
You could perhaps process packets in between some of the map draws
as well, so that it didn't get behind during all the map drawing.

One of the main reasons I haven't gone after separating the map
drawing into another thread is that we're planning to break up
Xastir into multiple pieces anyway, and at that point it'll all get
rewritten as separate pieces anyway.

-- 
Curt, WE7U.				archer at eskimo dot com
http://www.eskimo.com/~archer
  Lotto:  A tax on people who are bad at math. - unknown
Windows:  Microsoft's tax on computer illiterates. - WE7U.
The world DOES revolve around me:  I picked the coordinate system!"




More information about the Xastir-dev mailing list