summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-07-01 17:38:49 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-07-02 10:12:03 -0700
commit1da2c3f840c83cab72a94c7af29bfc1da2f4d9bd (patch)
tree6088f1b35b0945ea8f915574dfc4615b6befa1db
parentdba1e44f551cbd270eac55993dd14d30d8896013 (diff)
downloadqtlocation-mapboxgl-1da2c3f840c83cab72a94c7af29bfc1da2f4d9bd.tar.gz
Remove unnecessary virtual methods from TileData
-rw-r--r--src/mbgl/map/raster_tile_data.cpp5
-rw-r--r--src/mbgl/map/raster_tile_data.hpp4
-rw-r--r--src/mbgl/map/source.cpp16
-rw-r--r--src/mbgl/map/tile_data.hpp9
-rw-r--r--src/mbgl/map/vector_tile_data.hpp4
5 files changed, 12 insertions, 26 deletions
diff --git a/src/mbgl/map/raster_tile_data.cpp b/src/mbgl/map/raster_tile_data.cpp
index 837f4c0f1b..b0fa4d171b 100644
--- a/src/mbgl/map/raster_tile_data.cpp
+++ b/src/mbgl/map/raster_tile_data.cpp
@@ -60,11 +60,6 @@ void RasterTileData::request(float pixelRatio,
});
}
-bool RasterTileData::reparse(std::function<void()>) {
- assert(false);
- return false;
-}
-
Bucket* RasterTileData::getBucket(StyleLayer const&) {
return &bucket;
}
diff --git a/src/mbgl/map/raster_tile_data.hpp b/src/mbgl/map/raster_tile_data.hpp
index ce0286f5a0..93d018bced 100644
--- a/src/mbgl/map/raster_tile_data.hpp
+++ b/src/mbgl/map/raster_tile_data.hpp
@@ -19,9 +19,7 @@ public:
~RasterTileData();
void request(float pixelRatio,
- const std::function<void()>& callback) override;
-
- bool reparse(std::function<void ()> callback) override;
+ const std::function<void()>& callback);
void cancel() override;
diff --git a/src/mbgl/map/source.cpp b/src/mbgl/map/source.cpp
index f468ab33ed..7b6a35ed2a 100644
--- a/src/mbgl/map/source.cpp
+++ b/src/mbgl/map/source.cpp
@@ -290,18 +290,20 @@ TileData::State Source::addTile(MapData& data,
// If we don't find working tile data, we're just going to load it.
if (info.type == SourceType::Vector) {
- new_tile.data =
- std::make_shared<VectorTileData>(normalized_id, style, info,
+ auto tileData = std::make_shared<VectorTileData>(normalized_id, style, info,
transformState.getAngle(), data.getCollisionDebug());
- new_tile.data->request(transformState.getPixelRatio(), callback);
+ tileData->request(transformState.getPixelRatio(), callback);
+ new_tile.data = tileData;
} else if (info.type == SourceType::Raster) {
- new_tile.data = std::make_shared<RasterTileData>(normalized_id, texturePool, info, style.workers);
- new_tile.data->request(transformState.getPixelRatio(), callback);
+ auto tileData = std::make_shared<RasterTileData>(normalized_id, texturePool, info, style.workers);
+ tileData->request(transformState.getPixelRatio(), callback);
+ new_tile.data = tileData;
} else if (info.type == SourceType::Annotations) {
- new_tile.data = std::make_shared<LiveTileData>(normalized_id, data.annotationManager,
+ auto tileData = std::make_shared<LiveTileData>(normalized_id, data.annotationManager,
style, info,
transformState.getAngle(), data.getCollisionDebug());
- new_tile.data->reparse(callback);
+ tileData->reparse(callback);
+ new_tile.data = tileData;
} else {
throw std::runtime_error("source type not implemented");
}
diff --git a/src/mbgl/map/tile_data.hpp b/src/mbgl/map/tile_data.hpp
index 5525256957..476172ce55 100644
--- a/src/mbgl/map/tile_data.hpp
+++ b/src/mbgl/map/tile_data.hpp
@@ -70,15 +70,6 @@ public:
TileData(const TileID&);
virtual ~TileData() = default;
- virtual void request(float pixelRatio,
- const std::function<void()>& callback) = 0;
-
- // Schedule a tile reparse on a worker thread and call the callback on
- // completion. It will return true if the work was schedule or false it was
- // not, which can occur if the tile is already being parsed by another
- // worker.
- virtual bool reparse(std::function<void ()> callback) = 0;
-
// Mark this tile as no longer needed and cancel any pending work.
virtual void cancel() = 0;
diff --git a/src/mbgl/map/vector_tile_data.hpp b/src/mbgl/map/vector_tile_data.hpp
index a035015f4d..b0b5ec6e89 100644
--- a/src/mbgl/map/vector_tile_data.hpp
+++ b/src/mbgl/map/vector_tile_data.hpp
@@ -29,9 +29,9 @@ public:
size_t countBuckets() const;
void request(float pixelRatio,
- const std::function<void()>& callback) override;
+ const std::function<void()>& callback);
- bool reparse(std::function<void ()> callback) override;
+ virtual bool reparse(std::function<void ()> callback);
void redoPlacement(float angle, bool collisionDebug) override;