diff options
author | artemp <artem@mapnik.org> | 2014-10-27 12:35:17 -0400 |
---|---|---|
committer | artemp <artem@mapnik.org> | 2014-10-27 14:18:11 -0400 |
commit | 9364fd7322166578f6f0b7b57273db5a20bea2f7 (patch) | |
tree | f36ac8d81eb8a92c5e1e7f6daa8b5069eb954d01 /include | |
parent | 5508285424b68c6f0a26e70ede8e389715d02deb (diff) | |
download | qtlocation-mapboxgl-9364fd7322166578f6f0b7b57273db5a20bea2f7.tar.gz |
make addGlyphsToAtlas static method of SymbolBucket + add addGlyphs method to minimise number of mutex locking
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/geometry/glyph_atlas.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/renderer/symbol_bucket.hpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/mbgl/geometry/glyph_atlas.hpp b/include/mbgl/geometry/glyph_atlas.hpp index 5b09cbcd6d..639c6cc511 100644 --- a/include/mbgl/geometry/glyph_atlas.hpp +++ b/include/mbgl/geometry/glyph_atlas.hpp @@ -24,6 +24,8 @@ private: std::set<uint64_t> ids; }; + Rect<uint16_t> addGlyph_impl(uint64_t tile_id, const std::string& face_name, + const SDFGlyph& glyph); public: GlyphAtlas(uint16_t width, uint16_t height); ~GlyphAtlas(); @@ -31,6 +33,8 @@ public: Rect<uint16_t> addGlyph(uint64_t tile_id, const std::string& face_name, const SDFGlyph& glyph); + void addGlyphs(uint64_t tileid, std::u32string const& text, std::string const& stackname, + FontStack const& fontStack, GlyphPositions & face); void removeGlyphs(uint64_t tile_id); void bind(); diff --git a/include/mbgl/renderer/symbol_bucket.hpp b/include/mbgl/renderer/symbol_bucket.hpp index 42682401ef..9a5da1d012 100644 --- a/include/mbgl/renderer/symbol_bucket.hpp +++ b/include/mbgl/renderer/symbol_bucket.hpp @@ -86,8 +86,8 @@ private: void addSymbols(Buffer &buffer, const PlacedGlyphs &symbols, float scale, PlacementRange placementRange); // Adds glyphs to the glyph atlas so that they have a left/top/width/height coordinates associated to them that we can use for writing to a buffer. - void addGlyphsToAtlas(uint64_t tileid, const std::string stackname, const std::u32string &string, - const FontStack &fontStack, GlyphAtlas &glyphAtlas, GlyphPositions &face); + static void addGlyphsToAtlas(uint64_t tileid, const std::string stackname, const std::u32string &string, + const FontStack &fontStack, GlyphAtlas &glyphAtlas, GlyphPositions &face); public: const StyleBucketSymbol &properties; |