ASAN fixes (#1147)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -50,7 +50,7 @@ public:
|
||||
items(std::move(other.items)) {}
|
||||
|
||||
public:
|
||||
~VertexAttribute() = default;
|
||||
virtual ~VertexAttribute() = default;
|
||||
|
||||
int getIndex() const { return index; }
|
||||
void setIndex(int value) { index = value; }
|
||||
|
||||
@@ -22,6 +22,9 @@ private:
|
||||
: VertexAttribute(std::move(other)),
|
||||
glType(other.glType) {}
|
||||
|
||||
public:
|
||||
virtual ~VertexAttributeGL() = default;
|
||||
|
||||
public:
|
||||
platform::GLenum getGLType() const { return glType; }
|
||||
void setGLType(platform::GLenum value);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -112,7 +112,8 @@ public:
|
||||
void updateLayers(gfx::ShaderRegistry&,
|
||||
gfx::Context&,
|
||||
const TransformState&,
|
||||
const std::shared_ptr<UpdateParameters>&);
|
||||
const std::shared_ptr<UpdateParameters>&,
|
||||
const RenderTree&);
|
||||
|
||||
void processChanges();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ void Renderer::render(const std::shared_ptr<UpdateParameters>& updateParameters)
|
||||
if (impl->staticData && impl->staticData->shaders) {
|
||||
auto& context = impl->backend.getContext();
|
||||
auto& shaders = *impl->staticData->shaders;
|
||||
impl->orchestrator.updateLayers(shaders, context, state, updateParameters);
|
||||
impl->orchestrator.updateLayers(shaders, context, state, updateParameters, *renderTree);
|
||||
}
|
||||
|
||||
impl->render(*renderTree);
|
||||
|
||||
Reference in New Issue
Block a user