#include #include #include #include namespace mbgl { using namespace style; RenderCustomGeometrySource::RenderCustomGeometrySource(Immutable impl_) : RenderTileSource(std::move(impl_)) { tilePyramid.setObserver(this); } const style::CustomGeometrySource::Impl& RenderCustomGeometrySource::impl() const { return static_cast(*baseImpl); } void RenderCustomGeometrySource::update(Immutable baseImpl_, const std::vector>& layers, const bool needsRendering, const bool needsRelayout, const TileParameters& parameters) { std::swap(baseImpl, baseImpl_); enabled = needsRendering; auto tileLoader = impl().getTileLoader(); if (!tileLoader) { return; } tilePyramid.update(layers, needsRendering, needsRelayout, parameters, SourceType::CustomVector, util::tileSize, impl().getZoomRange(), {}, [&] (const OverscaledTileID& tileID) { return std::make_unique(tileID, impl().id, parameters, impl().getTileOptions(), *tileLoader); }); } } // namespace mbgl