diff --git a/cmake/core-files.cmake b/cmake/core-files.cmake index 240571edbbd..8940899c16c 100644 --- a/cmake/core-files.cmake +++ b/cmake/core-files.cmake @@ -178,33 +178,33 @@ set(MBGL_CORE_FILES src/mbgl/shader/collision_box_shader.hpp src/mbgl/shader/collision_box_vertex.cpp src/mbgl/shader/collision_box_vertex.hpp - src/mbgl/shader/icon_shader.cpp - src/mbgl/shader/icon_shader.hpp + src/mbgl/shader/fill_outline_pattern_shader.cpp + src/mbgl/shader/fill_outline_pattern_shader.hpp + src/mbgl/shader/fill_outline_shader.cpp + src/mbgl/shader/fill_outline_shader.hpp + src/mbgl/shader/fill_pattern_shader.cpp + src/mbgl/shader/fill_pattern_shader.hpp + src/mbgl/shader/fill_shader.cpp + src/mbgl/shader/fill_shader.hpp + src/mbgl/shader/fill_vertex.cpp + src/mbgl/shader/fill_vertex.hpp + src/mbgl/shader/line_pattern_shader.cpp + src/mbgl/shader/line_pattern_shader.hpp + src/mbgl/shader/line_sdf_shader.cpp + src/mbgl/shader/line_sdf_shader.hpp src/mbgl/shader/line_shader.cpp src/mbgl/shader/line_shader.hpp src/mbgl/shader/line_vertex.cpp src/mbgl/shader/line_vertex.hpp - src/mbgl/shader/linepattern_shader.cpp - src/mbgl/shader/linepattern_shader.hpp - src/mbgl/shader/linesdf_shader.cpp - src/mbgl/shader/linesdf_shader.hpp - src/mbgl/shader/outline_shader.cpp - src/mbgl/shader/outline_shader.hpp - src/mbgl/shader/outlinepattern_shader.cpp - src/mbgl/shader/outlinepattern_shader.hpp - src/mbgl/shader/pattern_shader.cpp - src/mbgl/shader/pattern_shader.hpp - src/mbgl/shader/plain_shader.cpp - src/mbgl/shader/plain_shader.hpp - src/mbgl/shader/plain_vertex.cpp - src/mbgl/shader/plain_vertex.hpp src/mbgl/shader/raster_shader.cpp src/mbgl/shader/raster_shader.hpp src/mbgl/shader/raster_vertex.cpp src/mbgl/shader/raster_vertex.hpp - src/mbgl/shader/sdf_shader.cpp - src/mbgl/shader/sdf_shader.hpp src/mbgl/shader/shaders.hpp + src/mbgl/shader/symbol_icon_shader.cpp + src/mbgl/shader/symbol_icon_shader.hpp + src/mbgl/shader/symbol_sdf_shader.cpp + src/mbgl/shader/symbol_sdf_shader.hpp src/mbgl/shader/symbol_vertex.cpp src/mbgl/shader/symbol_vertex.hpp diff --git a/src/mbgl/renderer/debug_bucket.cpp b/src/mbgl/renderer/debug_bucket.cpp index 072cf3ca552..c47ae434beb 100644 --- a/src/mbgl/renderer/debug_bucket.cpp +++ b/src/mbgl/renderer/debug_bucket.cpp @@ -1,7 +1,7 @@ #include #include -#include -#include +#include +#include #include #include @@ -13,13 +13,13 @@ namespace mbgl { -std::vector buildTextVertices(const OverscaledTileID& id, +std::vector buildTextVertices(const OverscaledTileID& id, const bool renderable, const bool complete, optional modified, optional expires, MapDebugOptions debugMode) { - std::vector textPoints; + std::vector textPoints; auto addText = [&] (const std::string& text, double left, double baseline, double scale) { for (uint8_t c : text) { @@ -85,14 +85,14 @@ DebugBucket::DebugBucket(const OverscaledTileID& id, vertexBuffer(context.createVertexBuffer(buildTextVertices(id, renderable_, complete_, modified_, expires_, debugMode_))) { } -void DebugBucket::drawLines(PlainShader& shader, gl::Context& context) { +void DebugBucket::drawLines(FillShader& shader, gl::Context& context) { 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) { +void DebugBucket::drawPoints(FillShader& shader, gl::Context& context) { 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 9ba2525d9ce..89087f00105 100644 --- a/src/mbgl/renderer/debug_bucket.hpp +++ b/src/mbgl/renderer/debug_bucket.hpp @@ -7,12 +7,12 @@ #include #include #include -#include +#include namespace mbgl { class OverscaledTileID; -class PlainShader; +class FillShader; namespace gl { class Context; @@ -28,8 +28,8 @@ class DebugBucket : private util::noncopyable { MapDebugOptions, gl::Context&); - void drawLines(PlainShader&, gl::Context&); - void drawPoints(PlainShader&, gl::Context&); + void drawLines(FillShader&, gl::Context&); + void drawPoints(FillShader&, gl::Context&); const bool renderable; const bool complete; @@ -38,7 +38,7 @@ class DebugBucket : private util::noncopyable { const MapDebugOptions debugMode; private: - gl::VertexBuffer vertexBuffer; + gl::VertexBuffer vertexBuffer; gl::VertexArrayObject array; }; diff --git a/src/mbgl/renderer/fill_bucket.cpp b/src/mbgl/renderer/fill_bucket.cpp index f570d59743e..cd4277cabc4 100644 --- a/src/mbgl/renderer/fill_bucket.cpp +++ b/src/mbgl/renderer/fill_bucket.cpp @@ -1,10 +1,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -121,7 +121,7 @@ bool FillBucket::needsClipping() const { return true; } -void FillBucket::drawElements(PlainShader& shader, +void FillBucket::drawElements(FillShader& shader, gl::Context& context, PaintMode paintMode) { GLbyte* vertex_index = BUFFER_OFFSET(0); @@ -136,7 +136,7 @@ void FillBucket::drawElements(PlainShader& shader, } } -void FillBucket::drawElements(PatternShader& shader, +void FillBucket::drawElements(FillPatternShader& shader, gl::Context& context, PaintMode paintMode) { GLbyte* vertex_index = BUFFER_OFFSET(0); @@ -151,7 +151,7 @@ void FillBucket::drawElements(PatternShader& shader, } } -void FillBucket::drawVertices(OutlineShader& shader, +void FillBucket::drawVertices(FillOutlineShader& shader, gl::Context& context, PaintMode paintMode) { GLbyte* vertex_index = BUFFER_OFFSET(0); @@ -166,7 +166,7 @@ void FillBucket::drawVertices(OutlineShader& shader, } } -void FillBucket::drawVertices(OutlinePatternShader& shader, +void FillBucket::drawVertices(FillOutlinePatternShader& shader, gl::Context& context, PaintMode paintMode) { GLbyte* vertex_index = BUFFER_OFFSET(0); diff --git a/src/mbgl/renderer/fill_bucket.hpp b/src/mbgl/renderer/fill_bucket.hpp index 2ec9fc0e5b1..34cd8866870 100644 --- a/src/mbgl/renderer/fill_bucket.hpp +++ b/src/mbgl/renderer/fill_bucket.hpp @@ -5,17 +5,17 @@ #include #include #include -#include +#include #include #include namespace mbgl { -class OutlinePatternShader; -class PlainShader; -class PatternShader; -class OutlineShader; +class FillShader; +class FillPatternShader; +class FillOutlineShader; +class FillOutlinePatternShader; class FillBucket : public Bucket { public: @@ -29,20 +29,20 @@ class FillBucket : public Bucket { void addGeometry(const GeometryCollection&); - void drawElements(PlainShader&, gl::Context&, PaintMode); - void drawElements(PatternShader&, gl::Context&, PaintMode); - void drawVertices(OutlineShader&, gl::Context&, PaintMode); - void drawVertices(OutlinePatternShader&, gl::Context&, PaintMode); + void drawElements(FillShader&, gl::Context&, PaintMode); + void drawElements(FillPatternShader&, gl::Context&, PaintMode); + void drawVertices(FillOutlineShader&, gl::Context&, PaintMode); + void drawVertices(FillOutlinePatternShader&, gl::Context&, PaintMode); private: - std::vector vertices; + std::vector vertices; std::vector lines; std::vector triangles; - std::vector> lineGroups; - std::vector> triangleGroups; + std::vector> lineGroups; + std::vector> triangleGroups; - optional> vertexBuffer; + optional> vertexBuffer; optional> lineIndexBuffer; optional> triangleIndexBuffer; }; diff --git a/src/mbgl/renderer/line_bucket.cpp b/src/mbgl/renderer/line_bucket.cpp index 6ec265d7270..7a5309bafc9 100644 --- a/src/mbgl/renderer/line_bucket.cpp +++ b/src/mbgl/renderer/line_bucket.cpp @@ -2,8 +2,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -493,7 +493,7 @@ void LineBucket::drawLineSDF(LineSDFShader& shader, } } -void LineBucket::drawLinePatterns(LinepatternShader& shader, +void LineBucket::drawLinePatterns(LinePatternShader& shader, gl::Context& context, PaintMode paintMode) { GLbyte* vertex_index = BUFFER_OFFSET(0); diff --git a/src/mbgl/renderer/line_bucket.hpp b/src/mbgl/renderer/line_bucket.hpp index ca07c345da4..14af710877e 100644 --- a/src/mbgl/renderer/line_bucket.hpp +++ b/src/mbgl/renderer/line_bucket.hpp @@ -14,7 +14,7 @@ namespace mbgl { class LineShader; class LineSDFShader; -class LinepatternShader; +class LinePatternShader; class LineBucket : public Bucket { @@ -32,7 +32,7 @@ class LineBucket : public Bucket { void drawLines(LineShader&, gl::Context&, PaintMode); void drawLineSDF(LineSDFShader&, gl::Context&, PaintMode); - void drawLinePatterns(LinepatternShader&, gl::Context&, PaintMode); + void drawLinePatterns(LinePatternShader&, gl::Context&, PaintMode); private: struct TriangleElement { @@ -53,7 +53,7 @@ class LineBucket : public Bucket { std::vector vertices; std::vector triangles; - std::vector> groups; + std::vector> groups; optional> vertexBuffer; optional> indexBuffer; diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp index cc0724d62ab..ad0e75cd925 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_), - tileTriangleVertexBuffer(context.createVertexBuffer(std::vector {{ + tileTriangleVertexBuffer(context.createVertexBuffer(std::vector {{ { 0, 0 }, { util::EXTENT, 0 }, { 0, util::EXTENT }, @@ -48,7 +48,7 @@ Painter::Painter(const TransformState& state_) { 0, util::EXTENT }, { util::EXTENT, util::EXTENT } }})), - tileLineStripVertexBuffer(context.createVertexBuffer(std::vector {{ + tileLineStripVertexBuffer(context.createVertexBuffer(std::vector {{ { 0, 0 }, { util::EXTENT, 0 }, { util::EXTENT, util::EXTENT }, diff --git a/src/mbgl/renderer/painter.hpp b/src/mbgl/renderer/painter.hpp index bfa893f28ea..28aa5aab440 100644 --- a/src/mbgl/renderer/painter.hpp +++ b/src/mbgl/renderer/painter.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -41,7 +41,7 @@ class SymbolBucket; class RasterBucket; class Shaders; -class SDFShader; +class SymbolSDFShader; class PaintParameters; struct ClipID; @@ -121,8 +121,8 @@ class Painter : private util::noncopyable { const RenderTile&, float scaleDivisor, std::array texsize, - SDFShader& sdfShader, - void (SymbolBucket::*drawSDF)(SDFShader&, gl::Context&, PaintMode), + SymbolSDFShader& sdfShader, + void (SymbolBucket::*drawSDF)(SymbolSDFShader&, gl::Context&, PaintMode), // Layout style::AlignmentType rotationAlignment, @@ -188,8 +188,8 @@ class Painter : private util::noncopyable { std::unique_ptr overdrawShaders; #endif - gl::VertexBuffer tileTriangleVertexBuffer; - gl::VertexBuffer tileLineStripVertexBuffer; + 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 49efbef2860..61ec76d1d83 100644 --- a/src/mbgl/renderer/painter_background.cpp +++ b/src/mbgl/renderer/painter_background.cpp @@ -22,8 +22,8 @@ void Painter::renderBackground(PaintParameters& parameters, const BackgroundLaye optional imagePosA; optional imagePosB; - auto& patternShader = parameters.shaders.pattern; - auto& plainShader = parameters.shaders.plain; + auto& patternShader = parameters.shaders.fillPattern; + auto& plainShader = parameters.shaders.fill; auto& arrayBackgroundPattern = parameters.shaders.backgroundPatternArray; auto& arrayBackground = parameters.shaders.backgroundArray; diff --git a/src/mbgl/renderer/painter_clipping.cpp b/src/mbgl/renderer/painter_clipping.cpp index b585c03b4ae..68f580c2801 100644 --- a/src/mbgl/renderer/painter_clipping.cpp +++ b/src/mbgl/renderer/painter_clipping.cpp @@ -14,7 +14,7 @@ namespace mbgl { void Painter::drawClippingMasks(PaintParameters& parameters, const std::map& stencils) { MBGL_DEBUG_GROUP("clipping masks"); - auto& plainShader = parameters.shaders.plain; + auto& plainShader = parameters.shaders.fill; auto& arrayCoveringPlain = parameters.shaders.coveringPlainArray; mat4 matrix; diff --git a/src/mbgl/renderer/painter_debug.cpp b/src/mbgl/renderer/painter_debug.cpp index 60300d5620f..23a2a8e571e 100644 --- a/src/mbgl/renderer/painter_debug.cpp +++ b/src/mbgl/renderer/painter_debug.cpp @@ -38,7 +38,7 @@ void Painter::renderDebugText(Tile& tile, const mat4 &matrix) { tile.expires, frame.debugOptions, context); } - auto& plainShader = shaders->plain; + auto& plainShader = shaders->fill; context.program = plainShader.getID(); plainShader.u_matrix = matrix; plainShader.u_opacity = 1.0f; @@ -74,7 +74,7 @@ void Painter::renderDebugFrame(const mat4 &matrix) { gl::StencilTestOperation::Replace }; context.stencilTest = true; - auto& plainShader = shaders->plain; + auto& plainShader = shaders->fill; context.program = plainShader.getID(); plainShader.u_matrix = matrix; plainShader.u_opacity = 1.0f; diff --git a/src/mbgl/renderer/painter_fill.cpp b/src/mbgl/renderer/painter_fill.cpp index 6d6ae4df61a..50ead900f64 100644 --- a/src/mbgl/renderer/painter_fill.cpp +++ b/src/mbgl/renderer/painter_fill.cpp @@ -43,10 +43,10 @@ void Painter::renderFill(PaintParameters& parameters, context.depthMask = true; context.lineWidth = 2.0f; // This is always fixed and does not depend on the pixelRatio! - auto& outlineShader = parameters.shaders.outline; - auto& patternShader = parameters.shaders.pattern; - auto& outlinePatternShader = parameters.shaders.outlinePattern; - auto& plainShader = parameters.shaders.plain; + auto& outlineShader = parameters.shaders.fillOutline; + auto& patternShader = parameters.shaders.fillPattern; + auto& outlinePatternShader = parameters.shaders.fillOutlinePattern; + auto& plainShader = parameters.shaders.fill; // Because we're drawing top-to-bottom, and we update the stencil mask // befrom, we have to draw the outline first (!) diff --git a/src/mbgl/renderer/painter_line.cpp b/src/mbgl/renderer/painter_line.cpp index ee749746b96..85a5786353f 100644 --- a/src/mbgl/renderer/painter_line.cpp +++ b/src/mbgl/renderer/painter_line.cpp @@ -57,8 +57,8 @@ void Painter::renderLine(PaintParameters& parameters, setDepthSublayer(0); - auto& linesdfShader = parameters.shaders.linesdf; - auto& linepatternShader = parameters.shaders.linepattern; + auto& linesdfShader = parameters.shaders.lineSDF; + auto& linepatternShader = parameters.shaders.linePattern; auto& lineShader = parameters.shaders.line; if (!properties.lineDasharray.value.from.empty()) { diff --git a/src/mbgl/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp index a91329d0031..ca77215618e 100644 --- a/src/mbgl/renderer/painter_symbol.cpp +++ b/src/mbgl/renderer/painter_symbol.cpp @@ -19,8 +19,8 @@ void Painter::renderSDF(SymbolBucket& bucket, const RenderTile& tile, float sdfFontSize, std::array texsize, - SDFShader& sdfShader, - void (SymbolBucket::*drawSDF)(SDFShader&, gl::Context&, PaintMode), + SymbolSDFShader& sdfShader, + void (SymbolBucket::*drawSDF)(SymbolSDFShader&, gl::Context&, PaintMode), // Layout AlignmentType rotationAlignment, @@ -168,7 +168,7 @@ void Painter::renderSymbol(PaintParameters& parameters, tile, 1.0f, {{ float(activeSpriteAtlas->getWidth()) / 4.0f, float(activeSpriteAtlas->getHeight()) / 4.0f }}, - parameters.shaders.sdfIcon, + parameters.shaders.symbolIconSDF, &SymbolBucket::drawIcons, layout.iconRotationAlignment, // icon-pitch-alignment is not yet implemented @@ -200,7 +200,7 @@ void Painter::renderSymbol(PaintParameters& parameters, }}; } - auto& iconShader = parameters.shaders.icon; + auto& iconShader = parameters.shaders.symbolIcon; context.program = iconShader.getID(); iconShader.u_matrix = vtxMatrix; @@ -235,7 +235,7 @@ void Painter::renderSymbol(PaintParameters& parameters, tile, 24.0f, {{ float(glyphAtlas->width) / 4, float(glyphAtlas->height) / 4 }}, - parameters.shaders.sdfGlyph, + parameters.shaders.symbolGlyph, &SymbolBucket::drawGlyphs, layout.textRotationAlignment, layout.textPitchAlignment, diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp index ba064e4cc35..565c58c7ed0 100644 --- a/src/mbgl/renderer/symbol_bucket.cpp +++ b/src/mbgl/renderer/symbol_bucket.cpp @@ -1,8 +1,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -66,7 +66,7 @@ bool SymbolBucket::needsClipping() const { return mode == MapMode::Still; } -void SymbolBucket::drawGlyphs(SDFShader& shader, +void SymbolBucket::drawGlyphs(SymbolSDFShader& shader, gl::Context& context, PaintMode paintMode) { GLbyte* vertex_index = BUFFER_OFFSET_0; @@ -81,7 +81,7 @@ void SymbolBucket::drawGlyphs(SDFShader& shader, } } -void SymbolBucket::drawIcons(SDFShader& shader, +void SymbolBucket::drawIcons(SymbolSDFShader& shader, gl::Context& context, PaintMode paintMode) { GLbyte* vertex_index = BUFFER_OFFSET_0; @@ -96,7 +96,7 @@ void SymbolBucket::drawIcons(SDFShader& shader, } } -void SymbolBucket::drawIcons(IconShader& shader, +void SymbolBucket::drawIcons(SymbolIconShader& shader, gl::Context& context, PaintMode paintMode) { GLbyte* vertex_index = BUFFER_OFFSET_0; diff --git a/src/mbgl/renderer/symbol_bucket.hpp b/src/mbgl/renderer/symbol_bucket.hpp index 33315ada37e..e5180c31e28 100644 --- a/src/mbgl/renderer/symbol_bucket.hpp +++ b/src/mbgl/renderer/symbol_bucket.hpp @@ -15,8 +15,8 @@ namespace mbgl { -class SDFShader; -class IconShader; +class SymbolSDFShader; +class SymbolIconShader; class CollisionBoxShader; class SymbolBucket : public Bucket { @@ -34,9 +34,9 @@ class SymbolBucket : public Bucket { bool hasCollisionBoxData() const; bool needsClipping() const override; - void drawGlyphs(SDFShader&, gl::Context&, PaintMode); - void drawIcons(SDFShader&, gl::Context&, PaintMode); - void drawIcons(IconShader&, gl::Context&, PaintMode); + void drawGlyphs(SymbolSDFShader&, gl::Context&, PaintMode); + void drawIcons(SymbolSDFShader&, gl::Context&, PaintMode); + void drawIcons(SymbolIconShader&, gl::Context&, PaintMode); void drawCollisionBoxes(CollisionBoxShader&, gl::Context&); const MapMode mode; @@ -50,7 +50,7 @@ class SymbolBucket : public Bucket { struct TextBuffer { std::vector vertices; std::vector triangles; - std::vector> groups; + std::vector> groups; optional> vertexBuffer; optional> indexBuffer; @@ -59,7 +59,7 @@ class SymbolBucket : public Bucket { struct IconBuffer { std::vector vertices; std::vector triangles; - std::vector> groups; + std::vector> groups; optional> vertexBuffer; optional> indexBuffer; diff --git a/src/mbgl/shader/outlinepattern_shader.cpp b/src/mbgl/shader/fill_outline_pattern_shader.cpp similarity index 62% rename from src/mbgl/shader/outlinepattern_shader.cpp rename to src/mbgl/shader/fill_outline_pattern_shader.cpp index 1b2c4ac8947..c41fda27fbe 100644 --- a/src/mbgl/shader/outlinepattern_shader.cpp +++ b/src/mbgl/shader/fill_outline_pattern_shader.cpp @@ -1,11 +1,11 @@ -#include +#include #include #include -#include +#include namespace mbgl { -OutlinePatternShader::OutlinePatternShader(gl::Context& context, Defines defines) +FillOutlinePatternShader::FillOutlinePatternShader(gl::Context& context, Defines defines) : Shader(shaders::outlinepattern::name, shaders::outlinepattern::vertex, shaders::outlinepattern::fragment, diff --git a/src/mbgl/shader/outlinepattern_shader.hpp b/src/mbgl/shader/fill_outline_pattern_shader.hpp similarity index 91% rename from src/mbgl/shader/outlinepattern_shader.hpp rename to src/mbgl/shader/fill_outline_pattern_shader.hpp index 9e9c47e7a98..630e6a7ce8c 100644 --- a/src/mbgl/shader/outlinepattern_shader.hpp +++ b/src/mbgl/shader/fill_outline_pattern_shader.hpp @@ -6,13 +6,13 @@ namespace mbgl { -class PlainVertex; +class FillVertex; -class OutlinePatternShader : public gl::Shader { +class FillOutlinePatternShader : public gl::Shader { public: - OutlinePatternShader(gl::Context&, Defines defines = None); + FillOutlinePatternShader(gl::Context&, Defines defines = None); - using VertexType = PlainVertex; + using VertexType = FillVertex; gl::Attribute a_pos = {"a_pos", *this}; diff --git a/src/mbgl/shader/outline_shader.cpp b/src/mbgl/shader/fill_outline_shader.cpp similarity index 63% rename from src/mbgl/shader/outline_shader.cpp rename to src/mbgl/shader/fill_outline_shader.cpp index 5566a343e3a..e14004a6bd0 100644 --- a/src/mbgl/shader/outline_shader.cpp +++ b/src/mbgl/shader/fill_outline_shader.cpp @@ -1,11 +1,11 @@ -#include +#include #include #include -#include +#include namespace mbgl { -OutlineShader::OutlineShader(gl::Context& context, Defines defines) +FillOutlineShader::FillOutlineShader(gl::Context& context, Defines defines) : Shader(shaders::outline::name, shaders::outline::vertex, shaders::outline::fragment, diff --git a/src/mbgl/shader/outline_shader.hpp b/src/mbgl/shader/fill_outline_shader.hpp similarity index 78% rename from src/mbgl/shader/outline_shader.hpp rename to src/mbgl/shader/fill_outline_shader.hpp index f9a34568647..c20bc187d3a 100644 --- a/src/mbgl/shader/outline_shader.hpp +++ b/src/mbgl/shader/fill_outline_shader.hpp @@ -7,13 +7,13 @@ namespace mbgl { -class PlainVertex; +class FillVertex; -class OutlineShader : public gl::Shader { +class FillOutlineShader : public gl::Shader { public: - OutlineShader(gl::Context&, Defines defines = None); + FillOutlineShader(gl::Context&, Defines defines = None); - using VertexType = PlainVertex; + using VertexType = FillVertex; gl::Attribute a_pos = {"a_pos", *this}; diff --git a/src/mbgl/shader/pattern_shader.cpp b/src/mbgl/shader/fill_pattern_shader.cpp similarity index 63% rename from src/mbgl/shader/pattern_shader.cpp rename to src/mbgl/shader/fill_pattern_shader.cpp index 89600bb54db..2cdfbc79406 100644 --- a/src/mbgl/shader/pattern_shader.cpp +++ b/src/mbgl/shader/fill_pattern_shader.cpp @@ -1,11 +1,11 @@ -#include +#include #include #include -#include +#include namespace mbgl { -PatternShader::PatternShader(gl::Context& context, Defines defines) +FillPatternShader::FillPatternShader(gl::Context& context, Defines defines) : Shader(shaders::pattern::name, shaders::pattern::vertex, shaders::pattern::fragment, diff --git a/src/mbgl/shader/pattern_shader.hpp b/src/mbgl/shader/fill_pattern_shader.hpp similarity index 91% rename from src/mbgl/shader/pattern_shader.hpp rename to src/mbgl/shader/fill_pattern_shader.hpp index 8d06bb2962d..36be5380007 100644 --- a/src/mbgl/shader/pattern_shader.hpp +++ b/src/mbgl/shader/fill_pattern_shader.hpp @@ -6,13 +6,13 @@ namespace mbgl { -class PlainVertex; +class FillVertex; -class PatternShader : public gl::Shader { +class FillPatternShader : public gl::Shader { public: - PatternShader(gl::Context&, Defines defines = None); + FillPatternShader(gl::Context&, Defines defines = None); - using VertexType = PlainVertex; + using VertexType = FillVertex; gl::Attribute a_pos = {"a_pos", *this}; diff --git a/src/mbgl/shader/plain_shader.cpp b/src/mbgl/shader/fill_shader.cpp similarity index 64% rename from src/mbgl/shader/plain_shader.cpp rename to src/mbgl/shader/fill_shader.cpp index 03ba9a4c8f0..7026bb2f1c4 100644 --- a/src/mbgl/shader/plain_shader.cpp +++ b/src/mbgl/shader/fill_shader.cpp @@ -1,11 +1,11 @@ -#include +#include #include #include -#include +#include namespace mbgl { -PlainShader::PlainShader(gl::Context& context, Defines defines) +FillShader::FillShader(gl::Context& context, Defines defines) : Shader(shaders::fill::name, shaders::fill::vertex, shaders::fill::fragment, diff --git a/src/mbgl/shader/plain_shader.hpp b/src/mbgl/shader/fill_shader.hpp similarity index 74% rename from src/mbgl/shader/plain_shader.hpp rename to src/mbgl/shader/fill_shader.hpp index b7173d0943e..1240b73aa2f 100644 --- a/src/mbgl/shader/plain_shader.hpp +++ b/src/mbgl/shader/fill_shader.hpp @@ -7,13 +7,13 @@ namespace mbgl { -class PlainVertex; +class FillVertex; -class PlainShader : public gl::Shader { +class FillShader : public gl::Shader { public: - PlainShader(gl::Context&, Defines defines = None); + FillShader(gl::Context&, Defines defines = None); - using VertexType = PlainVertex; + using VertexType = FillVertex; gl::Attribute a_pos = {"a_pos", *this}; diff --git a/src/mbgl/shader/fill_vertex.cpp b/src/mbgl/shader/fill_vertex.cpp new file mode 100644 index 00000000000..c39a0b96b10 --- /dev/null +++ b/src/mbgl/shader/fill_vertex.cpp @@ -0,0 +1,7 @@ +#include + +namespace mbgl { + +static_assert(sizeof(FillVertex) == 4, "expected FillVertex size"); + +} // namespace mbgl diff --git a/src/mbgl/shader/plain_vertex.hpp b/src/mbgl/shader/fill_vertex.hpp similarity index 67% rename from src/mbgl/shader/plain_vertex.hpp rename to src/mbgl/shader/fill_vertex.hpp index 0d164d12676..1b8130382a5 100644 --- a/src/mbgl/shader/plain_vertex.hpp +++ b/src/mbgl/shader/fill_vertex.hpp @@ -7,9 +7,9 @@ namespace mbgl { -class PlainVertex { +class FillVertex { public: - PlainVertex(int16_t x, int16_t y) + FillVertex(int16_t x, int16_t y) : a_pos { x, y } {} const int16_t a_pos[2]; @@ -18,10 +18,10 @@ class PlainVertex { namespace gl { template -struct AttributeBindings { +struct AttributeBindings { std::array operator()(const Shader& shader) { return {{ - MBGL_MAKE_ATTRIBUTE_BINDING(PlainVertex, shader, a_pos) + MBGL_MAKE_ATTRIBUTE_BINDING(FillVertex, shader, a_pos) }}; }; }; diff --git a/src/mbgl/shader/linepattern_shader.cpp b/src/mbgl/shader/line_pattern_shader.cpp similarity index 75% rename from src/mbgl/shader/linepattern_shader.cpp rename to src/mbgl/shader/line_pattern_shader.cpp index 0f3fb415ac0..bf091a7e86e 100644 --- a/src/mbgl/shader/linepattern_shader.cpp +++ b/src/mbgl/shader/line_pattern_shader.cpp @@ -1,11 +1,11 @@ -#include +#include #include #include #include namespace mbgl { -LinepatternShader::LinepatternShader(gl::Context& context, Defines defines) +LinePatternShader::LinePatternShader(gl::Context& context, Defines defines) : Shader(shaders::linepattern::name, shaders::linepattern::vertex, shaders::linepattern::fragment, diff --git a/src/mbgl/shader/linepattern_shader.hpp b/src/mbgl/shader/line_pattern_shader.hpp similarity index 95% rename from src/mbgl/shader/linepattern_shader.hpp rename to src/mbgl/shader/line_pattern_shader.hpp index 22ee32564fe..1bd6085c8b1 100644 --- a/src/mbgl/shader/linepattern_shader.hpp +++ b/src/mbgl/shader/line_pattern_shader.hpp @@ -8,9 +8,9 @@ namespace mbgl { class LineVertex; -class LinepatternShader : public gl::Shader { +class LinePatternShader : public gl::Shader { public: - LinepatternShader(gl::Context&, Defines defines = None); + LinePatternShader(gl::Context&, Defines defines = None); using VertexType = LineVertex; diff --git a/src/mbgl/shader/linesdf_shader.cpp b/src/mbgl/shader/line_sdf_shader.cpp similarity index 90% rename from src/mbgl/shader/linesdf_shader.cpp rename to src/mbgl/shader/line_sdf_shader.cpp index 507c0f9499a..11583d716b5 100644 --- a/src/mbgl/shader/linesdf_shader.cpp +++ b/src/mbgl/shader/line_sdf_shader.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/mbgl/shader/linesdf_shader.hpp b/src/mbgl/shader/line_sdf_shader.hpp similarity index 100% rename from src/mbgl/shader/linesdf_shader.hpp rename to src/mbgl/shader/line_sdf_shader.hpp diff --git a/src/mbgl/shader/plain_vertex.cpp b/src/mbgl/shader/plain_vertex.cpp deleted file mode 100644 index 5f0c71497a2..00000000000 --- a/src/mbgl/shader/plain_vertex.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -namespace mbgl { - -static_assert(sizeof(PlainVertex) == 4, "expected PlainVertex size"); - -} // namespace mbgl diff --git a/src/mbgl/shader/shaders.hpp b/src/mbgl/shader/shaders.hpp index b263ee8d0ea..937ee85f44f 100644 --- a/src/mbgl/shader/shaders.hpp +++ b/src/mbgl/shader/shaders.hpp @@ -1,51 +1,53 @@ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include #include -#include +#include +#include + #include -#include namespace mbgl { class Shaders { public: Shaders(gl::Context& context, gl::Shader::Defines defines = gl::Shader::None) - : plain(context, defines), - outline(context, defines), - outlinePattern(context, defines), + : circle(context, defines), + fill(context, defines), + fillPattern(context, defines), + fillOutline(context, defines), + fillOutlinePattern(context, defines), line(context, defines), - linesdf(context, defines), - linepattern(context, defines), - pattern(context, defines), - icon(context, defines), + lineSDF(context, defines), + linePattern(context, defines), raster(context, defines), - sdfGlyph(context, defines), - sdfIcon(context, defines), - collisionBox(context), - circle(context, defines) { + symbolIcon(context, defines), + symbolIconSDF(context, defines), + symbolGlyph(context, defines), + collisionBox(context) { } - PlainShader plain; - OutlineShader outline; - OutlinePatternShader outlinePattern; + CircleShader circle; + FillShader fill; + FillPatternShader fillPattern; + FillOutlineShader fillOutline; + FillOutlinePatternShader fillOutlinePattern; LineShader line; - LineSDFShader linesdf; - LinepatternShader linepattern; - PatternShader pattern; - IconShader icon; + LineSDFShader lineSDF; + LinePatternShader linePattern; RasterShader raster; - SDFShader sdfGlyph; - SDFShader sdfIcon; + SymbolIconShader symbolIcon; + SymbolSDFShader symbolIconSDF; + SymbolSDFShader symbolGlyph; + CollisionBoxShader collisionBox; - CircleShader circle; gl::VertexArrayObject coveringPlainArray; gl::VertexArrayObject coveringRasterArray; diff --git a/src/mbgl/shader/icon_shader.cpp b/src/mbgl/shader/symbol_icon_shader.cpp similarity index 71% rename from src/mbgl/shader/icon_shader.cpp rename to src/mbgl/shader/symbol_icon_shader.cpp index 633e88a9de8..f0ca648c2af 100644 --- a/src/mbgl/shader/icon_shader.cpp +++ b/src/mbgl/shader/symbol_icon_shader.cpp @@ -1,11 +1,11 @@ -#include +#include #include #include #include namespace mbgl { -IconShader::IconShader(gl::Context& context, Defines defines) +SymbolIconShader::SymbolIconShader(gl::Context& context, Defines defines) : Shader(shaders::icon::name, shaders::icon::vertex, shaders::icon::fragment, diff --git a/src/mbgl/shader/icon_shader.hpp b/src/mbgl/shader/symbol_icon_shader.hpp similarity index 92% rename from src/mbgl/shader/icon_shader.hpp rename to src/mbgl/shader/symbol_icon_shader.hpp index c575b624287..5281beb60cb 100644 --- a/src/mbgl/shader/icon_shader.hpp +++ b/src/mbgl/shader/symbol_icon_shader.hpp @@ -8,9 +8,9 @@ namespace mbgl { class SymbolVertex; -class IconShader : public gl::Shader { +class SymbolIconShader : public gl::Shader { public: - IconShader(gl::Context&, Defines defines = None); + SymbolIconShader(gl::Context&, Defines defines = None); using VertexType = SymbolVertex; diff --git a/src/mbgl/shader/sdf_shader.cpp b/src/mbgl/shader/symbol_sdf_shader.cpp similarity index 71% rename from src/mbgl/shader/sdf_shader.cpp rename to src/mbgl/shader/symbol_sdf_shader.cpp index faf6e369aa3..ab50fde2785 100644 --- a/src/mbgl/shader/sdf_shader.cpp +++ b/src/mbgl/shader/symbol_sdf_shader.cpp @@ -1,11 +1,11 @@ -#include +#include #include #include #include namespace mbgl { -SDFShader::SDFShader(gl::Context& context, Defines defines) +SymbolSDFShader::SymbolSDFShader(gl::Context& context, Defines defines) : Shader(shaders::sdf::name, shaders::sdf::vertex, shaders::sdf::fragment, diff --git a/src/mbgl/shader/sdf_shader.hpp b/src/mbgl/shader/symbol_sdf_shader.hpp similarity index 94% rename from src/mbgl/shader/sdf_shader.hpp rename to src/mbgl/shader/symbol_sdf_shader.hpp index ea69258e610..8d3b3df939a 100644 --- a/src/mbgl/shader/sdf_shader.hpp +++ b/src/mbgl/shader/symbol_sdf_shader.hpp @@ -9,9 +9,9 @@ namespace mbgl { class SymbolVertex; -class SDFShader : public gl::Shader { +class SymbolSDFShader : public gl::Shader { public: - SDFShader(gl::Context&, Defines defines = None); + SymbolSDFShader(gl::Context&, Defines defines = None); using VertexType = SymbolVertex;