diff options
author | artemp <artem@mapnik.org> | 2014-10-29 13:44:26 -0400 |
---|---|---|
committer | artemp <artem@mapnik.org> | 2014-10-29 13:44:26 -0400 |
commit | 3b5b15a4e4b1b86c9576969d868caa48520f8d8c (patch) | |
tree | 508671fd21f504071d11613559995d4837ac4ceb /include | |
parent | 372348131989aacedb1e24bf26fb7f92cdba5fe5 (diff) | |
download | qtlocation-mapboxgl-3b5b15a4e4b1b86c9576969d868caa48520f8d8c.tar.gz |
store glyphAtlas by value in Map object, pass by ref
change hasData signiture to expect ```StyleLayer const&```
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/map/map.hpp | 8 | ||||
-rw-r--r-- | include/mbgl/map/raster_tile_data.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/map/tile_data.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/map/tile_parser.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/map/vector_tile_data.hpp | 2 |
5 files changed, 8 insertions, 10 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 8378b27376..d5e725241a 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -3,12 +3,11 @@ #include <mbgl/map/transform.hpp> #include <mbgl/renderer/painter.hpp> - +#include <mbgl/geometry/glyph_atlas.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/time.hpp> #include <mbgl/util/uv.hpp> #include <mbgl/util/ptr.hpp> - #include <cstdint> #include <atomic> #include <iosfwd> @@ -17,7 +16,6 @@ namespace mbgl { -class GlyphAtlas; class GlyphStore; class LayerDescription; class SpriteAtlas; @@ -131,7 +129,7 @@ public: inline const TransformState &getState() const { return state; } inline util::ptr<FileSource> getFileSource() const { return fileSource; } inline util::ptr<Style> getStyle() const { return style; } - inline util::ptr<GlyphAtlas> getGlyphAtlas() { return glyphAtlas; } + inline GlyphAtlas & getGlyphAtlas() { return glyphAtlas; } inline util::ptr<GlyphStore> getGlyphStore() { return glyphStore; } inline util::ptr<SpriteAtlas> getSpriteAtlas() { return spriteAtlas; } util::ptr<Sprite> getSprite(); @@ -203,7 +201,7 @@ private: util::ptr<FileSource> fileSource; util::ptr<Style> style; - util::ptr<GlyphAtlas> glyphAtlas; + GlyphAtlas glyphAtlas; util::ptr<GlyphStore> glyphStore; util::ptr<SpriteAtlas> spriteAtlas; util::ptr<Sprite> sprite; diff --git a/include/mbgl/map/raster_tile_data.hpp b/include/mbgl/map/raster_tile_data.hpp index 14833c0d84..8ae898f989 100644 --- a/include/mbgl/map/raster_tile_data.hpp +++ b/include/mbgl/map/raster_tile_data.hpp @@ -21,7 +21,7 @@ public: virtual void parse(); virtual void render(Painter &painter, util::ptr<StyleLayer> layer_desc, const mat4 &matrix); - virtual bool hasData(util::ptr<StyleLayer> layer_desc) const; + virtual bool hasData(StyleLayer const& layer_desc) const; protected: StyleBucketRaster properties; diff --git a/include/mbgl/map/tile_data.hpp b/include/mbgl/map/tile_data.hpp index 07cf19c5c8..b83f0316e0 100644 --- a/include/mbgl/map/tile_data.hpp +++ b/include/mbgl/map/tile_data.hpp @@ -57,7 +57,7 @@ public: virtual void parse() = 0; virtual void afterParse(); virtual void render(Painter &painter, util::ptr<StyleLayer> layer_desc, const mat4 &matrix) = 0; - virtual bool hasData(util::ptr<StyleLayer> layer_desc) const = 0; + virtual bool hasData(StyleLayer const& layer_desc) const = 0; public: diff --git a/include/mbgl/map/tile_parser.hpp b/include/mbgl/map/tile_parser.hpp index ddb4b98820..383c2929ea 100644 --- a/include/mbgl/map/tile_parser.hpp +++ b/include/mbgl/map/tile_parser.hpp @@ -33,7 +33,7 @@ class TileParser { public: TileParser(const std::string &data, VectorTileData &tile, const util::ptr<const Style> &style, - const util::ptr<GlyphAtlas> &glyphAtlas, + GlyphAtlas & glyphAtlas, const util::ptr<GlyphStore> &glyphStore, const util::ptr<SpriteAtlas> &spriteAtlas, const util::ptr<Sprite> &sprite); @@ -60,7 +60,7 @@ private: // Cross-thread shared data. util::ptr<const Style> style; - util::ptr<GlyphAtlas> glyphAtlas; + GlyphAtlas & glyphAtlas; util::ptr<GlyphStore> glyphStore; util::ptr<SpriteAtlas> spriteAtlas; util::ptr<Sprite> sprite; diff --git a/include/mbgl/map/vector_tile_data.hpp b/include/mbgl/map/vector_tile_data.hpp index 9de666c84f..1fbacab3da 100644 --- a/include/mbgl/map/vector_tile_data.hpp +++ b/include/mbgl/map/vector_tile_data.hpp @@ -33,7 +33,7 @@ public: virtual void parse(); virtual void afterParse(); virtual void render(Painter &painter, util::ptr<StyleLayer> layer_desc, const mat4 &matrix); - virtual bool hasData(util::ptr<StyleLayer> layer_desc) const; + virtual bool hasData(StyleLayer const& layer_desc) const; protected: // Holds the actual geometries in this tile. |