diff options
Diffstat (limited to 'test/text')
-rw-r--r-- | test/text/glyph_atlas.test.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/test/text/glyph_atlas.test.cpp b/test/text/glyph_atlas.test.cpp index 5aff1ee441..01e0f115c0 100644 --- a/test/text/glyph_atlas.test.cpp +++ b/test/text/glyph_atlas.test.cpp @@ -1,6 +1,5 @@ #include <mbgl/test/util.hpp> #include <mbgl/test/stub_file_source.hpp> -#include <mbgl/test/stub_style_observer.hpp> #include <mbgl/text/glyph_atlas.hpp> #include <mbgl/util/run_loop.hpp> @@ -10,6 +9,20 @@ using namespace mbgl; +class StubGlyphAtlasObserver : public GlyphAtlasObserver { +public: + void onGlyphsLoaded(const FontStack& fontStack, const GlyphRange& glyphRange) override { + if (glyphsLoaded) glyphsLoaded(fontStack, glyphRange); + } + + void onGlyphsError(const FontStack& fontStack, const GlyphRange& glyphRange, std::exception_ptr error) override { + if (glyphsError) glyphsError(fontStack, glyphRange, error); + } + + std::function<void (const FontStack&, const GlyphRange&)> glyphsLoaded; + std::function<void (const FontStack&, const GlyphRange&, std::exception_ptr)> glyphsError; +}; + class StubGlyphRequestor : public GlyphRequestor { public: void onGlyphsAvailable(GlyphPositionMap positions) override { @@ -23,7 +36,7 @@ class GlyphAtlasTest { public: util::RunLoop loop; StubFileSource fileSource; - StubStyleObserver observer; + StubGlyphAtlasObserver observer; StubGlyphRequestor requestor; GlyphAtlas glyphAtlas{ { 32, 32 }, fileSource }; |