diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-05-29 11:07:46 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-05-29 12:04:26 +0300 |
commit | b50aa497cc96e0572adf4b1f2b9fd9a145b3d4f4 (patch) | |
tree | 9741831e38bcce1486d04baa8f29bdee1f8ce634 /src/mbgl/renderer/sources/render_geojson_source.cpp | |
parent | 5bb0a49dc9533eaf871e18fc2a0ffd2534493df5 (diff) | |
download | qtlocation-mapboxgl-b50aa497cc96e0572adf4b1f2b9fd9a145b3d4f4.tar.gz |
[core] Introduce RenderTileSource
RenderTileSource is a base class for the render sources that provide render tiles.
* Removes repeated code
* Simplifies render source code refactoring and improves readability
Diffstat (limited to 'src/mbgl/renderer/sources/render_geojson_source.cpp')
-rw-r--r-- | src/mbgl/renderer/sources/render_geojson_source.cpp | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/src/mbgl/renderer/sources/render_geojson_source.cpp b/src/mbgl/renderer/sources/render_geojson_source.cpp index 44d3a3a2bb..e451dab6d3 100644 --- a/src/mbgl/renderer/sources/render_geojson_source.cpp +++ b/src/mbgl/renderer/sources/render_geojson_source.cpp @@ -66,8 +66,7 @@ MAPBOX_ETERNAL_CONSTEXPR const auto extensionGetters = mapbox::eternal::hash_map } // namespace RenderGeoJSONSource::RenderGeoJSONSource(Immutable<style::GeoJSONSource::Impl> impl_) - : RenderSource(impl_) { - tilePyramid.setObserver(this); + : RenderTileSource(std::move(impl_)) { } RenderGeoJSONSource::~RenderGeoJSONSource() = default; @@ -76,10 +75,6 @@ const style::GeoJSONSource::Impl& RenderGeoJSONSource::impl() const { return static_cast<const style::GeoJSONSource::Impl&>(*baseImpl); } -bool RenderGeoJSONSource::isLoaded() const { - return tilePyramid.isLoaded(); -} - void RenderGeoJSONSource::update(Immutable<style::Source::Impl> baseImpl_, const std::vector<Immutable<LayerProperties>>& layers, const bool needsRendering, @@ -123,43 +118,6 @@ void RenderGeoJSONSource::update(Immutable<style::Source::Impl> baseImpl_, }); } -void RenderGeoJSONSource::upload(gfx::UploadPass& parameters) { - tilePyramid.upload(parameters); -} - -void RenderGeoJSONSource::prepare(const SourcePrepareParameters& parameters) { - tilePyramid.prepare(parameters); -} - -void RenderGeoJSONSource::finishRender(PaintParameters& parameters) { - tilePyramid.finishRender(parameters); -} - -void RenderGeoJSONSource::updateFadingTiles() { - tilePyramid.updateFadingTiles(); -} - -bool RenderGeoJSONSource::hasFadingTiles() const { - return tilePyramid.hasFadingTiles(); -} - -std::vector<std::reference_wrapper<RenderTile>> RenderGeoJSONSource::getRenderTiles() { - return tilePyramid.getRenderTiles(); -} - -std::unordered_map<std::string, std::vector<Feature>> -RenderGeoJSONSource::queryRenderedFeatures(const ScreenLineString& geometry, - const TransformState& transformState, - const std::vector<const RenderLayer*>& layers, - const RenderedQueryOptions& options, - const mat4& projMatrix) const { - return tilePyramid.queryRenderedFeatures(geometry, transformState, layers, options, projMatrix); -} - -std::vector<Feature> RenderGeoJSONSource::querySourceFeatures(const SourceQueryOptions& options) const { - return tilePyramid.querySourceFeatures(options); -} - mapbox::util::variant<Value, FeatureCollection> RenderGeoJSONSource::queryFeatureExtensions(const Feature& feature, const std::string& extension, @@ -187,12 +145,4 @@ RenderGeoJSONSource::queryFeatureExtensions(const Feature& feature, return extensionIt->second(std::move(jsonData), static_cast<std::uint32_t>(*clusterID), args); } -void RenderGeoJSONSource::reduceMemoryUse() { - tilePyramid.reduceMemoryUse(); -} - -void RenderGeoJSONSource::dumpDebugLogs() const { - tilePyramid.dumpDebugLogs(); -} - } // namespace mbgl |