diff options
Diffstat (limited to 'src/mbgl/map/map.cpp')
-rw-r--r-- | src/mbgl/map/map.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index f76845e3a7..adaf22d60f 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -818,3 +818,26 @@ void Map::render() { triggerUpdate(); } } + +void Map::setSourceTileCacheSize(size_t size) { + if (size != getSourceTileCacheSize()) { + invokeTask([=] { + sourceCacheSize = size; + if (!style) return; + for (const auto &source : style->sources) { + source->setCacheSize(sourceCacheSize); + } + env->performCleanup(); + }); + } +} + +void Map::onLowMemory() { + invokeTask([=] { + if (!style) return; + for (const auto &source : style->sources) { + source->onLowMemory(); + } + env->performCleanup(); + }); +}; |