fixes #1157, #1255: cache parsed tiles in memory

This commit is contained in:
Justin R. Miller
2015-04-16 01:15:41 -07:00
parent c574acd64d
commit 190709c6b1
9 changed files with 191 additions and 7 deletions

View File

@@ -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();
});
};