Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Tile pyramid passes minimumupdate interval to tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
pozdnyakov committed Apr 20, 2020
1 parent 41b7aa5 commit fc67f52
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/mbgl/renderer/tile_pyramid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void TilePyramid::update(const std::vector<Immutable<style::LayerProperties>>& l

const optional<uint8_t>& sourcePrefetchZoomDelta = sourceImpl.getPrefetchZoomDelta();
const optional<uint8_t>& maxParentTileOverscaleFactor = sourceImpl.getMaxOverscaleFactorForParentTiles();
const Duration minimumUpdateInterval = sourceImpl.getMinimumTileUpdateInterval();

std::vector<OverscaledTileID> idealTiles;
std::vector<OverscaledTileID> panTiles;
Expand Down Expand Up @@ -131,6 +132,7 @@ void TilePyramid::update(const std::vector<Immutable<style::LayerProperties>>& l

auto retainTileFn = [&](Tile& tile, TileNecessity necessity) -> void {
if (retain.emplace(tile.id).second) {
tile.setMinimumUpdateInterval(minimumUpdateInterval);
tile.setNecessity(necessity);
}

Expand Down Expand Up @@ -158,14 +160,12 @@ void TilePyramid::update(const std::vector<Immutable<style::LayerProperties>>& l
std::unique_ptr<Tile> tile = cache.pop(tileID);
if (!tile) {
tile = createTile(tileID);
if (tile) {
tile->setObserver(observer);
tile->setLayers(layers);
}
}
if (!tile) {
return nullptr;
if (!tile) return nullptr;
}

tile->setMinimumUpdateInterval(minimumUpdateInterval);
tile->setObserver(observer);
tile->setLayers(layers);
return tiles.emplace(tileID, std::move(tile)).first->second.get();
};

Expand Down

0 comments on commit fc67f52

Please sign in to comment.