diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-04-12 14:56:09 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-04-12 14:56:09 +0300 |
commit | f018229fd5bebb57d8bfc596d832652d6593da03 (patch) | |
tree | e0b0a4098816ebc0afdd5547947ebec79d4c3974 | |
parent | e6353f487fe017aea99c9898e46f322e71d76ee8 (diff) | |
download | qtlocation-mapboxgl-upstream/mikhail_sort_render_items.tar.gz |
Use emplace_hint for inserting render itemsupstream/mikhail_sort_render_items
-rw-r--r-- | src/mbgl/renderer/renderer_impl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp index c634e900a8..5078e01edb 100644 --- a/src/mbgl/renderer/renderer_impl.cpp +++ b/src/mbgl/renderer/renderer_impl.cpp @@ -236,10 +236,10 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) { std::set<RenderItem> renderItems; std::vector<const RenderLayerSymbolInterface*> renderItemsWithSymbols; + auto renderItemsEmplaceHint = renderItems.begin(); // Update all sources and initialize renderItems. staticData->has3D = false; - for (const auto& sourceImpl : *sourceImpls) { RenderSource* source = renderSources.at(sourceImpl->id).get(); std::vector<Immutable<Layer::Impl>> filteredLayersForSource; @@ -263,7 +263,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) { if (layerNeedsRendering) { sourceNeedsRendering = true; filteredLayersForSource.push_back(layerImpl); - renderItems.emplace(*layer, source, index); + renderItemsEmplaceHint = renderItems.emplace_hint(renderItemsEmplaceHint, *layer, source, index); } } continue; @@ -278,7 +278,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) { continue; // This layer is shown with background color, and it shall not be added to render items. } } - renderItems.emplace(*layer, nullptr, index); + renderItemsEmplaceHint = renderItems.emplace_hint(renderItemsEmplaceHint, *layer, nullptr, index); } } source->update(sourceImpl, |