Gl cleanup clang-tidy fixes

This commit is contained in:
Dan Paulat 2025-05-09 18:11:49 -05:00
parent d5e5019811
commit 4955dcd2c9
5 changed files with 15 additions and 6 deletions

View file

@ -176,7 +176,13 @@ void ColorTableLayer::Render(
gl.glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
gl.glDrawArrays(GL_TRIANGLES, 0, 6);
mapContext->set_color_table_margins(QMargins {0, 0, 0, 10});
static constexpr int kLeftMargin_ = 0;
static constexpr int kTopMargin_ = 0;
static constexpr int kRightMargin_ = 0;
static constexpr int kBottomMargin_ = 10;
mapContext->set_color_table_margins(
QMargins {kLeftMargin_, kTopMargin_, kRightMargin_, kBottomMargin_});
}
else
{

View file

@ -131,8 +131,9 @@ void DrawLayer::RenderWithoutImGui(
p->textureAtlas_ = glContext->GetTextureAtlas();
// Determine if the texture atlas changed since last render
std::uint64_t newTextureAtlasBuildCount = glContext->texture_buffer_count();
bool textureAtlasChanged =
const std::uint64_t newTextureAtlasBuildCount =
glContext->texture_buffer_count();
const bool textureAtlasChanged =
newTextureAtlasBuildCount != p->textureAtlasBuildCount_;
// Set OpenGL blend mode for transparency

View file

@ -33,6 +33,7 @@
#include <algorithm>
#include <ranges>
#include <set>
#include <utility>
#include <backends/imgui_impl_opengl3.h>
#include <backends/imgui_impl_qt.hpp>
@ -70,13 +71,13 @@ class MapWidgetImpl : public QObject
public:
explicit MapWidgetImpl(MapWidget* widget,
std::size_t id,
const QMapLibre::Settings& settings,
QMapLibre::Settings settings,
std::shared_ptr<gl::GlContext> glContext) :
id_ {id},
uuid_ {boost::uuids::random_generator()()},
glContext_ {std::move(glContext)},
widget_ {widget},
settings_(settings),
settings_(std::move(settings)),
map_(),
layerList_ {},
imGuiRendererInitialized_ {false},

View file

@ -513,7 +513,7 @@ void OverlayLayer::Render(const std::shared_ptr<MapContext>& mapContext,
p->icons_->SetIconVisible(p->mapCenterIcon_,
generalSettings.show_map_center().GetValue());
QMargins colorTableMargins = mapContext->color_table_margins();
const QMargins colorTableMargins = mapContext->color_table_margins();
if (colorTableMargins != p->lastColorTableMargins_ || p->firstRender_)
{
// Draw map logo with a 10x10 indent from the bottom left