summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-07 12:06:31 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-13 10:57:46 -0700
commit7c282d074c1e77d69640354ad5b9839fab65360d (patch)
tree0d29612bef4a9a1aa0d40a83fe9937d8557f18a0 /src
parentbfcd21dd7e1531466be365447bb9a9630ed20d31 (diff)
downloadqtlocation-mapboxgl-7c282d074c1e77d69640354ad5b9839fab65360d.tar.gz
[core] Eliminate static {Vector,Raster}TileData::parseData
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/tile/raster_tile_data.cpp4
-rw-r--r--src/mbgl/tile/raster_tile_data.hpp2
-rw-r--r--src/mbgl/tile/tile_source_impl.hpp3
-rw-r--r--src/mbgl/tile/vector_tile_data.cpp6
-rw-r--r--src/mbgl/tile/vector_tile_data.hpp5
5 files changed, 8 insertions, 12 deletions
diff --git a/src/mbgl/tile/raster_tile_data.cpp b/src/mbgl/tile/raster_tile_data.cpp
index cc48b3e155..67cf1a089d 100644
--- a/src/mbgl/tile/raster_tile_data.cpp
+++ b/src/mbgl/tile/raster_tile_data.cpp
@@ -70,7 +70,3 @@ void RasterTileData::setNecessity(Necessity necessity) {
void RasterTileData::cancel() {
workRequest.reset();
}
-
-std::shared_ptr<const std::string> RasterTileData::parseData(std::shared_ptr<const std::string> data) {
- return data;
-}
diff --git a/src/mbgl/tile/raster_tile_data.hpp b/src/mbgl/tile/raster_tile_data.hpp
index bbd033230d..ef9e29c0d7 100644
--- a/src/mbgl/tile/raster_tile_data.hpp
+++ b/src/mbgl/tile/raster_tile_data.hpp
@@ -34,8 +34,6 @@ public:
void cancel() override;
Bucket* getBucket(const style::Layer&) override;
- static std::shared_ptr<const std::string> parseData(std::shared_ptr<const std::string>);
-
private:
gl::TexturePool& texturePool;
Worker& worker;
diff --git a/src/mbgl/tile/tile_source_impl.hpp b/src/mbgl/tile/tile_source_impl.hpp
index b5a48a97bb..625a0e2020 100644
--- a/src/mbgl/tile/tile_source_impl.hpp
+++ b/src/mbgl/tile/tile_source_impl.hpp
@@ -95,8 +95,7 @@ void TileSource<T>::loadedData(const Response& res) {
resource.priorModified = res.modified;
resource.priorExpires = res.expires;
resource.priorEtag = res.etag;
- tileData.setData(res.noContent ? nullptr : T::parseData(res.data), res.modified,
- res.expires);
+ tileData.setData(res.noContent ? nullptr : res.data, res.modified, res.expires);
}
}
diff --git a/src/mbgl/tile/vector_tile_data.cpp b/src/mbgl/tile/vector_tile_data.cpp
index 6961d31bd2..b2bb5e2112 100644
--- a/src/mbgl/tile/vector_tile_data.cpp
+++ b/src/mbgl/tile/vector_tile_data.cpp
@@ -21,8 +21,10 @@ void VectorTileData::setNecessity(Necessity necessity) {
tileSource.setNecessity(static_cast<TileSource<VectorTileData>::Necessity>(necessity));
}
-std::unique_ptr<GeometryTile> VectorTileData::parseData(std::shared_ptr<const std::string> data) {
- return data ? std::make_unique<VectorTile>(data) : nullptr;
+void VectorTileData::setData(std::shared_ptr<const std::string> data,
+ optional<Timestamp> modified,
+ optional<Timestamp> expires) {
+ GeometryTileData::setData(data ? std::make_unique<VectorTile>(data) : nullptr, modified, expires);
}
} // namespace mbgl
diff --git a/src/mbgl/tile/vector_tile_data.hpp b/src/mbgl/tile/vector_tile_data.hpp
index 8e653386b8..a9ea08674f 100644
--- a/src/mbgl/tile/vector_tile_data.hpp
+++ b/src/mbgl/tile/vector_tile_data.hpp
@@ -21,8 +21,9 @@ public:
~VectorTileData();
void setNecessity(Necessity) final;
-
- static std::unique_ptr<GeometryTile> parseData(std::shared_ptr<const std::string>);
+ void setData(std::shared_ptr<const std::string> data,
+ optional<Timestamp> modified,
+ optional<Timestamp> expires);
private:
TileSource<VectorTileData> tileSource;