summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/render_orchestrator.hpp
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-03 18:32:07 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-04 13:16:54 +0300
commit064c60cdcab331bc19fe399492179dcb5b29121a (patch)
tree7f1de3beaa1ebf9c6295605120a6bfa156aa3638 /src/mbgl/renderer/render_orchestrator.hpp
parentac1868882470cb3b2549c65f13cd35efb8105b74 (diff)
downloadqtlocation-mapboxgl-064c60cdcab331bc19fe399492179dcb5b29121a.tar.gz
[core] Orchestration performance for styles with multiple sources
RenderOrchestrator holds a vector of ordered rendered layers, in order to minimize calling of `getRenderLayer()`, which could be quite expensive as it calculates hash of the layer Id. This change improves orchestration performance in particular for the styles that have multiple sources. The `API_renderStill_multiple_sources` benchmark runs approximately 70% faster with the changes applied.
Diffstat (limited to 'src/mbgl/renderer/render_orchestrator.hpp')
-rw-r--r--src/mbgl/renderer/render_orchestrator.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mbgl/renderer/render_orchestrator.hpp b/src/mbgl/renderer/render_orchestrator.hpp
index 9b63498a2a..c2b44c2792 100644
--- a/src/mbgl/renderer/render_orchestrator.hpp
+++ b/src/mbgl/renderer/render_orchestrator.hpp
@@ -127,9 +127,11 @@ private:
const bool backgroundLayerAsColor;
bool contextLost = false;
- // Vector with reserved capacity of layerImpls->size() to avoid reallocation
+ // Vectors with reserved capacity of layerImpls->size() to avoid reallocation
// on each frame.
std::vector<Immutable<style::LayerProperties>> filteredLayersForSource;
+ std::vector<std::reference_wrapper<RenderLayer>> orderedLayers;
+ std::vector<std::reference_wrapper<RenderLayer>> layersNeedPlacement;
};
} // namespace mbgl