summaryrefslogtreecommitdiff
path: root/src/mbgl/style
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-06-07 12:45:35 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-06-13 10:18:43 -0700
commit0b687312071305c050d97e04fef1c80193f443c5 (patch)
tree64c20efaa17fefef9f902811a000fd6e425c849b /src/mbgl/style
parent92252849c1a2ddf7887d1908841fa3c90dd59766 (diff)
downloadqtlocation-mapboxgl-0b687312071305c050d97e04fef1c80193f443c5.tar.gz
[core] Per-bucket icon atlases
Diffstat (limited to 'src/mbgl/style')
-rw-r--r--src/mbgl/style/image_impl.hpp8
-rw-r--r--src/mbgl/style/style.cpp9
2 files changed, 9 insertions, 8 deletions
diff --git a/src/mbgl/style/image_impl.hpp b/src/mbgl/style/image_impl.hpp
index aa2cad8278..75dc83206c 100644
--- a/src/mbgl/style/image_impl.hpp
+++ b/src/mbgl/style/image_impl.hpp
@@ -2,6 +2,10 @@
#include <mbgl/style/image.hpp>
+#include <string>
+#include <unordered_map>
+#include <set>
+
namespace mbgl {
namespace style {
@@ -21,4 +25,8 @@ public:
};
} // namespace style
+
+using ImageMap = std::unordered_map<std::string, Immutable<style::Image::Impl>>;
+using ImageDependencies = std::set<std::string>;
+
} // namespace mbgl
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 69a6d401ed..27ca58e85d 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -232,14 +232,7 @@ bool Style::isLoaded() const {
}
void Style::addImage(std::unique_ptr<style::Image> image) {
- if (style::Image* existing = images.get(image->getID())) {
- if (existing->getImage().size != image->getImage().size) {
- Log::Warning(Event::Sprite, "Can't change sprite dimensions for '%s'", image->getID().c_str());
- return;
- }
- images.remove(image->getID());
- }
-
+ images.remove(image->getID()); // We permit using addImage to update.
images.add(std::move(image));
}