Remove unnecessary virtual methods from TileData
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user