[core] Adhere to vertices/vertexBuffer naming convention
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
std::vector<PlainVertex> buildTextVertexes(const OverscaledTileID& id,
|
||||
std::vector<PlainVertex> buildTextVertices(const OverscaledTileID& id,
|
||||
const bool renderable,
|
||||
const bool complete,
|
||||
optional<Timestamp> modified,
|
||||
@@ -82,20 +82,20 @@ DebugBucket::DebugBucket(const OverscaledTileID& id,
|
||||
modified(std::move(modified_)),
|
||||
expires(std::move(expires_)),
|
||||
debugMode(debugMode_),
|
||||
textVertexes(context.createVertexBuffer(buildTextVertexes(id, renderable_, complete_, modified_, expires_, debugMode_))) {
|
||||
vertexBuffer(context.createVertexBuffer(buildTextVertices(id, renderable_, complete_, modified_, expires_, debugMode_))) {
|
||||
}
|
||||
|
||||
void DebugBucket::drawLines(PlainShader& shader, gl::Context& context) {
|
||||
if (textVertexes.vertexCount != 0) {
|
||||
array.bind(shader, textVertexes, BUFFER_OFFSET_0, context);
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, static_cast<GLsizei>(textVertexes.vertexCount)));
|
||||
if (vertexBuffer.vertexCount != 0) {
|
||||
array.bind(shader, vertexBuffer, BUFFER_OFFSET_0, context);
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, static_cast<GLsizei>(vertexBuffer.vertexCount)));
|
||||
}
|
||||
}
|
||||
|
||||
void DebugBucket::drawPoints(PlainShader& shader, gl::Context& context) {
|
||||
if (textVertexes.vertexCount != 0) {
|
||||
array.bind(shader, textVertexes, BUFFER_OFFSET_0, context);
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(textVertexes.vertexCount)));
|
||||
if (vertexBuffer.vertexCount != 0) {
|
||||
array.bind(shader, vertexBuffer, BUFFER_OFFSET_0, context);
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(vertexBuffer.vertexCount)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
const MapDebugOptions debugMode;
|
||||
|
||||
private:
|
||||
gl::VertexBuffer<PlainVertex> textVertexes;
|
||||
gl::VertexBuffer<PlainVertex> vertexBuffer;
|
||||
gl::VertexArrayObject array;
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ using namespace style;
|
||||
|
||||
Painter::Painter(const TransformState& state_)
|
||||
: state(state_),
|
||||
tileTriangleVertexes(context.createVertexBuffer(std::vector<PlainVertex> {{
|
||||
tileTriangleVertexBuffer(context.createVertexBuffer(std::vector<PlainVertex> {{
|
||||
{ 0, 0 },
|
||||
{ util::EXTENT, 0 },
|
||||
{ 0, util::EXTENT },
|
||||
@@ -48,14 +48,14 @@ Painter::Painter(const TransformState& state_)
|
||||
{ 0, util::EXTENT },
|
||||
{ util::EXTENT, util::EXTENT }
|
||||
}})),
|
||||
tileLineStripVertexes(context.createVertexBuffer(std::vector<PlainVertex> {{
|
||||
tileLineStripVertexBuffer(context.createVertexBuffer(std::vector<PlainVertex> {{
|
||||
{ 0, 0 },
|
||||
{ util::EXTENT, 0 },
|
||||
{ util::EXTENT, util::EXTENT },
|
||||
{ 0, util::EXTENT },
|
||||
{ 0, 0 }
|
||||
}})),
|
||||
rasterVertexes(context.createVertexBuffer(std::vector<RasterVertex> {{
|
||||
rasterVertexBuffer(context.createVertexBuffer(std::vector<RasterVertex> {{
|
||||
{ 0, 0, 0, 0 },
|
||||
{ util::EXTENT, 0, 32767, 0 },
|
||||
{ 0, util::EXTENT, 0, 32767 },
|
||||
|
||||
@@ -188,9 +188,9 @@ private:
|
||||
std::unique_ptr<Shaders> overdrawShaders;
|
||||
#endif
|
||||
|
||||
gl::VertexBuffer<PlainVertex> tileTriangleVertexes;
|
||||
gl::VertexBuffer<PlainVertex> tileLineStripVertexes;
|
||||
gl::VertexBuffer<RasterVertex> rasterVertexes;
|
||||
gl::VertexBuffer<PlainVertex> tileTriangleVertexBuffer;
|
||||
gl::VertexBuffer<PlainVertex> tileLineStripVertexBuffer;
|
||||
gl::VertexBuffer<RasterVertex> rasterVertexBuffer;
|
||||
|
||||
gl::VertexArrayObject tileBorderArray;
|
||||
};
|
||||
|
||||
@@ -46,14 +46,14 @@ void Painter::renderBackground(PaintParameters& parameters, const BackgroundLaye
|
||||
patternShader.u_opacity = properties.backgroundOpacity;
|
||||
|
||||
spriteAtlas->bind(true, context, 0);
|
||||
arrayBackgroundPattern.bind(patternShader, tileTriangleVertexes, BUFFER_OFFSET(0), context);
|
||||
arrayBackgroundPattern.bind(patternShader, tileTriangleVertexBuffer, BUFFER_OFFSET(0), context);
|
||||
|
||||
} else {
|
||||
context.program = plainShader.getID();
|
||||
plainShader.u_color = properties.backgroundColor;
|
||||
plainShader.u_opacity = properties.backgroundOpacity;
|
||||
|
||||
arrayBackground.bind(plainShader, tileTriangleVertexes, BUFFER_OFFSET(0), context);
|
||||
arrayBackground.bind(plainShader, tileTriangleVertexBuffer, BUFFER_OFFSET(0), context);
|
||||
}
|
||||
|
||||
context.stencilTest = false;
|
||||
@@ -84,7 +84,7 @@ void Painter::renderBackground(PaintParameters& parameters, const BackgroundLaye
|
||||
plainShader.u_matrix = vertexMatrix;
|
||||
}
|
||||
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, static_cast<GLsizei>(tileTriangleVertexes.vertexCount)));
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, static_cast<GLsizei>(tileTriangleVertexBuffer.vertexCount)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ void Painter::drawClippingMasks(PaintParameters& parameters, const std::map<Unwr
|
||||
context.colorMask = { false, false, false, false };
|
||||
context.stencilMask = mask;
|
||||
|
||||
arrayCoveringPlain.bind(plainShader, tileTriangleVertexes, BUFFER_OFFSET_0, context);
|
||||
arrayCoveringPlain.bind(plainShader, tileTriangleVertexBuffer, BUFFER_OFFSET_0, context);
|
||||
|
||||
for (const auto& stencil : stencils) {
|
||||
const auto& id = stencil.first;
|
||||
@@ -42,7 +42,7 @@ void Painter::drawClippingMasks(PaintParameters& parameters, const std::map<Unwr
|
||||
|
||||
const GLint ref = (GLint)(clip.reference.to_ulong());
|
||||
context.stencilFunc = { gl::StencilTestFunction::Always, ref, mask };
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLES, 0, static_cast<GLsizei>(tileTriangleVertexes.vertexCount)));
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLES, 0, static_cast<GLsizei>(tileTriangleVertexBuffer.vertexCount)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,10 +80,10 @@ void Painter::renderDebugFrame(const mat4 &matrix) {
|
||||
plainShader.u_opacity = 1.0f;
|
||||
|
||||
// draw tile outline
|
||||
tileBorderArray.bind(plainShader, tileLineStripVertexes, BUFFER_OFFSET_0, context);
|
||||
tileBorderArray.bind(plainShader, tileLineStripVertexBuffer, BUFFER_OFFSET_0, context);
|
||||
plainShader.u_color = { 1.0f, 0.0f, 0.0f, 1.0f };
|
||||
context.lineWidth = 4.0f * frame.pixelRatio;
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_LINE_STRIP, 0, static_cast<GLsizei>(tileLineStripVertexes.vertexCount)));
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_LINE_STRIP, 0, static_cast<GLsizei>(tileLineStripVertexBuffer.vertexCount)));
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
@@ -47,7 +47,7 @@ void Painter::renderRaster(PaintParameters& parameters,
|
||||
context.depthMask = false;
|
||||
setDepthSublayer(0);
|
||||
|
||||
bucket.drawRaster(rasterShader, rasterVertexes, rasterVAO, context);
|
||||
bucket.drawRaster(rasterShader, rasterVertexBuffer, rasterVAO, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user