[core] Refactor RenderSource updates

* Eliminate updateBatch in favor of diffing layers and detecting changes to properties upon which layout depends.
* Replace RenderSource::{update,remove,invalidate,reload}Tiles with a single update method
* Replace TilePyramid::{update,remove,invalidate,reload}Tiles with a single update method
* Remove Style& dependency TODO from GeometryTile and TileParameters
This commit is contained in:
John Firebaugh
2017-05-30 13:40:36 -07:00
parent 32589c271c
commit 591af0021b
52 changed files with 494 additions and 432 deletions

View File

@@ -27,7 +27,7 @@ StyleDifference<T> diff(const std::vector<T>& a, const std::vector<T>& b, const
bIt++;
} else {
if (aIt->get() != bIt->get()) {
result.changed.emplace((*bIt)->id, *bIt);
result.changed.emplace((*bIt)->id, std::array<T, 2> {{ *aIt, *bIt }});
}
aIt++;
bIt++;
@@ -61,4 +61,13 @@ LayerDifference diffLayers(const std::vector<ImmutableLayer>& a,
});
}
bool hasLayoutDifference(const LayerDifference& layerDiff, const std::string& layerID) {
if (layerDiff.added.count(layerID))
return true;
const auto it = layerDiff.changed.find(layerID);
if (it == layerDiff.changed.end())
return false;
return it->second[0]->hasLayoutDifference(*it->second[1]);
}
} // namespace mbgl