summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorartemp <artem@mapnik.org>2014-11-24 09:30:59 +0100
committerartemp <artem@mapnik.org>2014-11-24 09:30:59 +0100
commitdeb9665cc971640bb459d32f2751a51ab2b1b153 (patch)
tree4036366b442d765484d6b19cd0f33b9f79d3ad93 /include
parent4af232dcf347723969aad01d7347ff2cdd8cf575 (diff)
parenta3ec4cf17e3d61ef2cdd2083d089bfb3fc72761e (diff)
downloadqtlocation-mapboxgl-deb9665cc971640bb459d32f2751a51ab2b1b153.tar.gz
Merge branch 'master' into image-readers
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/map.hpp1
-rw-r--r--include/mbgl/map/source.hpp9
-rw-r--r--include/mbgl/map/sprite.hpp4
-rw-r--r--include/mbgl/map/tile_data.hpp3
-rw-r--r--include/mbgl/storage/file_source.hpp9
-rw-r--r--include/mbgl/text/glyph_store.hpp9
6 files changed, 14 insertions, 21 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index ad33865cd7..ab5311741f 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -126,7 +126,6 @@ public:
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 GlyphAtlas & getGlyphAtlas() { return glyphAtlas; }
inline util::ptr<GlyphStore> getGlyphStore() { return glyphStore; }
diff --git a/include/mbgl/map/source.hpp b/include/mbgl/map/source.hpp
index e74ddb9902..46fcbdaf61 100644
--- a/include/mbgl/map/source.hpp
+++ b/include/mbgl/map/source.hpp
@@ -18,6 +18,7 @@
namespace mbgl {
class Map;
+class FileSource;
class Painter;
class StyleLayer;
class TransformState;
@@ -27,9 +28,9 @@ class Source : public std::enable_shared_from_this<Source>, private util::noncop
public:
Source(const util::ptr<SourceInfo>& info);
- void load(Map &map);
+ void load(Map&, FileSource&);
+ bool update(Map&, FileSource&);
- bool update(Map &map);
void updateMatrices(const mat4 &projMatrix, const TransformState &transform);
void drawClippingMasks(Painter &painter);
size_t getTileCount() const;
@@ -47,9 +48,9 @@ private:
int32_t coveringZoomLevel(const TransformState&) const;
std::forward_list<Tile::ID> coveringTiles(const TransformState&) const;
- bool updateTiles(Map &map);
+ bool updateTiles(Map&, FileSource&);
- TileData::State addTile(Map &map, const Tile::ID& id);
+ TileData::State addTile(Map&, FileSource&, const Tile::ID&);
TileData::State hasTile(const Tile::ID& id);
double getZoom(const TransformState &state) const;
diff --git a/include/mbgl/map/sprite.hpp b/include/mbgl/map/sprite.hpp
index 454ebd8886..d4b54ba1b5 100644
--- a/include/mbgl/map/sprite.hpp
+++ b/include/mbgl/map/sprite.hpp
@@ -34,11 +34,11 @@ public:
class Sprite : public std::enable_shared_from_this<Sprite>, private util::noncopyable {
private:
struct Key {};
- void load(const util::ptr<FileSource> &fileSource);
+ void load(FileSource& fileSource);
public:
Sprite(const Key &, const std::string& base_url, float pixelRatio);
- static util::ptr<Sprite> Create(const std::string& base_url, float pixelRatio, const util::ptr<FileSource> &fileSource);
+ static util::ptr<Sprite> Create(const std::string& base_url, float pixelRatio, FileSource& fileSource);
const SpritePosition &getSpritePosition(const std::string& name) const;
diff --git a/include/mbgl/map/tile_data.hpp b/include/mbgl/map/tile_data.hpp
index d6666f2f70..baae542e49 100644
--- a/include/mbgl/map/tile_data.hpp
+++ b/include/mbgl/map/tile_data.hpp
@@ -16,6 +16,7 @@
namespace mbgl {
class Map;
+class FileSource;
class Painter;
class SourceInfo;
class StyleLayer;
@@ -43,7 +44,7 @@ public:
TileData(Tile::ID const& id, Map &map, const util::ptr<SourceInfo> &source);
~TileData();
- void request();
+ void request(FileSource&);
void cancel();
void reparse();
const std::string toString() const;
diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp
index 4b17cd29a7..3839ae22e1 100644
--- a/include/mbgl/storage/file_source.hpp
+++ b/include/mbgl/storage/file_source.hpp
@@ -3,6 +3,7 @@
#include <mbgl/storage/resource_type.hpp>
#include <mbgl/storage/request.hpp>
+#include <mbgl/util/noncopyable.hpp>
#include <string>
#include <unordered_map>
@@ -16,18 +17,12 @@ namespace mbgl {
class BaseRequest;
class SQLiteStore;
-class FileSource {
+class FileSource : public util::noncopyable {
private:
- FileSource(const FileSource &) = delete;
- FileSource(FileSource &&) = delete;
- FileSource& operator=(const FileSource &) = delete;
- FileSource& operator=(FileSource &&) = delete;
-
public:
FileSource(uv_loop_t *loop, const std::string &path);
~FileSource();
-public:
// Stores and retrieves the base path/URL for relative requests
void setBase(const std::string &value);
const std::string &getBase() const;
diff --git a/include/mbgl/text/glyph_store.hpp b/include/mbgl/text/glyph_store.hpp
index f8a7cb4d0c..95ab92f307 100644
--- a/include/mbgl/text/glyph_store.hpp
+++ b/include/mbgl/text/glyph_store.hpp
@@ -48,7 +48,7 @@ private:
class GlyphPBF {
public:
- GlyphPBF(const std::string &glyphURL, const std::string &fontStack, GlyphRange glyphRange, const util::ptr<FileSource> &fileSource);
+ GlyphPBF(const std::string &glyphURL, const std::string &fontStack, GlyphRange glyphRange, FileSource& fileSource);
private:
GlyphPBF(const GlyphPBF &) = delete;
@@ -71,7 +71,7 @@ private:
// Manages Glyphrange PBF loading.
class GlyphStore {
public:
- GlyphStore(const util::ptr<FileSource> &fileSource);
+ GlyphStore(FileSource& fileSource);
// Block until all specified GlyphRanges of the specified font stack are loaded.
void waitForGlyphRanges(const std::string &fontStack, const std::set<GlyphRange> &glyphRanges);
@@ -86,11 +86,8 @@ private:
FontStack &createFontStack(const std::string &fontStack);
-public:
std::string glyphURL;
-
-private:
- const util::ptr<FileSource> fileSource;
+ FileSource& fileSource;
std::unordered_map<std::string, std::map<GlyphRange, std::unique_ptr<GlyphPBF>>> ranges;
std::unordered_map<std::string, std::unique_ptr<FontStack>> stacks;
std::mutex mtx;