diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-10-04 15:10:16 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-10-05 10:52:19 -0700 |
commit | da4527cd3aa4feedd2ad8e795e4c8fd4ddcd2267 (patch) | |
tree | 6103aa76ed80ce651fc8fdaf483fa64faf2fbbb9 | |
parent | 9cf57e7142f0e7b599de0f851cd6178d5a6a4c25 (diff) | |
download | qtlocation-mapboxgl-da4527cd3aa4feedd2ad8e795e4c8fd4ddcd2267.tar.gz |
[core] TextureRectVertex ⇢ SymbolVertex
-rw-r--r-- | cmake/core-files.cmake | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/symbol_bucket.hpp | 10 | ||||
-rw-r--r-- | src/mbgl/shader/icon_shader.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/shader/icon_shader.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/shader/sdf_shader.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/shader/sdf_shader.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/shader/symbol_vertex.cpp | 9 | ||||
-rw-r--r-- | src/mbgl/shader/symbol_vertex.hpp (renamed from src/mbgl/shader/texture_rect_vertex.hpp) | 15 | ||||
-rw-r--r-- | src/mbgl/shader/texture_rect_vertex.cpp | 9 |
9 files changed, 29 insertions, 30 deletions
diff --git a/cmake/core-files.cmake b/cmake/core-files.cmake index e519c8f1ca..240571edbb 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 6fb61f7b00..33315ada37 100644 --- a/src/mbgl/renderer/symbol_bucket.hpp +++ b/src/mbgl/renderer/symbol_bucket.hpp @@ -5,7 +5,7 @@ #include <mbgl/map/mode.hpp> #include <mbgl/gl/vertex_buffer.hpp> #include <mbgl/gl/index_buffer.hpp> -#include <mbgl/shader/texture_rect_vertex.hpp> +#include <mbgl/shader/symbol_vertex.hpp> #include <mbgl/shader/collision_box_vertex.hpp> #include <mbgl/text/glyph_range.hpp> #include <mbgl/style/layers/symbol_layer_properties.hpp> @@ -48,20 +48,20 @@ private: friend class SymbolLayout; struct TextBuffer { - std::vector<TextureRectVertex> vertices; + std::vector<SymbolVertex> vertices; std::vector<gl::Triangle> triangles; std::vector<ElementGroup<SDFShader>> groups; - optional<gl::VertexBuffer<TextureRectVertex>> vertexBuffer; + optional<gl::VertexBuffer<SymbolVertex>> vertexBuffer; optional<gl::IndexBuffer<gl::Triangle>> indexBuffer; } text; struct IconBuffer { - std::vector<TextureRectVertex> vertices; + std::vector<SymbolVertex> vertices; std::vector<gl::Triangle> triangles; std::vector<ElementGroup<SDFShader, IconShader>> groups; - optional<gl::VertexBuffer<TextureRectVertex>> vertexBuffer; + optional<gl::VertexBuffer<SymbolVertex>> vertexBuffer; optional<gl::IndexBuffer<gl::Triangle>> indexBuffer; } icon; diff --git a/src/mbgl/shader/icon_shader.cpp b/src/mbgl/shader/icon_shader.cpp index 5ae6e10e0f..633e88a9de 100644 --- a/src/mbgl/shader/icon_shader.cpp +++ b/src/mbgl/shader/icon_shader.cpp @@ -1,7 +1,7 @@ #include <mbgl/shader/icon_shader.hpp> #include <mbgl/shader/icon.vertex.hpp> #include <mbgl/shader/icon.fragment.hpp> -#include <mbgl/shader/texture_rect_vertex.hpp> +#include <mbgl/shader/symbol_vertex.hpp> namespace mbgl { diff --git a/src/mbgl/shader/icon_shader.hpp b/src/mbgl/shader/icon_shader.hpp index ee5a5114c7..c575b62428 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<int16_t, 2> a_pos = { "a_pos", *this }; gl::Attribute<int16_t, 2> a_offset = { "a_offset", *this }; diff --git a/src/mbgl/shader/sdf_shader.cpp b/src/mbgl/shader/sdf_shader.cpp index 73717ea9a8..faf6e369aa 100644 --- a/src/mbgl/shader/sdf_shader.cpp +++ b/src/mbgl/shader/sdf_shader.cpp @@ -1,7 +1,7 @@ #include <mbgl/shader/sdf_shader.hpp> #include <mbgl/shader/sdf.vertex.hpp> #include <mbgl/shader/sdf.fragment.hpp> -#include <mbgl/shader/texture_rect_vertex.hpp> +#include <mbgl/shader/symbol_vertex.hpp> namespace mbgl { diff --git a/src/mbgl/shader/sdf_shader.hpp b/src/mbgl/shader/sdf_shader.hpp index 68e65bbb18..ea69258e61 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<int16_t, 2> a_pos = { "a_pos", *this }; gl::Attribute<int16_t, 2> 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 0000000000..4075d749ea --- /dev/null +++ b/src/mbgl/shader/symbol_vertex.cpp @@ -0,0 +1,9 @@ +#include <mbgl/shader/symbol_vertex.hpp> +#include <mbgl/gl/shader.hpp> +#include <mbgl/gl/gl.hpp> + +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 index 4c45087c68..4eba86f946 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 @@ public: namespace gl { template <class Shader> -struct AttributeBindings<Shader, TextureRectVertex> { +struct AttributeBindings<Shader, SymbolVertex> { std::array<AttributeBinding, 4> 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 4950487b01..0000000000 --- a/src/mbgl/shader/texture_rect_vertex.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include <mbgl/shader/texture_rect_vertex.hpp> -#include <mbgl/gl/shader.hpp> -#include <mbgl/gl/gl.hpp> - -namespace mbgl { - -static_assert(sizeof(TextureRectVertex) == 16, "expected TextureRectVertex size"); - -} // namespace mbgl |