summaryrefslogtreecommitdiff
path: root/src/mbgl/text/glyph_manager.hpp
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-12-15 09:08:20 -0800
committerChris Loer <chris.loer@mapbox.com>2017-12-18 12:17:22 -0800
commita53818a10b821218b86478e048a3884db93f7c00 (patch)
tree9de0e83b67c163a4c8ed6f02736b2ad2ca2e8d15 /src/mbgl/text/glyph_manager.hpp
parent2e3e88f0276bb6b6ade009549d8927f4af96bdd9 (diff)
downloadqtlocation-mapboxgl-a53818a10b821218b86478e048a3884db93f7c00.tar.gz
[core] Enable local glyph generation using TinySDF.
- Platform-specific LocalGlyphRasterizer is responsible for deciding which glyphs to rasterize locally and for implementing the rasterization. - Default platform implementation doesn't locally generate any glyphs -> no behavior change - Unit test uses StubLocalGlyphRasterizer, which returns a single fixed bitmap for all CJK glyphs - Rename glyph_loader.test to glyph_manager.test
Diffstat (limited to 'src/mbgl/text/glyph_manager.hpp')
-rw-r--r--src/mbgl/text/glyph_manager.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mbgl/text/glyph_manager.hpp b/src/mbgl/text/glyph_manager.hpp
index 00df079462..13a8c07429 100644
--- a/src/mbgl/text/glyph_manager.hpp
+++ b/src/mbgl/text/glyph_manager.hpp
@@ -3,6 +3,7 @@
#include <mbgl/text/glyph.hpp>
#include <mbgl/text/glyph_manager_observer.hpp>
#include <mbgl/text/glyph_range.hpp>
+#include <mbgl/text/local_glyph_rasterizer.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/font_stack.hpp>
#include <mbgl/util/immutable.hpp>
@@ -24,7 +25,7 @@ public:
class GlyphManager : public util::noncopyable {
public:
- GlyphManager(FileSource&);
+ GlyphManager(FileSource&, std::unique_ptr<LocalGlyphRasterizer> = std::make_unique<LocalGlyphRasterizer>());
~GlyphManager();
// Workers send a `getGlyphs` message to the main thread once they have determined
@@ -42,6 +43,8 @@ public:
void setObserver(GlyphManagerObserver*);
private:
+ Glyph generateLocalSDF(const FontStack& fontStack, GlyphID glyphID);
+
FileSource& fileSource;
std::string glyphURL;
@@ -61,8 +64,10 @@ private:
GlyphRequest& requestRange(Entry&, const FontStack&, const GlyphRange&);
void processResponse(const Response&, const FontStack&, const GlyphRange&);
void notify(GlyphRequestor&, const GlyphDependencies&);
-
+
GlyphManagerObserver* observer = nullptr;
+
+ std::unique_ptr<LocalGlyphRasterizer> localGlyphRasterizer;
};
} // namespace mbgl