#include #include #include #include namespace mbgl { using namespace style; RenderCustomGeometrySource::RenderCustomGeometrySource(Immutable impl_) : RenderSource(impl_) { tilePyramid.setObserver(this); } const style::CustomGeometrySource::Impl& RenderCustomGeometrySource::impl() const { return static_cast(*baseImpl); } bool RenderCustomGeometrySource::isLoaded() const { return tilePyramid.isLoaded(); } 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); }); } void RenderCustomGeometrySource::upload(gfx::UploadPass& uploadPass) { tilePyramid.upload(uploadPass); } void RenderCustomGeometrySource::prepare(const SourcePrepareParameters& parameters) { tilePyramid.prepare(parameters); } void RenderCustomGeometrySource::finishRender(PaintParameters& parameters) { tilePyramid.finishRender(parameters); } void RenderCustomGeometrySource::updateFadingTiles() { tilePyramid.updateFadingTiles(); } bool RenderCustomGeometrySource::hasFadingTiles() const { return tilePyramid.hasFadingTiles(); } std::vector> RenderCustomGeometrySource::getRenderTiles() { return tilePyramid.getRenderTiles(); } std::unordered_map> RenderCustomGeometrySource::queryRenderedFeatures(const ScreenLineString& geometry, const TransformState& transformState, const std::vector& layers, const RenderedQueryOptions& options, const mat4& projMatrix) const { return tilePyramid.queryRenderedFeatures(geometry, transformState, layers, options, projMatrix); } std::vector RenderCustomGeometrySource::querySourceFeatures(const SourceQueryOptions& options) const { return tilePyramid.querySourceFeatures(options); } void RenderCustomGeometrySource::reduceMemoryUse() { tilePyramid.reduceMemoryUse(); } void RenderCustomGeometrySource::dumpDebugLogs() const { tilePyramid.dumpDebugLogs(); } } // namespace mbgl