summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-07-29 12:00:36 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-07-29 12:59:10 +0300
commit41e30343f7c9772ba0a3dfa1497dd5657b18aca1 (patch)
treeafe827e79db4eac71391b70502503e1cf4605447 /src/mbgl/renderer
parentb6dd995813625a89bba8937c512cdf1175827d66 (diff)
downloadqtlocation-mapboxgl-41e30343f7c9772ba0a3dfa1497dd5657b18aca1.tar.gz
[core] Shrink RenderOrchestrator::filteredLayersForSource in reduceMemoryUse()
Before this change, `RenderOrchestrator::filteredLayersForSource` shrank inside `createRenderTree()`, which potentially might have affected rendering performance.
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r--src/mbgl/renderer/render_orchestrator.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mbgl/renderer/render_orchestrator.cpp b/src/mbgl/renderer/render_orchestrator.cpp
index 4d8ef77302..5b6b27c185 100644
--- a/src/mbgl/renderer/render_orchestrator.cpp
+++ b/src/mbgl/renderer/render_orchestrator.cpp
@@ -274,9 +274,6 @@ std::unique_ptr<RenderTree> RenderOrchestrator::createRenderTree(const UpdatePar
// Reserve size for filteredLayersForSource if there are sources.
if (!sourceImpls->empty()) {
filteredLayersForSource.reserve(layerImpls->size());
- if (filteredLayersForSource.capacity() > layerImpls->size()) {
- filteredLayersForSource.shrink_to_fit();
- }
}
// Update all sources and initialize renderItems.
@@ -561,6 +558,7 @@ FeatureExtensionValue RenderOrchestrator::queryFeatureExtensions(const std::stri
}
void RenderOrchestrator::reduceMemoryUse() {
+ filteredLayersForSource.shrink_to_fit();
for (const auto& entry : renderSources) {
entry.second->reduceMemoryUse();
}