summaryrefslogtreecommitdiff
path: root/src/mbgl/storage
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-05-27 13:43:02 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-05-28 16:30:49 +0300
commit33ee7e23de24bd3c076eafef819029cf45451d23 (patch)
tree159d3e49dc44cda1b5133be1d663cca89efb2e79 /src/mbgl/storage
parentcc26ef17d52367a768a134140c6c95cb2b880733 (diff)
downloadqtlocation-mapboxgl-33ee7e23de24bd3c076eafef819029cf45451d23.tar.gz
[core] Remove priority from the constructor
Make the constructor less verbose and set good defaults.
Diffstat (limited to 'src/mbgl/storage')
-rw-r--r--src/mbgl/storage/resource.cpp32
1 files changed, 12 insertions, 20 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),