diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-22 13:28:09 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-26 11:21:56 -0700 |
commit | aa216d00254c18f7b5903026ab1a489ae7797dd8 (patch) | |
tree | 7decb42cb0f8a8a5ae0e9d3bdcfdf69e76949e15 /src/mbgl/sprite/sprite_image_collection.cpp | |
parent | 6cf9d5cfbfe8120121d8d53cbbf8915cea8f4879 (diff) | |
download | qtlocation-mapboxgl-aa216d00254c18f7b5903026ab1a489ae7797dd8.tar.gz |
[core] Don't use a separate SpriteAtlas for annotation images
Instead, just add them to the Style as needed. Includes changes from #8905 and takes care to avoid regressing #3817.
Diffstat (limited to 'src/mbgl/sprite/sprite_image_collection.cpp')
-rw-r--r-- | src/mbgl/sprite/sprite_image_collection.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/mbgl/sprite/sprite_image_collection.cpp b/src/mbgl/sprite/sprite_image_collection.cpp deleted file mode 100644 index ae00a6b146..0000000000 --- a/src/mbgl/sprite/sprite_image_collection.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include <mbgl/sprite/sprite_image_collection.hpp> -#include <mbgl/util/logging.hpp> - -namespace mbgl { - -void addSpriteImage(Images& images, - std::unique_ptr<style::Image> image_, - std::function<void (style::Image&)> onAdded) { - std::string id = image_->getID(); - auto it = images.find(id); - if (it == images.end()) { - // Add new - it = images.emplace(id, std::move(image_)).first; - onAdded(*it->second.get()); - return; - } - - std::unique_ptr<style::Image>& image = it->second; - - // There is already a sprite with that name in our store. - if (image->getImage().size != image_->getImage().size) { - Log::Warning(Event::Sprite, "Can't change sprite dimensions for '%s'", id.c_str()); - } - - // Update existing - image = std::move(image_); - onAdded(*it->second.get()); -} - -void removeSpriteImage(Images& images, - const std::string& id, - std::function<void ()> onRemoved) { - if (images.erase(id) > 0) { - onRemoved(); - } -} - - - -} // namespace mbgl |