diff options
author | Chris Loer <chris.loer@gmail.com> | 2017-03-31 14:53:18 -0700 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2017-04-04 11:33:12 -0700 |
commit | 5cdf838a387cae446dba500ac49a1c5524bf7949 (patch) | |
tree | 3b438034a7842c36a7804096785fca1a6ad6fa80 /src/mbgl/layout/symbol_layout.hpp | |
parent | 64beba3accb0f2088b2e01fad710f915c81d99c7 (diff) | |
download | qtlocation-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/layout/symbol_layout.hpp')
-rw-r--r-- | src/mbgl/layout/symbol_layout.hpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mbgl/layout/symbol_layout.hpp b/src/mbgl/layout/symbol_layout.hpp index bd72d3cd3f..d79ccb3273 100644 --- a/src/mbgl/layout/symbol_layout.hpp +++ b/src/mbgl/layout/symbol_layout.hpp @@ -16,8 +16,6 @@ namespace mbgl { class GeometryTileLayer; class CollisionTile; -class SpriteAtlas; -class GlyphAtlas; class SymbolBucket; class Anchor; @@ -32,12 +30,11 @@ public: SymbolLayout(const style::BucketParameters&, const std::vector<const style::Layer*>&, const GeometryTileLayer&, - SpriteAtlas&); + IconDependencies&, + uintptr_t, + GlyphDependencies&); - bool canPrepare(GlyphAtlas&); - - void prepare(uintptr_t tileUID, - GlyphAtlas&); + void prepare(const GlyphPositionMap& glyphs, const IconAtlasMap& icons); std::unique_ptr<SymbolBucket> place(CollisionTile&); @@ -45,7 +42,6 @@ public: enum State { Pending, // Waiting for the necessary glyphs or icons to be available. - Prepared, // The potential positions of text and icons have been determined. Placed // The final positions have been determined, taking into account prior layers. }; @@ -80,8 +76,8 @@ private: style::SymbolLayoutProperties::PossiblyEvaluated layout; float textMaxSize; - - SpriteAtlas& spriteAtlas; + + uintptr_t spriteAtlasMapIndex; // Actually a pointer to the SpriteAtlas for this symbol's layer, but don't use it from worker threads! const uint32_t tileSize; const float tilePixelRatio; @@ -89,7 +85,6 @@ private: bool sdfIcons = false; bool iconsNeedLinear = false; - GlyphRangeSet ranges; std::vector<SymbolInstance> symbolInstances; std::vector<SymbolFeature> features; |