summaryrefslogtreecommitdiff
path: root/include
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
parent9af3b033bf41cd32635172864d58dc169168f9e6 (diff)
downloadqtlocation-mapboxgl-23b61f808cca8d926c11bbb738f384522e41dbbd.tar.gz
Eliminate remaining uses of Map in TileData
Diffstat (limited to 'include')
-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
-rw-r--r--include/mbgl/util/uv_detail.hpp4
5 files changed, 15 insertions, 16 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&,
diff --git a/include/mbgl/util/uv_detail.hpp b/include/mbgl/util/uv_detail.hpp
index 5da222b045..2501a9f3e0 100644
--- a/include/mbgl/util/uv_detail.hpp
+++ b/include/mbgl/util/uv_detail.hpp
@@ -144,8 +144,8 @@ private:
template <typename T>
class work {
public:
- typedef void (*work_callback)(T &object);
- typedef void (*after_work_callback)(T &object);
+ typedef std::function<void (T&)> work_callback;
+ typedef std::function<void (T&)> after_work_callback;
template<typename... Args>
work(worker &worker, work_callback work_cb_, after_work_callback after_work_cb_, Args&&... args)