diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-11 10:29:37 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-12 11:26:27 -0700 |
commit | 095dc7b16793ed502b3429e0e4c2db7f1207094e (patch) | |
tree | 929856d13dcec05a610b497cc2256b44725ba184 /src/mbgl/style/sources | |
parent | afead4e749794e6d0f6b9cb9bd7897face64104a (diff) | |
download | qtlocation-mapboxgl-095dc7b16793ed502b3429e0e4c2db7f1207094e.tar.gz |
[core] Replace createRender{Source,Layer} with Render{Source,Layer}::create
* Eliminates the need for EnableImmutableFromThis
* Eliminates the dependency of {Source,Layer}::Impl on corresponding Render class (circular dependency)
Diffstat (limited to 'src/mbgl/style/sources')
-rw-r--r-- | src/mbgl/style/sources/geojson_source_impl.cpp | 8 | ||||
-rw-r--r-- | src/mbgl/style/sources/geojson_source_impl.hpp | 1 | ||||
-rw-r--r-- | src/mbgl/style/sources/raster_source_impl.cpp | 5 | ||||
-rw-r--r-- | src/mbgl/style/sources/raster_source_impl.hpp | 1 | ||||
-rw-r--r-- | src/mbgl/style/sources/vector_source_impl.cpp | 5 | ||||
-rw-r--r-- | src/mbgl/style/sources/vector_source_impl.hpp | 1 |
6 files changed, 2 insertions, 19 deletions
diff --git a/src/mbgl/style/sources/geojson_source_impl.cpp b/src/mbgl/style/sources/geojson_source_impl.cpp index 17d05aaa5a..be347af2ab 100644 --- a/src/mbgl/style/sources/geojson_source_impl.cpp +++ b/src/mbgl/style/sources/geojson_source_impl.cpp @@ -1,6 +1,6 @@ #include <mbgl/style/sources/geojson_source_impl.hpp> -#include <mbgl/renderer/sources/render_geojson_source.hpp> -#include <mbgl/util/constants.cpp> +#include <mbgl/util/constants.hpp> +#include <mbgl/tile/tile_id.hpp> #include <mapbox/geojsonvt.hpp> #include <supercluster.hpp> @@ -79,9 +79,5 @@ optional<std::string> GeoJSONSource::Impl::getAttribution() const { return {}; } -std::unique_ptr<RenderSource> GeoJSONSource::Impl::createRenderSource() const { - return std::make_unique<RenderGeoJSONSource>(staticImmutableCast<GeoJSONSource::Impl>(immutableFromThis())); -} - } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/sources/geojson_source_impl.hpp b/src/mbgl/style/sources/geojson_source_impl.hpp index 65580700e7..192ef653dc 100644 --- a/src/mbgl/style/sources/geojson_source_impl.hpp +++ b/src/mbgl/style/sources/geojson_source_impl.hpp @@ -26,7 +26,6 @@ public: GeoJSONData* getData() const; optional<std::string> getAttribution() const final; - std::unique_ptr<RenderSource> createRenderSource() const final; private: GeoJSONOptions options; diff --git a/src/mbgl/style/sources/raster_source_impl.cpp b/src/mbgl/style/sources/raster_source_impl.cpp index 1d684524c7..50dae1f07e 100644 --- a/src/mbgl/style/sources/raster_source_impl.cpp +++ b/src/mbgl/style/sources/raster_source_impl.cpp @@ -1,5 +1,4 @@ #include <mbgl/style/sources/raster_source_impl.hpp> -#include <mbgl/renderer/sources/render_raster_source.hpp> namespace mbgl { namespace style { @@ -30,9 +29,5 @@ optional<std::string> RasterSource::Impl::getAttribution() const { return tileset->attribution; } -std::unique_ptr<RenderSource> RasterSource::Impl::createRenderSource() const { - return std::make_unique<RenderRasterSource>(staticImmutableCast<RasterSource::Impl>(immutableFromThis())); -} - } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/sources/raster_source_impl.hpp b/src/mbgl/style/sources/raster_source_impl.hpp index 0a58953ab7..c41d5485b2 100644 --- a/src/mbgl/style/sources/raster_source_impl.hpp +++ b/src/mbgl/style/sources/raster_source_impl.hpp @@ -15,7 +15,6 @@ public: uint16_t getTileSize() const; optional<std::string> getAttribution() const final; - std::unique_ptr<RenderSource> createRenderSource() const final; private: uint16_t tileSize; diff --git a/src/mbgl/style/sources/vector_source_impl.cpp b/src/mbgl/style/sources/vector_source_impl.cpp index aab62acf3f..b06f0557bf 100644 --- a/src/mbgl/style/sources/vector_source_impl.cpp +++ b/src/mbgl/style/sources/vector_source_impl.cpp @@ -1,5 +1,4 @@ #include <mbgl/style/sources/vector_source_impl.hpp> -#include <mbgl/renderer/sources/render_vector_source.hpp> namespace mbgl { namespace style { @@ -24,9 +23,5 @@ optional<std::string> VectorSource::Impl::getAttribution() const { return tileset->attribution; } -std::unique_ptr<RenderSource> VectorSource::Impl::createRenderSource() const { - return std::make_unique<RenderVectorSource>(staticImmutableCast<VectorSource::Impl>(immutableFromThis())); -} - } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/sources/vector_source_impl.hpp b/src/mbgl/style/sources/vector_source_impl.hpp index 602d0e5bbb..5e559b9266 100644 --- a/src/mbgl/style/sources/vector_source_impl.hpp +++ b/src/mbgl/style/sources/vector_source_impl.hpp @@ -14,7 +14,6 @@ public: optional<Tileset> getTileset() const; optional<std::string> getAttribution() const final; - std::unique_ptr<RenderSource> createRenderSource() const final; private: optional<Tileset> tileset; |