diff options
author | Keith Packard <keithp@keithp.com> | 2014-06-13 21:26:33 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-06-13 21:26:33 -0700 |
commit | 9a6a3c34293eac6442f766e13ce148f595e891eb (patch) | |
tree | 7a9b05e48f8aabc43260b377c6b7b3559cd75fbd /altosuilib/AltosUIMapTile.java | |
parent | 92895c87bc3d97bf4990f1feda0bd8b07da4c405 (diff) |
altosuilib: Make map-cache per-window instead of global
This consumes more memory, but avoids cache conflicts between windows
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUIMapTile.java')
-rw-r--r-- | altosuilib/AltosUIMapTile.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/altosuilib/AltosUIMapTile.java b/altosuilib/AltosUIMapTile.java index 6fbcdb4b..7c823183 100644 --- a/altosuilib/AltosUIMapTile.java +++ b/altosuilib/AltosUIMapTile.java @@ -34,6 +34,7 @@ public class AltosUIMapTile { int zoom; int maptype; AltosUIMapStore store; + AltosUIMapCache cache; int status; private File map_file() { @@ -153,7 +154,7 @@ public class AltosUIMapTile { ++painting_serial; if (image == null && t.has_location()) - image = AltosUIMapCache.get(this, store, px_size, px_size); + image = cache.get(this, store, px_size, px_size); paint_graphics(g2d, t, painting_serial); } @@ -173,6 +174,7 @@ public class AltosUIMapTile { public AltosUIMapTile(AltosUIMapTileListener listener, AltosUILatLon upper_left, AltosUILatLon center, int zoom, int maptype, int px_size, Font font) { this.listener = listener; this.upper_left = upper_left; + cache = listener.cache(); while (center.lon < -180.0) center.lon += 360.0; |