summaryrefslogtreecommitdiff
path: root/src/mbgl/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/text')
-rw-r--r--src/mbgl/text/glyph.hpp4
-rw-r--r--src/mbgl/text/glyph_manager.cpp2
-rw-r--r--src/mbgl/text/glyph_range.hpp21
3 files changed, 15 insertions, 12 deletions
diff --git a/src/mbgl/text/glyph.hpp b/src/mbgl/text/glyph.hpp
index 55cd50fd9b..034784dc24 100644
--- a/src/mbgl/text/glyph.hpp
+++ b/src/mbgl/text/glyph.hpp
@@ -115,7 +115,7 @@ MBGL_CONSTEXPR WritingModeType operator~(WritingModeType value) {
return WritingModeType(~mbgl::underlying_type(value));
}
-using GlyphDependencies = std::map<FontStack,GlyphIDs>;
-using GlyphRangeDependencies = std::map<FontStack,GlyphRangeSet>;
+using GlyphDependencies = std::map<FontStack, GlyphIDs>;
+using GlyphRangeDependencies = std::map<FontStack, std::unordered_set<GlyphRange>>;
} // end namespace mbgl
diff --git a/src/mbgl/text/glyph_manager.cpp b/src/mbgl/text/glyph_manager.cpp
index c4a7a2de66..b947ef72c8 100644
--- a/src/mbgl/text/glyph_manager.cpp
+++ b/src/mbgl/text/glyph_manager.cpp
@@ -31,7 +31,7 @@ void GlyphManager::getGlyphs(GlyphRequestor& requestor, GlyphDependencies glyphD
Entry& entry = entries[fontStack];
const GlyphIDs& glyphIDs = dependency.second;
- GlyphRangeSet ranges;
+ std::unordered_set<GlyphRange> ranges;
for (const auto& glyphID : glyphIDs) {
if (localGlyphRasterizer->canRasterizeGlyph(fontStack, glyphID)) {
if (entry.glyphs.find(glyphID) == entry.glyphs.end()) {
diff --git a/src/mbgl/text/glyph_range.hpp b/src/mbgl/text/glyph_range.hpp
index 74afb73dfc..35a1f74b94 100644
--- a/src/mbgl/text/glyph_range.hpp
+++ b/src/mbgl/text/glyph_range.hpp
@@ -3,21 +3,24 @@
#include <utility>
#include <cstdint>
#include <unordered_set>
-#include <boost/functional/hash.hpp>
+#include <mbgl/util/hash.hpp>
namespace mbgl {
using GlyphRange = std::pair<uint16_t, uint16_t>;
-struct GlyphRangeHash {
- std::size_t operator()(const GlyphRange& glyphRange) const {
- return boost::hash_value(glyphRange);
- }
-};
-
-using GlyphRangeSet = std::unordered_set<GlyphRange, GlyphRangeHash>;
-
constexpr uint32_t GLYPHS_PER_GLYPH_RANGE = 256;
constexpr uint32_t GLYPH_RANGES_PER_FONT_STACK = 256;
} // end namespace mbgl
+
+namespace std {
+
+template <>
+struct hash<mbgl::GlyphRange> {
+ std::size_t operator()(const mbgl::GlyphRange& range) const {
+ return mbgl::util::hash(range.first, range.second);
+ }
+};
+
+} // namespace std