diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-05-27 13:43:02 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-05-28 16:30:49 +0300 |
commit | 33ee7e23de24bd3c076eafef819029cf45451d23 (patch) | |
tree | 159d3e49dc44cda1b5133be1d663cca89efb2e79 /src | |
parent | cc26ef17d52367a768a134140c6c95cb2b880733 (diff) | |
download | qtlocation-mapboxgl-33ee7e23de24bd3c076eafef819029cf45451d23.tar.gz |
[core] Remove priority from the constructor
Make the constructor less verbose and set good defaults.
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/storage/resource.cpp | 32 | ||||
-rw-r--r-- | src/mbgl/tile/tile_loader_impl.hpp | 1 |
2 files changed, 12 insertions, 21 deletions
diff --git a/src/mbgl/storage/resource.cpp b/src/mbgl/storage/resource.cpp index 9ccedb6919..613a09452b 100644 --- a/src/mbgl/storage/resource.cpp +++ b/src/mbgl/storage/resource.cpp @@ -39,49 +39,44 @@ static std::string getTileBBox(int32_t x, int32_t y, int8_t z) { util::toString(max.x) + "," + util::toString(max.y)); } -Resource Resource::style(const std::string& url, const Priority priority) { +Resource Resource::style(const std::string& url) { return Resource { Resource::Kind::Style, - url, - priority + url }; } -Resource Resource::source(const std::string& url, const Priority priority) { +Resource Resource::source(const std::string& url) { return Resource { Resource::Kind::Source, - url, - priority + url }; } -Resource Resource::image(const std::string& url, const Priority priority) { +Resource Resource::image(const std::string& url) { return Resource { Resource::Kind::Image, - url, - priority + url }; } -Resource Resource::spriteImage(const std::string& base, float pixelRatio, const Priority priority) { +Resource Resource::spriteImage(const std::string& base, float pixelRatio) { util::URL url(base); return Resource{ Resource::Kind::SpriteImage, base.substr(0, url.path.first + url.path.second) + (pixelRatio > 1 ? "@2x" : "") + ".png" + - base.substr(url.query.first, url.query.second), - priority }; + base.substr(url.query.first, url.query.second)}; } -Resource Resource::spriteJSON(const std::string& base, float pixelRatio, const Priority priority) { +Resource Resource::spriteJSON(const std::string& base, float pixelRatio) { util::URL url(base); return Resource{ Resource::Kind::SpriteJSON, base.substr(0, url.path.first + url.path.second) + (pixelRatio > 1 ? "@2x" : "") + ".json" + - base.substr(url.query.first, url.query.second), - priority }; + base.substr(url.query.first, url.query.second)}; } -Resource Resource::glyphs(const std::string& urlTemplate, const FontStack& fontStack, const std::pair<uint16_t, uint16_t>& glyphRange, const Priority priority) { +Resource Resource::glyphs(const std::string& urlTemplate, const FontStack& fontStack, const std::pair<uint16_t, uint16_t>& glyphRange) { return Resource { Resource::Kind::Glyphs, util::replaceTokens(urlTemplate, [&](const std::string& token) -> optional<std::string> { @@ -92,8 +87,7 @@ Resource Resource::glyphs(const std::string& urlTemplate, const FontStack& fontS } else { return {}; } - }), - priority + }) }; } @@ -103,7 +97,6 @@ Resource Resource::tile(const std::string& urlTemplate, int32_t y, int8_t z, Tileset::Scheme scheme, - const Priority priority, LoadingMethod loadingMethod) { bool supportsRatio = urlTemplate.find("{ratio}") != std::string::npos; if (scheme == Tileset::Scheme::TMS) { @@ -133,7 +126,6 @@ Resource Resource::tile(const std::string& urlTemplate, return {}; } }), - priority, Resource::TileData { urlTemplate, uint8_t(supportsRatio && pixelRatio > 1.0 ? 2 : 1), diff --git a/src/mbgl/tile/tile_loader_impl.hpp b/src/mbgl/tile/tile_loader_impl.hpp index bbe579ed00..7c02021083 100644 --- a/src/mbgl/tile/tile_loader_impl.hpp +++ b/src/mbgl/tile/tile_loader_impl.hpp @@ -23,7 +23,6 @@ TileLoader<T>::TileLoader(T& tile_, id.canonical.y, id.canonical.z, tileset.scheme, - Resource::Priority::Regular, Resource::LoadingMethod::CacheOnly)), fileSource(parameters.fileSource) { assert(!request); |