[josm-dev] Painting
Jiri Klement
jiri.klement at gmail.com
Wed Mar 10 08:21:48 GMT 2010
> This is exactly what RepaintManager in Java does for you.
> User events (mouse gestures, ...) and posted tasks are processed
> and the repaint requests they caused are buffered and a repaint request
> is posted at the end of the event queue. Once the queue drains, the repaint
> happens, only once.
Alright, I didn't know RepaintManager will actually consolidate
repaint events so having paint code in another thread will not make it
any faster. On the other hand separated paint thread will allow to
immediately show zoomed/panned old version of offscreen buffer while
new version of offscreen buffer is being constructed in the
background. That will make zooming/pannig more smooth.
> As for the initial comment regarding full repaint just to do rubber-band:
> There's no problem with full repaint as long as you do it fast enough. And
> this is doable. Proved.
Caching of offscreen buffer for OsmDataLayer should require only
little efford. I think only piece missing is notification about
changed highlighted state. For data changes and selection changes are
already available events.
> For the record, I've tried current JOSM and must say that the rendering
> speed improved a lot.
> What might help, IMO, is to disable painting plain points over given zoom
> level.
> JOSM already paints large datasets when zoomed in and slight simplification,
> when zoomed out
> can only improve the situation. (You don't need to see individual nodes when
> looking at half the
> Germany, do you?)
Actually drawing of nodes is pretty fast. Most of the time is spend by
drawing ways (75% ways, 15% nodes in case of Iceland). Simplifying
ways so that only long enough segments are painted should help.
(nodes that were part only of the skipped segments will not be painted
as well)
--
Jiri
>
> Regards,
> Nenik
>
>
More information about the josm-dev
mailing list