ASAN fixes (#1147)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
mwilsnd
2023-05-25 14:53:40 -05:00
committed by Bart Louwers
parent b823f036fe
commit 1c8304a609
5 changed files with 13 additions and 7 deletions

View File

@@ -834,7 +834,8 @@ void RenderOrchestrator::observeLayerGroups(std::function<void(const LayerGroup&
void RenderOrchestrator::updateLayers(gfx::ShaderRegistry& shaders,
gfx::Context& context,
const TransformState& state,
const std::shared_ptr<UpdateParameters>& updateParameters) {
const std::shared_ptr<UpdateParameters>& updateParameters,
const RenderTree& renderTree) {
const bool isMapModeContinuous = updateParameters->mode == MapMode::Continuous;
const auto transitionOptions = isMapModeContinuous ? updateParameters->transitionOptions
: style::TransitionOptions();
@@ -850,10 +851,11 @@ void RenderOrchestrator::updateLayers(gfx::ShaderRegistry& shaders,
// Layer index, similar but not identical to `layerRenderItems` index in render_impl
// int32_t i = static_cast<int32_t>(layerRenderItems.size()) - 1;
// for (auto it = layerRenderItems.begin(); it != layerRenderItems.end() && i >= 0; ++it, --i) {
auto index = static_cast<int32_t>(renderLayers.size()) - 1;
auto index = static_cast<int32_t>(renderTree.getLayerRenderItems().size()) - 1;
for (auto& kv : renderLayers) {
kv.second->update(index--, shaders, context, state, changes);
for (const auto& item : renderTree.getLayerRenderItems()) {
auto& renderLayer = static_cast<const LayerRenderItem&>(item.get()).layer.get();
renderLayer.update(index--, shaders, context, state, changes);
}
addChanges(changes);