Changeset 11832 in josm for trunk


Ignore:
Timestamp:
2017-04-03T20:31:17+02:00 (7 years ago)
Author:
bastiK
Message:

see #7427 - remove the tile.loadPlaceholderFromCache mechanism from AbstractTileSourceLayer

There are 2 systems to display replacement tiles from other zoom levels, when the current
tile is not available (yet). This commit turns off one of these systems and relies fully on
the code in AbstractTileSourceLayer.drawInViewArea / paintTileImages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r11831 r11832  
    935935    }
    936936
    937     /*
    938      * We use these for quick, hackish calculations. They are temporary only and intentionally not inserted into the tileCache.
    939      */
    940     private Tile tempCornerTile(Tile t) {
    941         int x = t.getXtile() + 1;
    942         int y = t.getYtile() + 1;
    943         int zoom = t.getZoom();
    944         Tile tile = getTile(x, y, zoom);
    945         if (tile != null)
    946             return tile;
    947         return new Tile(tileSource, x, y, zoom);
    948     }
    949 
    950937    private Tile getOrCreateTile(TilePosition tilePosition) {
    951938        return getOrCreateTile(tilePosition.getX(), tilePosition.getY(), tilePosition.getZoom());
     
    957944            tile = new Tile(tileSource, x, y, zoom);
    958945            tileCache.addTile(tile);
    959         }
    960 
    961         if (!tile.isLoaded()) {
    962             tile.loadPlaceholderFromCache(tileCache);
    963946        }
    964947        return tile;
     
    11171100        List<TilePosition> missed = Collections.synchronizedList(new ArrayList<>());
    11181101        ts.visitTiles(tile -> {
    1119             Image img = getLoadedTileImage(tile);
    1120             if (img == null) {
     1102            boolean miss = false;
     1103            Image img = null;
     1104            if (!tile.isLoaded() || tile.hasError()) {
     1105                miss = true;
     1106            } else {
     1107                img = getLoadedTileImage(tile);
     1108                if (img == null) {
     1109                    miss = true;
     1110                }
     1111            }
     1112            if (miss) {
    11211113                missed.add(new TilePosition(tile));
    11221114                return;
     
    11481140        // However, we need to return *all* tiles to the callers, so force creation here.
    11491141        for (Tile tile : ts.allTilesCreate()) {
    1150             Image img = getLoadedTileImage(tile);
    1151             if (img == null || tile.hasError()) {
    1152                 if (Main.isDebugEnabled()) {
    1153                     Main.debug("missed tile: " + tile);
    1154                 }
     1142            boolean miss = false;
     1143            Image img = null;
     1144            if (!tile.isLoaded()|| tile.hasError()) {
     1145                miss = true;
     1146            } else {
     1147                img = getLoadedTileImage(tile);
     1148                if (img == null) {
     1149                    miss = true;
     1150                }
     1151            }
     1152            if (miss) {
    11551153                missedTiles.add(tile);
    11561154                continue;
Note: See TracChangeset for help on using the changeset viewer.