summaryrefslogtreecommitdiff
path: root/include/mbgl/map
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2014-11-25 16:35:27 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2014-11-26 15:13:14 -0800
commit23b61f808cca8d926c11bbb738f384522e41dbbd (patch)
treefb93d18c0454628b6f320ca08562cfabfc488a66 /include/mbgl/map
parent9af3b033bf41cd32635172864d58dc169168f9e6 (diff)
downloadqtlocation-mapboxgl-23b61f808cca8d926c11bbb738f384522e41dbbd.tar.gz
Eliminate remaining uses of Map in TileData
Diffstat (limited to 'include/mbgl/map')
-rw-r--r--include/mbgl/map/raster_tile_data.hpp3
-rw-r--r--include/mbgl/map/source.hpp9
-rw-r--r--include/mbgl/map/tile_data.hpp10
-rw-r--r--include/mbgl/map/vector_tile_data.hpp5
4 files changed, 13 insertions, 14 deletions
diff --git a/include/mbgl/map/raster_tile_data.hpp b/include/mbgl/map/raster_tile_data.hpp
index c73897289f..c3bd2fbe3a 100644
--- a/include/mbgl/map/raster_tile_data.hpp
+++ b/include/mbgl/map/raster_tile_data.hpp
@@ -7,7 +7,6 @@
namespace mbgl {
-class Map;
class Painter;
class SourceInfo;
class StyleLayer;
@@ -17,7 +16,7 @@ class RasterTileData : public TileData {
friend class TileParser;
public:
- RasterTileData(Tile::ID const& id, Map &map, Texturepool&, const util::ptr<SourceInfo> &source);
+ RasterTileData(Tile::ID const& id, 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 8de02735c6..6356238790 100644
--- a/include/mbgl/map/source.hpp
+++ b/include/mbgl/map/source.hpp
@@ -39,7 +39,8 @@ public:
util::ptr<Style>,
GlyphAtlas&, GlyphStore&,
SpriteAtlas&, util::ptr<Sprite>,
- Texturepool&, FileSource&);
+ Texturepool&, FileSource&,
+ std::function<void ()> callback);
void updateMatrices(const mat4 &projMatrix, const TransformState &transform);
void drawClippingMasks(Painter &painter);
@@ -62,14 +63,16 @@ private:
util::ptr<Style>,
GlyphAtlas&, GlyphStore&,
SpriteAtlas&, util::ptr<Sprite>,
- Texturepool&, FileSource&);
+ Texturepool&, FileSource&,
+ std::function<void ()> callback);
TileData::State addTile(Map&, uv::worker&,
util::ptr<Style>,
GlyphAtlas&, GlyphStore&,
SpriteAtlas&, util::ptr<Sprite>,
FileSource&, Texturepool&,
- const Tile::ID&);
+ const Tile::ID&,
+ std::function<void ()> callback);
TileData::State hasTile(const Tile::ID& id);
diff --git a/include/mbgl/map/tile_data.hpp b/include/mbgl/map/tile_data.hpp
index 3907ac10ce..7fbb5d5068 100644
--- a/include/mbgl/map/tile_data.hpp
+++ b/include/mbgl/map/tile_data.hpp
@@ -12,6 +12,7 @@
#include <exception>
#include <iosfwd>
#include <string>
+#include <functional>
namespace uv {
class worker;
@@ -45,11 +46,11 @@ public:
};
public:
- TileData(Tile::ID const& id, Map &map, const util::ptr<SourceInfo> &source);
+ TileData(Tile::ID const& id, const util::ptr<SourceInfo> &source);
~TileData();
- void request(uv::worker&, FileSource&);
- void reparse(uv::worker&);
+ void request(uv::worker&, FileSource&, float pixelRatio, std::function<void ()> callback);
+ void reparse(uv::worker&, std::function<void ()> callback);
void cancel();
const std::string toString() const;
@@ -67,9 +68,6 @@ public:
const Tile::ID id;
std::atomic<State> state;
-protected:
- Map &map;
-
public:
util::ptr<SourceInfo> source;
diff --git a/include/mbgl/map/vector_tile_data.hpp b/include/mbgl/map/vector_tile_data.hpp
index 9fa9e4c84f..53dbb7eeb1 100644
--- a/include/mbgl/map/vector_tile_data.hpp
+++ b/include/mbgl/map/vector_tile_data.hpp
@@ -16,7 +16,6 @@
namespace mbgl {
class Bucket;
-class Map;
class Painter;
class SourceInfo;
class StyleLayer;
@@ -32,8 +31,8 @@ class VectorTileData : public TileData {
friend class TileParser;
public:
- VectorTileData(Tile::ID const&, Map&,
- util::ptr<Style>,
+ VectorTileData(Tile::ID const&,
+ float mapMaxZoom, util::ptr<Style>,
GlyphAtlas&, GlyphStore&,
SpriteAtlas&, util::ptr<Sprite>,
Texturepool&,