Asynchronous GeometryTile deletion (#2051)

Co-authored-by: Tim Sylvester <tim@wetdogweather.com>
This commit is contained in:
mwilsnd
2024-02-28 17:18:08 -05:00
committed by GitHub
parent e3cbdb63a8
commit 4fff8a5d33
80 changed files with 1180 additions and 334 deletions

View File

@@ -12,28 +12,36 @@
#include <mbgl/layermanager/layer_manager.hpp>
#include <mbgl/util/constants.hpp>
#include <memory>
#include <utility>
namespace mbgl {
using namespace style;
std::unique_ptr<RenderSource> RenderSource::create(const Immutable<Source::Impl>& impl) {
std::unique_ptr<RenderSource> RenderSource::create(const Immutable<Source::Impl>& impl,
std::shared_ptr<Scheduler> threadPool_) {
switch (impl->type) {
case SourceType::Vector:
return std::make_unique<RenderVectorSource>(staticImmutableCast<VectorSource::Impl>(impl));
return std::make_unique<RenderVectorSource>(staticImmutableCast<VectorSource::Impl>(impl),
std::move(threadPool_));
case SourceType::Raster:
return std::make_unique<RenderRasterSource>(staticImmutableCast<RasterSource::Impl>(impl));
return std::make_unique<RenderRasterSource>(staticImmutableCast<RasterSource::Impl>(impl),
std::move(threadPool_));
case SourceType::RasterDEM:
return std::make_unique<RenderRasterDEMSource>(staticImmutableCast<RasterSource::Impl>(impl));
return std::make_unique<RenderRasterDEMSource>(staticImmutableCast<RasterSource::Impl>(impl),
std::move(threadPool_));
case SourceType::GeoJSON:
return std::make_unique<RenderGeoJSONSource>(staticImmutableCast<GeoJSONSource::Impl>(impl));
return std::make_unique<RenderGeoJSONSource>(staticImmutableCast<GeoJSONSource::Impl>(impl),
std::move(threadPool_));
case SourceType::Video:
assert(false);
return nullptr;
case SourceType::Annotations:
if (LayerManager::annotationsEnabled) {
return std::make_unique<RenderAnnotationSource>(staticImmutableCast<AnnotationSource::Impl>(impl));
return std::make_unique<RenderAnnotationSource>(staticImmutableCast<AnnotationSource::Impl>(impl),
std::move(threadPool_));
} else {
assert(false);
return nullptr;
@@ -41,7 +49,8 @@ std::unique_ptr<RenderSource> RenderSource::create(const Immutable<Source::Impl>
case SourceType::Image:
return std::make_unique<RenderImageSource>(staticImmutableCast<ImageSource::Impl>(impl));
case SourceType::CustomVector:
return std::make_unique<RenderCustomGeometrySource>(staticImmutableCast<CustomGeometrySource::Impl>(impl));
return std::make_unique<RenderCustomGeometrySource>(staticImmutableCast<CustomGeometrySource::Impl>(impl),
std::move(threadPool_));
}
// Not reachable, but placate GCC.