diff --git a/cmake/core-files.cmake b/cmake/core-files.cmake index e519c8f1ca6..240571edbbd 100644 --- a/cmake/core-files.cmake +++ b/cmake/core-files.cmake @@ -205,8 +205,8 @@ set(MBGL_CORE_FILES src/mbgl/shader/sdf_shader.cpp src/mbgl/shader/sdf_shader.hpp src/mbgl/shader/shaders.hpp - src/mbgl/shader/texture_rect_vertex.cpp - src/mbgl/shader/texture_rect_vertex.hpp + src/mbgl/shader/symbol_vertex.cpp + src/mbgl/shader/symbol_vertex.hpp # sprite include/mbgl/sprite/sprite_image.hpp diff --git a/src/mbgl/renderer/symbol_bucket.hpp b/src/mbgl/renderer/symbol_bucket.hpp index 6fb61f7b009..33315ada37e 100644 --- a/src/mbgl/renderer/symbol_bucket.hpp +++ b/src/mbgl/renderer/symbol_bucket.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -48,20 +48,20 @@ class SymbolBucket : public Bucket { friend class SymbolLayout; struct TextBuffer { - std::vector vertices; + std::vector vertices; std::vector triangles; std::vector> groups; - optional> vertexBuffer; + optional> vertexBuffer; optional> indexBuffer; } text; struct IconBuffer { - std::vector vertices; + std::vector vertices; std::vector triangles; std::vector> groups; - optional> vertexBuffer; + optional> vertexBuffer; optional> indexBuffer; } icon; diff --git a/src/mbgl/shader/icon_shader.cpp b/src/mbgl/shader/icon_shader.cpp index 5ae6e10e0f0..633e88a9de8 100644 --- a/src/mbgl/shader/icon_shader.cpp +++ b/src/mbgl/shader/icon_shader.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include namespace mbgl { diff --git a/src/mbgl/shader/icon_shader.hpp b/src/mbgl/shader/icon_shader.hpp index ee5a5114c7a..c575b624287 100644 --- a/src/mbgl/shader/icon_shader.hpp +++ b/src/mbgl/shader/icon_shader.hpp @@ -6,13 +6,13 @@ namespace mbgl { -class TextureRectVertex; +class SymbolVertex; class IconShader : public gl::Shader { public: IconShader(gl::Context&, Defines defines = None); - using VertexType = TextureRectVertex; + using VertexType = SymbolVertex; gl::Attribute a_pos = { "a_pos", *this }; gl::Attribute a_offset = { "a_offset", *this }; diff --git a/src/mbgl/shader/sdf_shader.cpp b/src/mbgl/shader/sdf_shader.cpp index 73717ea9a8e..faf6e369aa3 100644 --- a/src/mbgl/shader/sdf_shader.cpp +++ b/src/mbgl/shader/sdf_shader.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include namespace mbgl { diff --git a/src/mbgl/shader/sdf_shader.hpp b/src/mbgl/shader/sdf_shader.hpp index 68e65bbb185..ea69258e610 100644 --- a/src/mbgl/shader/sdf_shader.hpp +++ b/src/mbgl/shader/sdf_shader.hpp @@ -7,13 +7,13 @@ namespace mbgl { -class TextureRectVertex; +class SymbolVertex; class SDFShader : public gl::Shader { public: SDFShader(gl::Context&, Defines defines = None); - using VertexType = TextureRectVertex; + using VertexType = SymbolVertex; gl::Attribute a_pos = { "a_pos", *this }; gl::Attribute a_offset = { "a_offset", *this }; diff --git a/src/mbgl/shader/symbol_vertex.cpp b/src/mbgl/shader/symbol_vertex.cpp new file mode 100644 index 00000000000..4075d749ea3 --- /dev/null +++ b/src/mbgl/shader/symbol_vertex.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + +namespace mbgl { + +static_assert(sizeof(SymbolVertex) == 16, "expected SymbolVertex size"); + +} // namespace mbgl diff --git a/src/mbgl/shader/texture_rect_vertex.hpp b/src/mbgl/shader/symbol_vertex.hpp similarity index 62% rename from src/mbgl/shader/texture_rect_vertex.hpp rename to src/mbgl/shader/symbol_vertex.hpp index 4c45087c682..4eba86f946a 100644 --- a/src/mbgl/shader/texture_rect_vertex.hpp +++ b/src/mbgl/shader/symbol_vertex.hpp @@ -8,10 +8,9 @@ namespace mbgl { -// A vertex that holds a position, offset and texture coordinate. Used for symbol layer icons and glyphs. -class TextureRectVertex { +class SymbolVertex { public: - TextureRectVertex(int16_t x, int16_t y, float ox, float oy, uint16_t tx, uint16_t ty, float minzoom, float maxzoom, float labelminzoom, uint8_t labelangle) + SymbolVertex(int16_t x, int16_t y, float ox, float oy, uint16_t tx, uint16_t ty, float minzoom, float maxzoom, float labelminzoom, uint8_t labelangle) : a_pos { x, y @@ -40,13 +39,13 @@ class TextureRectVertex { namespace gl { template -struct AttributeBindings { +struct AttributeBindings { std::array operator()(const Shader& shader) { return {{ - MBGL_MAKE_ATTRIBUTE_BINDING(TextureRectVertex, shader, a_pos), - MBGL_MAKE_ATTRIBUTE_BINDING(TextureRectVertex, shader, a_offset), - MBGL_MAKE_ATTRIBUTE_BINDING(TextureRectVertex, shader, a_texture_pos), - MBGL_MAKE_ATTRIBUTE_BINDING(TextureRectVertex, shader, a_data) + MBGL_MAKE_ATTRIBUTE_BINDING(SymbolVertex, shader, a_pos), + MBGL_MAKE_ATTRIBUTE_BINDING(SymbolVertex, shader, a_offset), + MBGL_MAKE_ATTRIBUTE_BINDING(SymbolVertex, shader, a_texture_pos), + MBGL_MAKE_ATTRIBUTE_BINDING(SymbolVertex, shader, a_data) }}; }; }; diff --git a/src/mbgl/shader/texture_rect_vertex.cpp b/src/mbgl/shader/texture_rect_vertex.cpp deleted file mode 100644 index 4950487b016..00000000000 --- a/src/mbgl/shader/texture_rect_vertex.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include - -namespace mbgl { - -static_assert(sizeof(TextureRectVertex) == 16, "expected TextureRectVertex size"); - -} // namespace mbgl