Drawable Renderer (#1570), [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2023-05-23 20:00:33 +00:00
committed by Bart Louwers
parent b8bdf0643c
commit 5df482b12e
4 changed files with 21 additions and 18 deletions

View File

@@ -106,11 +106,11 @@ public:
virtual std::vector<std::uint16_t>& getTriangleIndexData() const = 0;
/// Attach a tweaker to be run on this drawable for each frame
//void addTweaker(DrawableTweakerPtr tweaker) { tweakers.emplace_back(std::move(tweaker)); }
//template <typename TIter>
//void addTweakers(TIter beg, TIter end) {
// tweakers.insert(tweakers.end(), beg, end);
//}
// void addTweaker(DrawableTweakerPtr tweaker) { tweakers.emplace_back(std::move(tweaker)); }
// template <typename TIter>
// void addTweakers(TIter beg, TIter end) {
// tweakers.insert(tweakers.end(), beg, end);
// }
/// Get the tweakers attached to this drawable
const std::vector<DrawableTweakerPtr>& getTweakers() const { return tweakers; }
@@ -143,8 +143,8 @@ protected:
int32_t lineWidth = 1;
int32_t layerIndex = -1;
int32_t subLayerIndex = 0;
DepthMaskType depthType;// = DepthMaskType::ReadOnly;
DepthMaskType depthType; // = DepthMaskType::ReadOnly;
struct Impl;
std::unique_ptr<Impl> impl;

View File

@@ -7,7 +7,8 @@
namespace mbgl {
namespace shaders {
template <> struct ShaderSource<BuiltIn::FillOutlinePatternShader, gfx::Backend::Type::OpenGL> {
template <>
struct ShaderSource<BuiltIn::FillOutlinePatternShader, gfx::Backend::Type::OpenGL> {
static constexpr const char* name = "FillOutlinePatternShader";
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
uniform vec2 u_world;

View File

@@ -7,7 +7,8 @@
namespace mbgl {
namespace shaders {
template <> struct ShaderSource<BuiltIn::FillPatternShader, gfx::Backend::Type::OpenGL> {
template <>
struct ShaderSource<BuiltIn::FillPatternShader, gfx::Backend::Type::OpenGL> {
static constexpr const char* name = "FillPatternShader";
static constexpr const char* vertex = R"(uniform mat4 u_matrix;
uniform vec2 u_pixel_coord_upper;

View File

@@ -365,7 +365,7 @@ void RenderFillLayer::update(const int32_t layerIndex,
const auto& evaluated = getEvaluated<FillLayerProperties>(renderData->layerProperties);
std::vector<std::array<int16_t, 2>> rawVerts;
const auto buildVertices = [&](){
const auto buildVertices = [&]() {
const std::vector<gfx::VertexVector<gfx::detail::VertexType<gfx::AttributeType<int16_t, 2>>>::Vertex>&
verts = bucket.vertices.vector();
if (rawVerts.size() < verts.size()) {
@@ -373,7 +373,7 @@ void RenderFillLayer::update(const int32_t layerIndex,
std::transform(verts.begin(), verts.end(), rawVerts.begin(), [](const auto& x) { return x.a1; });
}
};
fillVertexAttrs.clear();
outlineVertexAttrs.clear();
@@ -546,9 +546,10 @@ void RenderFillLayer::update(const int32_t layerIndex,
}
const auto& crossfade = getCrossfade<FillLayerProperties>(renderData->layerProperties);
const auto doOutline = evaluated.get<FillAntialias>() && unevaluated.get<FillOutlineColor>().isUndefined();
const auto& fillPatternValue =
evaluated.get<FillPattern>().constantOr(Faded<expression::Image>{"", ""});
const auto doOutline = evaluated.get<FillAntialias>() &&
unevaluated.get<FillOutlineColor>().isUndefined();
const auto& fillPatternValue = evaluated.get<FillPattern>().constantOr(
Faded<expression::Image>{"", ""});
const auto patternPosA = tile.getPattern(fillPatternValue.from.id());
const auto patternPosB = tile.getPattern(fillPatternValue.to.id());
@@ -581,11 +582,11 @@ void RenderFillLayer::update(const int32_t layerIndex,
if (patternBuilder) {
patternBuilder->setRenderPass(renderPass);
//patternBuilder->setVertexAttributes(fillVertexAttrs);
// patternBuilder->setVertexAttributes(fillVertexAttrs);
}
if (outlinePatternBuilder) {
outlinePatternBuilder->setRenderPass(renderPass);
//outlinePatternBuilder->setVertexAttributes(outlineVertexAttrs);
// outlinePatternBuilder->setVertexAttributes(outlineVertexAttrs);
}
if (patternBuilder) {
@@ -601,7 +602,7 @@ void RenderFillLayer::update(const int32_t layerIndex,
for (auto& drawable : patternBuilder->clearDrawables()) {
drawable->setTileID(tileID);
//tileLayerGroup->addDrawable(renderPass, tileID, std::move(drawable));
// tileLayerGroup->addDrawable(renderPass, tileID, std::move(drawable));
++stats.tileDrawablesAdded;
}
}
@@ -618,7 +619,7 @@ void RenderFillLayer::update(const int32_t layerIndex,
for (auto& drawable : outlinePatternBuilder->clearDrawables()) {
drawable->setTileID(tileID);
//tileLayerGroup->addDrawable(renderPass, tileID, std::move(drawable));
// tileLayerGroup->addDrawable(renderPass, tileID, std::move(drawable));
++stats.tileDrawablesAdded;
}
}