diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2014-11-25 13:36:07 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-11-26 15:13:13 -0800 |
commit | 576533b18c7ecc93656f840994d90a3bb86ae239 (patch) | |
tree | 59867819363f56d4ccdf68198bceb763ec46baa5 /include | |
parent | 3aa15306f6b9df452a42a419b2096e41ba11d414 (diff) | |
download | qtlocation-mapboxgl-576533b18c7ecc93656f840994d90a3bb86ae239.tar.gz |
Eliminate Map::getTexturepool()
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/map/map.hpp | 1 | ||||
-rw-r--r-- | include/mbgl/map/raster_tile_data.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/map/source.hpp | 18 | ||||
-rw-r--r-- | include/mbgl/map/tile_parser.hpp | 8 | ||||
-rw-r--r-- | include/mbgl/map/vector_tile_data.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/renderer/raster_bucket.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/util/raster.hpp | 4 |
7 files changed, 28 insertions, 13 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index e56a0f81c1..f36ec6d734 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -128,7 +128,6 @@ public: inline const TransformState &getState() const { return state; } inline util::ptr<Style> getStyle() const { return style; } util::ptr<Sprite> getSprite(); - inline util::ptr<Texturepool> getTexturepool() { return texturepool; } inline timestamp getAnimationTime() const { return animationTime; } inline timestamp getTime() const { return animationTime; } void updateTiles(); diff --git a/include/mbgl/map/raster_tile_data.hpp b/include/mbgl/map/raster_tile_data.hpp index 97317537b9..c73897289f 100644 --- a/include/mbgl/map/raster_tile_data.hpp +++ b/include/mbgl/map/raster_tile_data.hpp @@ -11,12 +11,13 @@ class Map; class Painter; class SourceInfo; class StyleLayer; +class Texturepool; class RasterTileData : public TileData { friend class TileParser; public: - RasterTileData(Tile::ID const& id, Map &map, const util::ptr<SourceInfo> &source); + RasterTileData(Tile::ID const& id, Map &map, Texturepool&, const util::ptr<SourceInfo> &source); ~RasterTileData(); virtual void parse(); diff --git a/include/mbgl/map/source.hpp b/include/mbgl/map/source.hpp index 1ceb04d326..a358cfaee5 100644 --- a/include/mbgl/map/source.hpp +++ b/include/mbgl/map/source.hpp @@ -22,6 +22,7 @@ class GlyphAtlas; class GlyphStore; class SpriteAtlas; class FileSource; +class Texturepool; class Painter; class StyleLayer; class TransformState; @@ -32,7 +33,10 @@ public: Source(const util::ptr<SourceInfo>& info); void load(Map&, FileSource&); - bool update(Map&, uv::worker&, GlyphAtlas&, GlyphStore&, SpriteAtlas&, FileSource&); + bool update(Map&, uv::worker&, + GlyphAtlas&, GlyphStore&, + SpriteAtlas&, + Texturepool&, FileSource&); void updateMatrices(const mat4 &projMatrix, const TransformState &transform); void drawClippingMasks(Painter &painter); @@ -51,9 +55,17 @@ private: int32_t coveringZoomLevel(const TransformState&) const; std::forward_list<Tile::ID> coveringTiles(const TransformState&) const; - bool updateTiles(Map&, uv::worker&, GlyphAtlas&, GlyphStore&, SpriteAtlas&, FileSource&); + bool updateTiles(Map&, uv::worker&, + GlyphAtlas&, GlyphStore&, + SpriteAtlas&, + Texturepool&, FileSource&); + + TileData::State addTile(Map&, uv::worker&, + GlyphAtlas&, GlyphStore&, + SpriteAtlas&, + FileSource&, Texturepool&, + const Tile::ID&); - TileData::State addTile(Map&, uv::worker&, GlyphAtlas&, GlyphStore&, SpriteAtlas&, FileSource&, const Tile::ID&); TileData::State hasTile(const Tile::ID& id); double getZoom(const TransformState &state) const; diff --git a/include/mbgl/map/tile_parser.hpp b/include/mbgl/map/tile_parser.hpp index 5e8aa4fc36..460225db9f 100644 --- a/include/mbgl/map/tile_parser.hpp +++ b/include/mbgl/map/tile_parser.hpp @@ -28,6 +28,7 @@ class StyleBucketSymbol; class StyleLayerGroup; class VectorTileData; class Collision; +class Texturepool; class TileParser : private util::noncopyable { @@ -37,7 +38,8 @@ public: GlyphAtlas & glyphAtlas, GlyphStore & glyphStore, SpriteAtlas & spriteAtlas, - const util::ptr<Sprite> &sprite); + const util::ptr<Sprite> &sprite, + Texturepool& texturepool); ~TileParser(); public: @@ -49,7 +51,7 @@ private: std::unique_ptr<Bucket> createBucket(util::ptr<StyleBucket> bucket_desc); std::unique_ptr<Bucket> createFillBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketFill &fill); - std::unique_ptr<Bucket> createRasterBucket(const util::ptr<Texturepool> &texturepool, const StyleBucketRaster &raster); + std::unique_ptr<Bucket> createRasterBucket(Texturepool& texturepool, const StyleBucketRaster &raster); std::unique_ptr<Bucket> createLineBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketLine &line); std::unique_ptr<Bucket> createSymbolBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketSymbol &symbol); @@ -65,7 +67,7 @@ private: GlyphStore & glyphStore; SpriteAtlas & spriteAtlas; util::ptr<Sprite> sprite; - util::ptr<Texturepool> texturePool; + Texturepool& texturePool; std::unique_ptr<Collision> collision; }; diff --git a/include/mbgl/map/vector_tile_data.hpp b/include/mbgl/map/vector_tile_data.hpp index 59846fcaae..56ecfb51eb 100644 --- a/include/mbgl/map/vector_tile_data.hpp +++ b/include/mbgl/map/vector_tile_data.hpp @@ -24,6 +24,7 @@ class TileParser; class GlyphAtlas; class GlyphStore; class SpriteAtlas; +class Texturepool; class VectorTileData : public TileData { friend class TileParser; @@ -32,6 +33,7 @@ public: VectorTileData(Tile::ID const&, Map&, GlyphAtlas&, GlyphStore&, SpriteAtlas&, + Texturepool&, const util::ptr<SourceInfo>&); ~VectorTileData(); @@ -57,6 +59,7 @@ protected: GlyphAtlas& glyphAtlas; GlyphStore& glyphStore; SpriteAtlas& spriteAtlas; + Texturepool& texturepool; public: const float depth; diff --git a/include/mbgl/renderer/raster_bucket.hpp b/include/mbgl/renderer/raster_bucket.hpp index 794da3b143..8c5d9839a5 100644 --- a/include/mbgl/renderer/raster_bucket.hpp +++ b/include/mbgl/renderer/raster_bucket.hpp @@ -16,7 +16,7 @@ class VertexArrayObject; class RasterBucket : public Bucket { public: - RasterBucket(const util::ptr<Texturepool> &texturepool, const StyleBucketRaster& properties); + RasterBucket(Texturepool&, const StyleBucketRaster&); virtual void render(Painter& painter, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix); virtual bool hasData() const; @@ -31,8 +31,6 @@ public: void drawRaster(RasterShader& shader, StaticVertexBuffer &vertices, VertexArrayObject &array, GLuint texture); Raster raster; - -private: }; } diff --git a/include/mbgl/util/raster.hpp b/include/mbgl/util/raster.hpp index 7051c30091..d74c78f714 100644 --- a/include/mbgl/util/raster.hpp +++ b/include/mbgl/util/raster.hpp @@ -17,7 +17,7 @@ namespace mbgl { class Raster : public std::enable_shared_from_this<Raster> { public: - Raster(const util::ptr<Texturepool> &texturepool); + Raster(Texturepool&); ~Raster(); // load image data @@ -57,7 +57,7 @@ private: bool loaded = false; // shared texture pool - util::ptr<Texturepool> texturepool; + Texturepool& texturepool; // min/mag filter uint32_t filter = 0; |