summaryrefslogtreecommitdiff
path: root/src/mbgl/text/glyph.hpp
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-03-31 14:53:18 -0700
committerChris Loer <chris.loer@mapbox.com>2017-04-04 11:33:12 -0700
commit5cdf838a387cae446dba500ac49a1c5524bf7949 (patch)
tree3b438034a7842c36a7804096785fca1a6ad6fa80 /src/mbgl/text/glyph.hpp
parent64beba3accb0f2088b2e01fad710f915c81d99c7 (diff)
downloadqtlocation-mapboxgl-5cdf838a387cae446dba500ac49a1c5524bf7949.tar.gz
[core] De-mutex GlyphAtlas and SpriteAtlas
- Expose glyph and icon information to workers via message interface. - Glyph/SpriteAtlas track which tiles have outstanding requests and send messages to them when glyphs/icons become available. - Remove obsolete "updateSymbolDependentTiles" pathway - Symbol preparation for a tile now depends on all glyphs becoming available before it can start. - Start tracking individual icons needed for a tile, although we don't do anything with the information yet. - Introduce typedef for GlyphID
Diffstat (limited to 'src/mbgl/text/glyph.hpp')
-rw-r--r--src/mbgl/text/glyph.hpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mbgl/text/glyph.hpp b/src/mbgl/text/glyph.hpp
index 175a36f0fa..6aa4e11b1c 100644
--- a/src/mbgl/text/glyph.hpp
+++ b/src/mbgl/text/glyph.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/text/glyph_range.hpp>
+#include <mbgl/util/font_stack.hpp>
#include <mbgl/util/rect.hpp>
#include <mbgl/util/traits.hpp>
#include <mbgl/util/image.hpp>
@@ -12,8 +13,11 @@
namespace mbgl {
+typedef char16_t GlyphID;
+typedef std::set<GlyphID> GlyphIDs;
+
// Note: this only works for the BMP
-GlyphRange getGlyphRange(char16_t glyph);
+GlyphRange getGlyphRange(GlyphID glyph);
struct GlyphMetrics {
explicit operator bool() const {
@@ -50,14 +54,14 @@ struct Glyph {
const GlyphMetrics metrics;
};
-typedef std::map<uint32_t, Glyph> GlyphPositions;
+typedef std::map<GlyphID, Glyph> GlyphPositions;
class PositionedGlyph {
public:
- explicit PositionedGlyph(uint32_t glyph_, float x_, float y_, float angle_)
+ explicit PositionedGlyph(GlyphID glyph_, float x_, float y_, float angle_)
: glyph(glyph_), x(x_), y(y_), angle(angle_) {}
- uint32_t glyph = 0;
+ GlyphID glyph = 0;
float x = 0;
float y = 0;
float angle = 0;
@@ -86,7 +90,7 @@ public:
// also need to be reencoded.
static constexpr const uint8_t borderSize = 3;
- uint32_t id = 0;
+ GlyphID id = 0;
// A signed distance field of the glyph with a border (see above).
AlphaImage bitmap;
@@ -121,4 +125,9 @@ constexpr WritingModeType operator~(WritingModeType value) {
return WritingModeType(~mbgl::underlying_type(value));
}
+typedef std::map<FontStack,GlyphIDs> GlyphDependencies;
+typedef std::map<FontStack,GlyphRangeSet> GlyphRangeDependencies;
+typedef std::map<FontStack,GlyphPositions> GlyphPositionMap;
+
+
} // end namespace mbgl