diff options
Diffstat (limited to 'src/mbgl/tile')
-rw-r--r-- | src/mbgl/tile/geometry_tile.cpp | 34 | ||||
-rw-r--r-- | src/mbgl/tile/geometry_tile.hpp | 10 | ||||
-rw-r--r-- | src/mbgl/tile/geometry_tile_worker.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/tile/tile.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/tile/tile.hpp | 8 |
5 files changed, 18 insertions, 40 deletions
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp index a99cb91d26..317c5454f6 100644 --- a/src/mbgl/tile/geometry_tile.cpp +++ b/src/mbgl/tile/geometry_tile.cpp @@ -133,7 +133,7 @@ void GeometryTile::onLayout(LayoutResult result, const uint64_t resultCorrelatio buckets = std::move(result.buckets); - featureIndexPendingCommit = { std::move(result.featureIndex) }; + latestFeatureIndex = std::move(result.featureIndex); if (result.glyphAtlasImage) { glyphAtlasImage = std::move(*result.glyphAtlasImage); @@ -201,22 +201,12 @@ Bucket* GeometryTile::getBucket(const Layer::Impl& layer) const { return it->second.get(); } -void GeometryTile::commitFeatureIndex() { - // We commit our pending FeatureIndex when a global placement has run, - // synchronizing the global CollisionIndex with the latest buckets/FeatureIndex - if (featureIndexPendingCommit) { - featureIndex = std::move(*featureIndexPendingCommit); - featureIndexPendingCommit = nullopt; - } -} - void GeometryTile::queryRenderedFeatures( std::unordered_map<std::string, std::vector<Feature>>& result, const GeometryCoordinates& queryGeometry, const TransformState& transformState, const std::vector<const RenderLayer*>& layers, - const RenderedQueryOptions& options, - const CollisionIndex& collisionIndex) { + const RenderedQueryOptions& options) { if (!getData()) return; @@ -229,17 +219,15 @@ void GeometryTile::queryRenderedFeatures( } } - featureIndex->query(result, - queryGeometry, - transformState.getAngle(), - util::tileSize * id.overscaleFactor(), - std::pow(2, transformState.getZoom() - id.overscaledZ), - options, - id.toUnwrapped(), - sourceID, - layers, - collisionIndex, - additionalRadius); + latestFeatureIndex->query(result, + queryGeometry, + transformState.getAngle(), + util::tileSize * id.overscaleFactor(), + std::pow(2, transformState.getZoom() - id.overscaledZ), + options, + id.toUnwrapped(), + layers, + additionalRadius); } void GeometryTile::querySourceFeatures( diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp index 418db4a0b2..a3b2eb6492 100644 --- a/src/mbgl/tile/geometry_tile.hpp +++ b/src/mbgl/tile/geometry_tile.hpp @@ -54,8 +54,7 @@ public: const GeometryCoordinates& queryGeometry, const TransformState&, const std::vector<const RenderLayer*>& layers, - const RenderedQueryOptions& options, - const CollisionIndex& collisionIndex) override; + const RenderedQueryOptions& options) override; void querySourceFeatures( std::vector<Feature>& result, @@ -88,11 +87,11 @@ public: void markRenderedPreviously() override; void performedFadePlacement() override; - void commitFeatureIndex() override; + const std::shared_ptr<FeatureIndex> getFeatureIndex() const { return latestFeatureIndex; } protected: const GeometryTileData* getData() { - return featureIndex ? featureIndex->getData() : nullptr; + return latestFeatureIndex ? latestFeatureIndex->getData() : nullptr; } private: @@ -113,8 +112,7 @@ private: std::unordered_map<std::string, std::shared_ptr<Bucket>> buckets; - optional<std::unique_ptr<FeatureIndex>> featureIndexPendingCommit; - std::unique_ptr<FeatureIndex> featureIndex; + std::shared_ptr<FeatureIndex> latestFeatureIndex; optional<AlphaImage> glyphAtlasImage; optional<PremultipliedImage> iconAtlasImage; diff --git a/src/mbgl/tile/geometry_tile_worker.cpp b/src/mbgl/tile/geometry_tile_worker.cpp index 1378ad5d3a..2e7d588d9b 100644 --- a/src/mbgl/tile/geometry_tile_worker.cpp +++ b/src/mbgl/tile/geometry_tile_worker.cpp @@ -441,8 +441,7 @@ void GeometryTileWorker::performSymbolLayout() { } symbolLayout->prepare(glyphMap, glyphAtlas.positions, - imageMap, imageAtlas.positions, - id, sourceID); + imageMap, imageAtlas.positions); } symbolLayoutsNeedPreparation = false; diff --git a/src/mbgl/tile/tile.cpp b/src/mbgl/tile/tile.cpp index 88db2ba07c..e65bc39540 100644 --- a/src/mbgl/tile/tile.cpp +++ b/src/mbgl/tile/tile.cpp @@ -37,8 +37,7 @@ void Tile::queryRenderedFeatures( const GeometryCoordinates&, const TransformState&, const std::vector<const RenderLayer*>&, - const RenderedQueryOptions&, - const CollisionIndex&) {} + const RenderedQueryOptions&) {} void Tile::querySourceFeatures( std::vector<Feature>&, diff --git a/src/mbgl/tile/tile.hpp b/src/mbgl/tile/tile.hpp index 23365c6ae3..a0effa29a1 100644 --- a/src/mbgl/tile/tile.hpp +++ b/src/mbgl/tile/tile.hpp @@ -57,8 +57,7 @@ public: const GeometryCoordinates& queryGeometry, const TransformState&, const std::vector<const RenderLayer*>&, - const RenderedQueryOptions& options, - const CollisionIndex&); + const RenderedQueryOptions& options); virtual void querySourceFeatures( std::vector<Feature>& result, @@ -109,11 +108,6 @@ public: // and will have time to finish by the second placement. virtual void performedFadePlacement() {} - // FeatureIndexes are loaded asynchronously, but must be used with a CollisionIndex - // generated from the same data. Calling commitFeatureIndex signals the current - // CollisionIndex is up-to-date and allows us to start using the last loaded FeatureIndex - virtual void commitFeatureIndex() {} - void dumpDebugLogs() const; const OverscaledTileID id; |