[core] Immutable Impls
This commit is contained in:
@@ -9,12 +9,15 @@ namespace mbgl {
|
||||
|
||||
using namespace style;
|
||||
|
||||
RenderVectorSource::RenderVectorSource(const style::VectorSource::Impl& impl_)
|
||||
: RenderSource(impl_),
|
||||
impl(impl_) {
|
||||
RenderVectorSource::RenderVectorSource(Immutable<style::VectorSource::Impl> impl_)
|
||||
: RenderSource(impl_) {
|
||||
tilePyramid.setObserver(this);
|
||||
}
|
||||
|
||||
const style::VectorSource::Impl& RenderVectorSource::impl() const {
|
||||
return static_cast<const style::VectorSource::Impl&>(*baseImpl);
|
||||
}
|
||||
|
||||
bool RenderVectorSource::isLoaded() const {
|
||||
return tilePyramid.isLoaded();
|
||||
}
|
||||
@@ -37,7 +40,7 @@ std::map<UnwrappedTileID, RenderTile>& RenderVectorSource::getRenderTiles() {
|
||||
}
|
||||
|
||||
void RenderVectorSource::updateTiles(const TileParameters& parameters) {
|
||||
optional<Tileset> tileset = impl.getTileset();
|
||||
optional<Tileset> tileset = impl().getTileset();
|
||||
|
||||
if (!tileset) {
|
||||
return;
|
||||
@@ -53,7 +56,7 @@ void RenderVectorSource::updateTiles(const TileParameters& parameters) {
|
||||
util::tileSize,
|
||||
tileset->zoomRange,
|
||||
[&] (const OverscaledTileID& tileID) {
|
||||
return std::make_unique<VectorTile>(tileID, impl.id, parameters, *tileset);
|
||||
return std::make_unique<VectorTile>(tileID, impl().id, parameters, *tileset);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user