[core] RenderTile does not expose Tile

RenderTile and Tile will be split when ochestration movces to a separate thread.

This PR improves encapsulation of Tiles management: now performed within TilePyramid.
This commit is contained in:
Mikhail Pozdnyakov
2019-05-22 11:01:54 +03:00
parent e5431d0181
commit a03f7b166b
34 changed files with 189 additions and 92 deletions

View File

@@ -340,7 +340,9 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
if (placementChanged) {
placement->commit(updateParameters.timePoint);
crossTileSymbolIndex.pruneUnusedLayers(usedSymbolLayers);
updateFadingTiles();
for (const auto& entry : renderSources) {
entry.second->updateFadingTiles();
}
} else {
placement->setStale();
}
@@ -699,27 +701,16 @@ bool Renderer::Impl::hasTransitions(TimePoint timePoint) const {
if (placement->hasTransitions(timePoint)) {
return true;
}
if (fadingTiles) {
return true;
for (const auto& entry : renderSources) {
if (entry.second->hasFadingTiles()) {
return true;
}
}
return false;
}
void Renderer::Impl::updateFadingTiles() {
fadingTiles = false;
for (auto& source : renderSources) {
for (auto& renderTile : source.second->getRenderTiles()) {
Tile& tile = renderTile.get().tile;
if (tile.holdForFade()) {
fadingTiles = true;
tile.performedFadePlacement();
}
}
}
}
bool Renderer::Impl::isLoaded() const {
for (const auto& entry: renderSources) {
if (!entry.second->isLoaded()) {