[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user