From f438bb68b0ee7243e987d453f659c95c504c32ce Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 5 Oct 2016 10:22:10 -0700 Subject: [PATCH] [core] Adhere to vertices/vertexBuffer naming convention --- src/mbgl/renderer/debug_bucket.cpp | 16 ++++++++-------- src/mbgl/renderer/debug_bucket.hpp | 2 +- src/mbgl/renderer/painter.cpp | 6 +++--- src/mbgl/renderer/painter.hpp | 6 +++--- src/mbgl/renderer/painter_background.cpp | 6 +++--- src/mbgl/renderer/painter_clipping.cpp | 4 ++-- src/mbgl/renderer/painter_debug.cpp | 4 ++-- src/mbgl/renderer/painter_raster.cpp | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/mbgl/renderer/debug_bucket.cpp b/src/mbgl/renderer/debug_bucket.cpp index e37ccbff2fd..072cf3ca552 100644 --- a/src/mbgl/renderer/debug_bucket.cpp +++ b/src/mbgl/renderer/debug_bucket.cpp @@ -13,7 +13,7 @@ namespace mbgl { -std::vector buildTextVertexes(const OverscaledTileID& id, +std::vector buildTextVertices(const OverscaledTileID& id, const bool renderable, const bool complete, optional 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(textVertexes.vertexCount))); + if (vertexBuffer.vertexCount != 0) { + array.bind(shader, vertexBuffer, BUFFER_OFFSET_0, context); + MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, static_cast(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(textVertexes.vertexCount))); + if (vertexBuffer.vertexCount != 0) { + array.bind(shader, vertexBuffer, BUFFER_OFFSET_0, context); + MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, static_cast(vertexBuffer.vertexCount))); } } diff --git a/src/mbgl/renderer/debug_bucket.hpp b/src/mbgl/renderer/debug_bucket.hpp index 86ccc6a1b7a..9ba2525d9ce 100644 --- a/src/mbgl/renderer/debug_bucket.hpp +++ b/src/mbgl/renderer/debug_bucket.hpp @@ -38,7 +38,7 @@ class DebugBucket : private util::noncopyable { const MapDebugOptions debugMode; private: - gl::VertexBuffer textVertexes; + gl::VertexBuffer vertexBuffer; gl::VertexArrayObject array; }; diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp index a129e6c0850..cc0724d62ab 100644 --- a/src/mbgl/renderer/painter.cpp +++ b/src/mbgl/renderer/painter.cpp @@ -40,7 +40,7 @@ using namespace style; Painter::Painter(const TransformState& state_) : state(state_), - tileTriangleVertexes(context.createVertexBuffer(std::vector {{ + tileTriangleVertexBuffer(context.createVertexBuffer(std::vector {{ { 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 {{ + tileLineStripVertexBuffer(context.createVertexBuffer(std::vector {{ { 0, 0 }, { util::EXTENT, 0 }, { util::EXTENT, util::EXTENT }, { 0, util::EXTENT }, { 0, 0 } }})), - rasterVertexes(context.createVertexBuffer(std::vector {{ + rasterVertexBuffer(context.createVertexBuffer(std::vector {{ { 0, 0, 0, 0 }, { util::EXTENT, 0, 32767, 0 }, { 0, util::EXTENT, 0, 32767 }, diff --git a/src/mbgl/renderer/painter.hpp b/src/mbgl/renderer/painter.hpp index c33ad470202..bfa893f28ea 100644 --- a/src/mbgl/renderer/painter.hpp +++ b/src/mbgl/renderer/painter.hpp @@ -188,9 +188,9 @@ class Painter : private util::noncopyable { std::unique_ptr overdrawShaders; #endif - gl::VertexBuffer tileTriangleVertexes; - gl::VertexBuffer tileLineStripVertexes; - gl::VertexBuffer rasterVertexes; + gl::VertexBuffer tileTriangleVertexBuffer; + gl::VertexBuffer tileLineStripVertexBuffer; + gl::VertexBuffer rasterVertexBuffer; gl::VertexArrayObject tileBorderArray; }; diff --git a/src/mbgl/renderer/painter_background.cpp b/src/mbgl/renderer/painter_background.cpp index 2dab1ccacb5..49efbef2860 100644 --- a/src/mbgl/renderer/painter_background.cpp +++ b/src/mbgl/renderer/painter_background.cpp @@ -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(tileTriangleVertexes.vertexCount))); + MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, static_cast(tileTriangleVertexBuffer.vertexCount))); } } diff --git a/src/mbgl/renderer/painter_clipping.cpp b/src/mbgl/renderer/painter_clipping.cpp index e60e861e226..b585c03b4ae 100644 --- a/src/mbgl/renderer/painter_clipping.cpp +++ b/src/mbgl/renderer/painter_clipping.cpp @@ -29,7 +29,7 @@ void Painter::drawClippingMasks(PaintParameters& parameters, const std::map(tileTriangleVertexes.vertexCount))); + MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLES, 0, static_cast(tileTriangleVertexBuffer.vertexCount))); } } diff --git a/src/mbgl/renderer/painter_debug.cpp b/src/mbgl/renderer/painter_debug.cpp index a3fc6bff20d..60300d5620f 100644 --- a/src/mbgl/renderer/painter_debug.cpp +++ b/src/mbgl/renderer/painter_debug.cpp @@ -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(tileLineStripVertexes.vertexCount))); + MBGL_CHECK_ERROR(glDrawArrays(GL_LINE_STRIP, 0, static_cast(tileLineStripVertexBuffer.vertexCount))); } #ifndef NDEBUG diff --git a/src/mbgl/renderer/painter_raster.cpp b/src/mbgl/renderer/painter_raster.cpp index 243f704952a..8b39c8adf8d 100644 --- a/src/mbgl/renderer/painter_raster.cpp +++ b/src/mbgl/renderer/painter_raster.cpp @@ -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); } }