summaryrefslogtreecommitdiff
path: root/src/mbgl/text/glyph_atlas.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-10-26 17:32:07 -0700
committerKonstantin Käfer <mail@kkaefer.com>2016-11-01 18:41:52 +0100
commit7b50cac49f353524457e16d3f342299e0886e963 (patch)
tree22356d28417e24623c5919e3a50f5763967a53dc /src/mbgl/text/glyph_atlas.hpp
parent358701f475b2c04c4681d70435bc76370b371285 (diff)
downloadqtlocation-mapboxgl-7b50cac49f353524457e16d3f342299e0886e963.tar.gz
[core] convert GlyphAtlas to use managed texture handling
Diffstat (limited to 'src/mbgl/text/glyph_atlas.hpp')
-rw-r--r--src/mbgl/text/glyph_atlas.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mbgl/text/glyph_atlas.hpp b/src/mbgl/text/glyph_atlas.hpp
index 84875bdd78..550ca4cc17 100644
--- a/src/mbgl/text/glyph_atlas.hpp
+++ b/src/mbgl/text/glyph_atlas.hpp
@@ -8,6 +8,8 @@
#include <mbgl/util/font_stack.hpp>
#include <mbgl/util/exclusive.hpp>
#include <mbgl/util/work_queue.hpp>
+#include <mbgl/util/image.hpp>
+#include <mbgl/gl/texture.hpp>
#include <mbgl/gl/object.hpp>
#include <atomic>
@@ -30,7 +32,7 @@ class Context;
class GlyphAtlas : public util::noncopyable {
public:
- GlyphAtlas(uint16_t width, uint16_t height, FileSource&);
+ GlyphAtlas(Size, FileSource&);
~GlyphAtlas();
util::exclusive<GlyphSet> getGlyphSet(const FontStack&);
@@ -66,8 +68,7 @@ public:
// the texture is only bound when the data is out of date (=dirty).
void upload(gl::Context&, gl::TextureUnit unit);
- const uint16_t width;
- const uint16_t height;
+ Size getSize() const;
private:
void requestGlyphRange(const FontStack&, const GlyphRange&);
@@ -100,9 +101,9 @@ private:
std::mutex mtx;
BinPack<uint16_t> bin;
std::unordered_map<FontStack, std::map<uint32_t, GlyphValue>, FontStackHash> index;
- const std::unique_ptr<uint8_t[]> data;
+ const AlphaImage image;
std::atomic<bool> dirty;
- mbgl::optional<gl::UniqueTexture> texture;
+ mbgl::optional<gl::Texture> texture;
};
} // namespace mbgl