From 286bc66ba4eef043af1d67858f8f5ec540717f31 Mon Sep 17 00:00:00 2001 From: Aleksandar Stojiljkovic Date: Tue, 9 Jul 2019 14:07:41 +0300 Subject: Issue #15065 changelogs and nit fix. --- src/mbgl/renderer/render_orchestrator.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mbgl/renderer/render_orchestrator.cpp') diff --git a/src/mbgl/renderer/render_orchestrator.cpp b/src/mbgl/renderer/render_orchestrator.cpp index c70ce63c76..cf5a7d190e 100644 --- a/src/mbgl/renderer/render_orchestrator.cpp +++ b/src/mbgl/renderer/render_orchestrator.cpp @@ -342,15 +342,16 @@ std::unique_ptr RenderOrchestrator::createRenderTree(const UpdatePar } } - uint32_t i = static_cast(layerRenderItems.size()) - 1; - for (auto it = layerRenderItems.begin(); it != layerRenderItems.end(); ++it, --i) { - RenderLayer& renderLayer = it->layer; - renderLayer.prepare({it->source, *imageManager, *patternAtlas, *lineAtlas, updateParameters.transformState}); + auto opaquePassCutOffEstimation = layerRenderItems.size(); + for (auto& renderItem : layerRenderItems) { + RenderLayer& renderLayer = renderItem.layer; + renderLayer.prepare({renderItem.source, *imageManager, *patternAtlas, *lineAtlas, updateParameters.transformState}); if (renderLayer.needsPlacement()) { layersNeedPlacement.emplace_back(renderLayer); } if (renderLayer.is3D() && renderTreeParameters->opaquePassCutOff == 0) { - renderTreeParameters->opaquePassCutOff = i; + --opaquePassCutOffEstimation; + renderTreeParameters->opaquePassCutOff = uint32_t(opaquePassCutOffEstimation); } } // Symbol placement. -- cgit v1.2.1