[core] Move Sprite parsing to thread pool

This commit is contained in:
Konstantin Käfer
2017-04-20 12:28:35 +02:00
parent 197f0ca6b4
commit 59055cf403
20 changed files with 147 additions and 77 deletions

View File

@@ -21,19 +21,9 @@ const std::string AnnotationManager::PointLayerID = "com.mapbox.annotations.poin
AnnotationManager::AnnotationManager(float pixelRatio)
: spriteAtlas({ 1024, 1024 }, pixelRatio) {
struct NullFileSource : public FileSource {
std::unique_ptr<AsyncRequest> request(const Resource&, Callback) override {
assert(false);
return nullptr;
}
};
NullFileSource nullFileSource;
// This is a special atlas, holding only images added via addIcon. But we need its isLoaded()
// method to return true.
spriteAtlas.load("", nullFileSource);
// This is a special atlas, holding only images added via addIcon, so we always treat it as
// loaded.
spriteAtlas.markAsLoaded();
}
AnnotationManager::~AnnotationManager() = default;