summaryrefslogtreecommitdiff
path: root/src/mbgl/text/glyph_atlas.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-04-12 17:50:17 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-04-13 10:10:56 -0700
commita2670336d4387782bb607092f3a06814bdf4eb8d (patch)
treea263f1deb32af9193cea8a6e2a4d34ffddf211c6 /src/mbgl/text/glyph_atlas.cpp
parentc8480491a66f48f034b9dfc6700c4997532c89ec (diff)
downloadqtlocation-mapboxgl-a2670336d4387782bb607092f3a06814bdf4eb8d.tar.gz
[tests] Rewrite GlyphAtlas tests to use public API
Diffstat (limited to 'src/mbgl/text/glyph_atlas.cpp')
-rw-r--r--src/mbgl/text/glyph_atlas.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/mbgl/text/glyph_atlas.cpp b/src/mbgl/text/glyph_atlas.cpp
index 2256805606..2b09bc5763 100644
--- a/src/mbgl/text/glyph_atlas.cpp
+++ b/src/mbgl/text/glyph_atlas.cpp
@@ -25,29 +25,6 @@ GlyphAtlas::GlyphAtlas(const Size size, FileSource& fileSource_)
GlyphAtlas::~GlyphAtlas() = default;
-std::map<uint32_t, SDFGlyph>& GlyphAtlas::getGlyphSet(const FontStack& fontStack) {
- return entries[fontStack].sdfs;
-}
-
-bool GlyphAtlas::hasGlyphRanges(const FontStack& fontStack, const GlyphRangeSet& ranges) const {
- for (const auto& range : ranges) {
- if (!hasGlyphRange(fontStack,range)) {
- return false;
- }
- }
- return true;
-}
-
-bool GlyphAtlas::rangeIsParsed(const std::map<GlyphRange, GlyphRequest>& ranges, const GlyphRange& range) const {
- auto it = ranges.find(range);
- return it != ranges.end() && it->second.parsed;
-}
-
-bool GlyphAtlas::hasGlyphRange(const FontStack& fontStack, const GlyphRange& range) const {
- auto it = entries.find(fontStack);
- return it != entries.end() && rangeIsParsed(it->second.ranges, range);
-}
-
void GlyphAtlas::getGlyphs(GlyphRequestor& requestor, GlyphDependencies glyphDependencies) {
auto dependencies = std::make_shared<GlyphDependencies>(std::move(glyphDependencies));
@@ -66,7 +43,8 @@ void GlyphAtlas::getGlyphs(GlyphRequestor& requestor, GlyphDependencies glyphDep
}
for (const auto& range : ranges) {
- if (!rangeIsParsed(entry.ranges, range)) {
+ auto it = entry.ranges.find(range);
+ if (it == entry.ranges.end() || !it->second.parsed) {
GlyphRequest& request = requestRange(entry, fontStack, range);
request.requestors[&requestor] = dependencies;
}