summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeofiletilecache_p.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2016-10-19 17:14:22 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2016-11-22 09:29:39 +0000
commit3a6fb42cb2bb72f51f9fc05c5f6651a659cb9c8b (patch)
tree386cbc97816da5cee9c6ddd5b8b1330359a811cd /src/location/maps/qgeofiletilecache_p.h
parent95f8804ecaed79792a57b1fe3580266bfbbf7590 (diff)
downloadqtlocation-3a6fb42cb2bb72f51f9fc05c5f6651a659cb9c8b.tar.gz
Add support for unitary tile cost in QGeoFileTileCache
This patch adds support for unitary pricing of tiles in the disk, memory and texture caches. This is done through a new enum in QAbstractGeoTileCache, "CostStrategy" having two values, Unitary (new one) and ByteSize (the old way). Using Unitary instead of ByteSize gives, as advantages: - the ability to comply with the TOS of certain providers, who allow to cache a fixed number of tiles, and not of bytes. - even performance with different types of tiles, like lo vs hi res, indexed vs satellite (which usually compresses much less). This patch sets the Unitary mode to be the default for the mapbox plugin since Mapbox is one of the providers whose TOS limit the amount of cacheable tiles. Therefore, the patch also modifies the mapbox plugin ".mapping.cache" parameters to reflect the new behavior. Since these parameters have been introduced with 5.8 (which is unreleased), the change doesn't need to be backward compatible. Change-Id: I76edd43900242885f24eb9f28e8c833538647edc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/maps/qgeofiletilecache_p.h')
-rw-r--r--src/location/maps/qgeofiletilecache_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/location/maps/qgeofiletilecache_p.h b/src/location/maps/qgeofiletilecache_p.h
index e850a13b..96fcf1ee 100644
--- a/src/location/maps/qgeofiletilecache_p.h
+++ b/src/location/maps/qgeofiletilecache_p.h
@@ -118,6 +118,9 @@ public:
int textureUsage() const Q_DECL_OVERRIDE;
void clearAll() Q_DECL_OVERRIDE;
void clearMapId(const int mapId);
+ void setCostStrategy(CostStrategy costStrategy) Q_DECL_OVERRIDE;
+ CostStrategy costStrategy() Q_DECL_OVERRIDE;
+
QSharedPointer<QGeoTileTexture> get(const QGeoTileSpec &spec) Q_DECL_OVERRIDE;
@@ -154,6 +157,7 @@ protected:
int minTextureUsage_;
int extraTextureUsage_;
+ CostStrategy costStrategy_;
};
QT_END_NAMESPACE