summaryrefslogtreecommitdiff
path: root/src/mbgl/text/glyph_pbf.hpp
blob: 7412ebe411870a7c5fb37000a12669db2ff94583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once

#include <mbgl/text/glyph.hpp>
#include <mbgl/util/font_stack.hpp>
#include <mbgl/util/noncopyable.hpp>

#include <atomic>
#include <functional>
#include <string>
#include <memory>

namespace mbgl {

class GlyphAtlas;
class GlyphAtlasObserver;
class AsyncRequest;
class FileSource;

class GlyphPBF : private util::noncopyable {
public:
    GlyphPBF(GlyphAtlas*,
             const FontStack&,
             const GlyphRange&,
             GlyphAtlasObserver*,
             FileSource&);
    ~GlyphPBF();

    bool isParsed() const {
        return parsed;
    }

private:
    std::atomic<bool> parsed;
    std::unique_ptr<AsyncRequest> req;
    GlyphAtlasObserver* observer = nullptr;
};

} // namespace mbgl