diff options
Diffstat (limited to 'src/mbgl/text/glyph_store.hpp')
-rw-r--r-- | src/mbgl/text/glyph_store.hpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mbgl/text/glyph_store.hpp b/src/mbgl/text/glyph_store.hpp index 5b80589f4b..f89ff80864 100644 --- a/src/mbgl/text/glyph_store.hpp +++ b/src/mbgl/text/glyph_store.hpp @@ -3,11 +3,13 @@ #include <mbgl/text/glyph.hpp> #include <mbgl/text/glyph_set.hpp> +#include <mbgl/style/types.hpp> #include <mbgl/util/exclusive.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/work_queue.hpp> #include <exception> +#include <vector> #include <set> #include <string> #include <unordered_map> @@ -26,21 +28,21 @@ public: public: virtual ~Observer() = default; - virtual void onGlyphsLoaded(const std::string& /* fontStack */, const GlyphRange&) {}; - virtual void onGlyphsError(const std::string& /* fontStack */, const GlyphRange&, std::exception_ptr) {}; + virtual void onGlyphsLoaded(const FontStack&, const GlyphRange&) {}; + virtual void onGlyphsError(const FontStack&, const GlyphRange&, std::exception_ptr) {}; }; GlyphStore(FileSource&); ~GlyphStore(); - util::exclusive<GlyphSet> getGlyphSet(const std::string& fontStack); + util::exclusive<GlyphSet> getGlyphSet(const FontStack&); // Returns true if the set of GlyphRanges are available and parsed or false // if they are not. For the missing ranges, a request on the FileSource is // made and when the glyph if finally parsed, it gets added to the respective // GlyphSet and a signal is emitted to notify the observers. This method // can be called from any thread. - bool hasGlyphRanges(const std::string& fontStack, const std::set<GlyphRange>& glyphRanges); + bool hasGlyphRanges(const FontStack&, const std::set<GlyphRange>&); void setURL(const std::string &url) { glyphURL = url; @@ -53,15 +55,15 @@ public: void setObserver(Observer* observer); private: - void requestGlyphRange(const std::string& fontStackName, const GlyphRange& range); + void requestGlyphRange(const FontStack&, const GlyphRange&); FileSource& fileSource; std::string glyphURL; - std::unordered_map<std::string, std::map<GlyphRange, std::unique_ptr<GlyphPBF>>> ranges; + std::unordered_map<FontStack, std::map<GlyphRange, std::unique_ptr<GlyphPBF>>, FontStackHash> ranges; std::mutex rangesMutex; - std::unordered_map<std::string, std::unique_ptr<GlyphSet>> glyphSets; + std::unordered_map<FontStack, std::unique_ptr<GlyphSet>, FontStackHash> glyphSets; std::mutex glyphSetsMutex; util::WorkQueue workQueue; |