Opened 8 years ago
Closed 8 years ago
#13222 closed enhancement (fixed)
[Patch] Use visitor pattern for painting tiles
Reported by: | michael2402 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 16.08 |
Component: | Core imagery | Version: | |
Keywords: | gsoc-core | Cc: | Don-vip, bastiK, stoecker |
Description
Migrate towards a visitor pattern.
Only the default zoom level is painted this way, the missed tiles are still painted using the old function.
Using streams and by adding a simple parallelStream()
I was able to execute the image processors in parallel. This speeds up drawing a lot.
Attachments (2)
Change History (11)
comment:1 by , 8 years ago
Milestone: | → 16.07 |
---|
by , 8 years ago
Attachment: | patch-mapview-imagery-tile-source-paint-iteration.patch added |
---|
comment:2 by , 8 years ago
comment:3 by , 8 years ago
I know. I also added some sonar warnings ;-)
I am currently attempting to separate the TileSet (coordinate conversion, range, ...) stuff and separate it from the tile loading so that that class can be refactored to a static class and then extracted. I want to move the painter to a new class as well. After that, AbstractTileSourceLayer
won't contain any paint code and thus be small again ;-).
comment:4 by , 8 years ago
I like this change. I'm thinking about taking this a bit further, and create a structure that would map:
screen area -> tile(x,y,z), tile area to paint
This would allow us to parallelize whole paintTiles/missedTiles algorithm and then - just paint all the tiles in computed places.
comment:5 by , 8 years ago
Yes, this is the next step I am planing.
I don't like the current structure of the missed tiles algorithm. It makes parallelization and extension (like limiting the number of tiles to paint) difficult.
I am currently planing to do a new collection algorithm that computes all tiles that need painting and then remove the old paint class. I am currently making the screen area more universal and respect the bounds of the projection - this will finally fix the problem that JOSM paints the wrong side of the world close to 180° ;-)
comment:6 by , 8 years ago
Milestone: | 16.07 → 16.08 |
---|
by , 8 years ago
Attachment: | patch-fix-13222.patch added |
---|
comment:8 by , 8 years ago
I updated this one to the current version, too.
Can you give priority to this one, since I want to work on the tile source more. You don't need to fix Somar warnings (e.g. p -> getTile(p)
). After this patch I will work on a patch that moves lots of code around and will then allow to use the same layer for multiple MapViews.
AbstractTileSourceLayer
grows bigger than 2000 lines, it causes a checkstyle violation, is there a way to refactor it?