diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-03-01 10:00:43 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-03-06 16:12:51 +0100 |
commit | 63e81b9aa8ad1a96e47a296db57e33c866315bee (patch) | |
tree | 5af815b305e67ef229984a5c2214da2985e9a2df /src/mbgl | |
parent | 500080ea6489bf7208859ed9bcfeefff16b301ad (diff) | |
download | qtlocation-mapboxgl-63e81b9aa8ad1a96e47a296db57e33c866315bee.tar.gz |
[core] move VertexVector/IndexVector to gfx namespace
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/gfx/index_vector.hpp | 50 | ||||
-rw-r--r-- | src/mbgl/gfx/vertex_vector.hpp | 50 | ||||
-rw-r--r-- | src/mbgl/gl/context.hpp | 10 | ||||
-rw-r--r-- | src/mbgl/gl/index_buffer.hpp | 27 | ||||
-rw-r--r-- | src/mbgl/gl/vertex_buffer.hpp | 26 | ||||
-rw-r--r-- | src/mbgl/layout/symbol_projection.cpp | 8 | ||||
-rw-r--r-- | src/mbgl/layout/symbol_projection.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/circle_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/debug_bucket.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/fill_bucket.hpp | 6 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/heatmap_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/hillshade_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/line_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/raster_bucket.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.hpp | 24 | ||||
-rw-r--r-- | src/mbgl/renderer/paint_property_binder.hpp | 10 | ||||
-rw-r--r-- | src/mbgl/renderer/render_static_data.cpp | 20 |
19 files changed, 156 insertions, 107 deletions
diff --git a/src/mbgl/gfx/index_vector.hpp b/src/mbgl/gfx/index_vector.hpp new file mode 100644 index 0000000000..b477c29782 --- /dev/null +++ b/src/mbgl/gfx/index_vector.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include <mbgl/util/ignore.hpp> + +#include <vector> + +namespace mbgl { +namespace gfx { + +template <class DrawMode> +class IndexVector { +public: + static constexpr std::size_t groupSize = DrawMode::bufferGroupSize; + + template <class... Args> + void emplace_back(Args&&... args) { + static_assert(sizeof...(args) == groupSize, "wrong buffer element count"); + util::ignore({ (v.emplace_back(std::forward<Args>(args)), 0)... }); + } + + std::size_t indexSize() const { + return v.size(); + } + + std::size_t byteSize() const { + return v.size() * sizeof(uint16_t); + } + + bool empty() const { + return v.empty(); + } + + void clear() { + v.clear(); + } + + const uint16_t* data() const { + return v.data(); + } + + const std::vector<uint16_t>& vector() const { + return v; + } + +private: + std::vector<uint16_t> v; +}; + +} // namespace gfx +} // namespace mbgl diff --git a/src/mbgl/gfx/vertex_vector.hpp b/src/mbgl/gfx/vertex_vector.hpp new file mode 100644 index 0000000000..5d892e9136 --- /dev/null +++ b/src/mbgl/gfx/vertex_vector.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include <mbgl/util/ignore.hpp> + +#include <vector> + +namespace mbgl { +namespace gfx { + +template <class V> +class VertexVector { +public: + using Vertex = V; + + template <class... Args> + void emplace_back(Args&&... args) { + static_assert(sizeof...(args) == 1, "wrong buffer element count"); + util::ignore({ (v.emplace_back(std::forward<Args>(args)), 0)... }); + } + + std::size_t vertexSize() const { + return v.size(); + } + + std::size_t byteSize() const { + return v.size() * sizeof(Vertex); + } + + bool empty() const { + return v.empty(); + } + + void clear() { + v.clear(); + } + + const Vertex* data() const { + return v.data(); + } + + const std::vector<Vertex>& vector() const { + return v; + } + +private: + std::vector<Vertex> v; +}; + +} // namespace gfx +} // namespace mbgl diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp index 7bc139da36..f9b075406b 100644 --- a/src/mbgl/gl/context.hpp +++ b/src/mbgl/gl/context.hpp @@ -11,6 +11,8 @@ #include <mbgl/gl/index_buffer.hpp> #include <mbgl/gl/vertex_array.hpp> #include <mbgl/gl/types.hpp> +#include <mbgl/gfx/vertex_vector.hpp> +#include <mbgl/gfx/index_vector.hpp> #include <mbgl/gfx/draw_mode.hpp> #include <mbgl/gfx/depth_mode.hpp> #include <mbgl/gfx/stencil_mode.hpp> @@ -64,7 +66,7 @@ public: optional<std::pair<BinaryProgramFormat, std::string>> getBinaryProgram(ProgramID) const; template <class Vertex> - VertexBuffer<Vertex> createVertexBuffer(VertexVector<Vertex>&& v, const BufferUsage usage = BufferUsage::StaticDraw) { + VertexBuffer<Vertex> createVertexBuffer(gfx::VertexVector<Vertex>&& v, const BufferUsage usage = BufferUsage::StaticDraw) { return VertexBuffer<Vertex> { v.vertexSize(), createVertexBuffer(v.data(), v.byteSize(), usage) @@ -72,13 +74,13 @@ public: } template <class Vertex> - void updateVertexBuffer(VertexBuffer<Vertex>& buffer, VertexVector<Vertex>&& v) { + void updateVertexBuffer(VertexBuffer<Vertex>& buffer, gfx::VertexVector<Vertex>&& v) { assert(v.vertexSize() == buffer.vertexCount); updateVertexBuffer(buffer.buffer, v.data(), v.byteSize()); } template <class DrawMode> - IndexBuffer<DrawMode> createIndexBuffer(IndexVector<DrawMode>&& v, const BufferUsage usage = BufferUsage::StaticDraw) { + IndexBuffer<DrawMode> createIndexBuffer(gfx::IndexVector<DrawMode>&& v, const BufferUsage usage = BufferUsage::StaticDraw) { return IndexBuffer<DrawMode> { v.indexSize(), createIndexBuffer(v.data(), v.byteSize(), usage) @@ -86,7 +88,7 @@ public: } template <class DrawMode> - void updateIndexBuffer(IndexBuffer<DrawMode>& buffer, IndexVector<DrawMode>&& v) { + void updateIndexBuffer(IndexBuffer<DrawMode>& buffer, gfx::IndexVector<DrawMode>&& v) { assert(v.indexSize() == buffer.indexCount); updateIndexBuffer(buffer.buffer, v.data(), v.byteSize()); } diff --git a/src/mbgl/gl/index_buffer.hpp b/src/mbgl/gl/index_buffer.hpp index 14bdcf09e7..bf20932451 100644 --- a/src/mbgl/gl/index_buffer.hpp +++ b/src/mbgl/gl/index_buffer.hpp @@ -1,38 +1,11 @@ #pragma once #include <mbgl/gl/object.hpp> -#include <mbgl/gfx/draw_mode.hpp> -#include <mbgl/util/ignore.hpp> - -#include <vector> namespace mbgl { namespace gl { template <class DrawMode> -class IndexVector { -public: - static constexpr std::size_t groupSize = DrawMode::bufferGroupSize; - - template <class... Args> - void emplace_back(Args&&... args) { - static_assert(sizeof...(args) == groupSize, "wrong buffer element count"); - util::ignore({(v.emplace_back(std::forward<Args>(args)), 0)...}); - } - - std::size_t indexSize() const { return v.size(); } - std::size_t byteSize() const { return v.size() * sizeof(uint16_t); } - - bool empty() const { return v.empty(); } - void clear() { v.clear(); } - const uint16_t* data() const { return v.data(); } - const std::vector<uint16_t>& vector() const { return v; } - -private: - std::vector<uint16_t> v; -}; - -template <class DrawMode> class IndexBuffer { public: std::size_t indexCount; diff --git a/src/mbgl/gl/vertex_buffer.hpp b/src/mbgl/gl/vertex_buffer.hpp index 0e2db2608f..0b62b86c12 100644 --- a/src/mbgl/gl/vertex_buffer.hpp +++ b/src/mbgl/gl/vertex_buffer.hpp @@ -1,9 +1,6 @@ #pragma once #include <mbgl/gl/object.hpp> -#include <mbgl/gfx/primitives.hpp> -#include <mbgl/gfx/draw_mode.hpp> -#include <mbgl/util/ignore.hpp> #include <vector> @@ -11,29 +8,6 @@ namespace mbgl { namespace gl { template <class V> -class VertexVector { -public: - using Vertex = V; - - template <class... Args> - void emplace_back(Args&&... args) { - static_assert(sizeof...(args) == 1, "wrong buffer element count"); - util::ignore({(v.emplace_back(std::forward<Args>(args)), 0)...}); - } - - std::size_t vertexSize() const { return v.size(); } - std::size_t byteSize() const { return v.size() * sizeof(Vertex); } - - bool empty() const { return v.empty(); } - void clear() { v.clear(); } - const Vertex* data() const { return v.data(); } - const std::vector<Vertex>& vector() const { return v; } - -private: - std::vector<Vertex> v; -}; - -template <class V> class VertexBuffer { public: using Vertex = V; diff --git a/src/mbgl/layout/symbol_projection.cpp b/src/mbgl/layout/symbol_projection.cpp index 293cdc5427..dff2a569ac 100644 --- a/src/mbgl/layout/symbol_projection.cpp +++ b/src/mbgl/layout/symbol_projection.cpp @@ -122,7 +122,7 @@ namespace mbgl { } void addDynamicAttributes(const Point<float>& anchorPoint, const float angle, - gl::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray) { + gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray) { auto dynamicVertex = SymbolSDFIconProgram::dynamicLayoutVertex(anchorPoint, angle); dynamicVertexArray.emplace_back(dynamicVertex); dynamicVertexArray.emplace_back(dynamicVertex); @@ -130,7 +130,7 @@ namespace mbgl { dynamicVertexArray.emplace_back(dynamicVertex); } - void hideGlyphs(size_t numGlyphs, gl::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray) { + void hideGlyphs(size_t numGlyphs, gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray) { const Point<float> offscreenPoint = { -INFINITY, -INFINITY }; for (size_t i = 0; i < numGlyphs; i++) { addDynamicAttributes(offscreenPoint, 0, dynamicVertexArray); @@ -288,7 +288,7 @@ namespace mbgl { const mat4& posMatrix, const mat4& labelPlaneMatrix, const mat4& glCoordMatrix, - gl::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray, + gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray, const Point<float>& projectedAnchorPoint, const float aspectRatio) { const float fontScale = fontSize / 24.0; @@ -360,7 +360,7 @@ namespace mbgl { } - void reprojectLineLabels(gl::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray, const std::vector<PlacedSymbol>& placedSymbols, + void reprojectLineLabels(gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>& dynamicVertexArray, const std::vector<PlacedSymbol>& placedSymbols, const mat4& posMatrix, const style::SymbolPropertyValues& values, const RenderTile& tile, const SymbolSizeBinder& sizeBinder, const TransformState& state) { diff --git a/src/mbgl/layout/symbol_projection.hpp b/src/mbgl/layout/symbol_projection.hpp index f3dd29add1..a13769dcad 100644 --- a/src/mbgl/layout/symbol_projection.hpp +++ b/src/mbgl/layout/symbol_projection.hpp @@ -46,7 +46,7 @@ namespace mbgl { using PointAndCameraDistance = std::pair<Point<float>,float>; PointAndCameraDistance project(const Point<float>& point, const mat4& matrix); - void reprojectLineLabels(gl::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>&, const std::vector<PlacedSymbol>&, + void reprojectLineLabels(gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>>&, const std::vector<PlacedSymbol>&, const mat4& posMatrix, const style::SymbolPropertyValues&, const RenderTile&, const SymbolSizeBinder& sizeBinder, const TransformState&); diff --git a/src/mbgl/renderer/buckets/circle_bucket.hpp b/src/mbgl/renderer/buckets/circle_bucket.hpp index 70995733e8..b823c3ec97 100644 --- a/src/mbgl/renderer/buckets/circle_bucket.hpp +++ b/src/mbgl/renderer/buckets/circle_bucket.hpp @@ -30,8 +30,8 @@ public: float getQueryRadius(const RenderLayer&) const override; bool supportsLayer(const style::Layer::Impl&) const override; - gl::VertexVector<CircleLayoutVertex> vertices; - gl::IndexVector<gfx::Triangles> triangles; + gfx::VertexVector<CircleLayoutVertex> vertices; + gfx::IndexVector<gfx::Triangles> triangles; SegmentVector<CircleAttributes> segments; optional<gl::VertexBuffer<CircleLayoutVertex>> vertexBuffer; diff --git a/src/mbgl/renderer/buckets/debug_bucket.cpp b/src/mbgl/renderer/buckets/debug_bucket.cpp index 52bb6ca4be..ca96bb62d2 100644 --- a/src/mbgl/renderer/buckets/debug_bucket.cpp +++ b/src/mbgl/renderer/buckets/debug_bucket.cpp @@ -23,8 +23,8 @@ DebugBucket::DebugBucket(const OverscaledTileID& id, expires(std::move(expires_)), debugMode(debugMode_) { - gl::VertexVector<FillLayoutVertex> vertices; - gl::IndexVector<gfx::Lines> indices; + gfx::VertexVector<FillLayoutVertex> vertices; + gfx::IndexVector<gfx::Lines> indices; auto addText = [&] (const std::string& text, double left, double baseline, double scale) { for (uint8_t c : text) { diff --git a/src/mbgl/renderer/buckets/fill_bucket.hpp b/src/mbgl/renderer/buckets/fill_bucket.hpp index b74489ae19..d205ca801f 100644 --- a/src/mbgl/renderer/buckets/fill_bucket.hpp +++ b/src/mbgl/renderer/buckets/fill_bucket.hpp @@ -40,9 +40,9 @@ public: float getQueryRadius(const RenderLayer&) const override; bool supportsLayer(const style::Layer::Impl&) const override; - gl::VertexVector<FillLayoutVertex> vertices; - gl::IndexVector<gfx::Lines> lines; - gl::IndexVector<gfx::Triangles> triangles; + gfx::VertexVector<FillLayoutVertex> vertices; + gfx::IndexVector<gfx::Lines> lines; + gfx::IndexVector<gfx::Triangles> triangles; SegmentVector<FillAttributes> lineSegments; SegmentVector<FillAttributes> triangleSegments; diff --git a/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp b/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp index 9f8b78f0d8..7ff6b5e84d 100644 --- a/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp +++ b/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp @@ -39,8 +39,8 @@ public: float getQueryRadius(const RenderLayer&) const override; - gl::VertexVector<FillExtrusionLayoutVertex> vertices; - gl::IndexVector<gfx::Triangles> triangles; + gfx::VertexVector<FillExtrusionLayoutVertex> vertices; + gfx::IndexVector<gfx::Triangles> triangles; SegmentVector<FillExtrusionAttributes> triangleSegments; optional<gl::VertexBuffer<FillExtrusionLayoutVertex>> vertexBuffer; diff --git a/src/mbgl/renderer/buckets/heatmap_bucket.hpp b/src/mbgl/renderer/buckets/heatmap_bucket.hpp index e72e0e5c63..437a6f6473 100644 --- a/src/mbgl/renderer/buckets/heatmap_bucket.hpp +++ b/src/mbgl/renderer/buckets/heatmap_bucket.hpp @@ -29,8 +29,8 @@ public: float getQueryRadius(const RenderLayer&) const override; bool supportsLayer(const style::Layer::Impl&) const override; - gl::VertexVector<HeatmapLayoutVertex> vertices; - gl::IndexVector<gfx::Triangles> triangles; + gfx::VertexVector<HeatmapLayoutVertex> vertices; + gfx::IndexVector<gfx::Triangles> triangles; SegmentVector<HeatmapAttributes> segments; optional<gl::VertexBuffer<HeatmapLayoutVertex>> vertexBuffer; diff --git a/src/mbgl/renderer/buckets/hillshade_bucket.hpp b/src/mbgl/renderer/buckets/hillshade_bucket.hpp index 15d48d4dfe..54c16dcbd6 100644 --- a/src/mbgl/renderer/buckets/hillshade_bucket.hpp +++ b/src/mbgl/renderer/buckets/hillshade_bucket.hpp @@ -46,8 +46,8 @@ public: } // Raster-DEM Tile Sources use the default buffers from Painter - gl::VertexVector<HillshadeLayoutVertex> vertices; - gl::IndexVector<gfx::Triangles> indices; + gfx::VertexVector<HillshadeLayoutVertex> vertices; + gfx::IndexVector<gfx::Triangles> indices; SegmentVector<HillshadeAttributes> segments; optional<gl::VertexBuffer<HillshadeLayoutVertex>> vertexBuffer; diff --git a/src/mbgl/renderer/buckets/line_bucket.hpp b/src/mbgl/renderer/buckets/line_bucket.hpp index 5db561f90d..702f55d66a 100644 --- a/src/mbgl/renderer/buckets/line_bucket.hpp +++ b/src/mbgl/renderer/buckets/line_bucket.hpp @@ -43,8 +43,8 @@ public: PossiblyEvaluatedLayoutProperties layout; - gl::VertexVector<LineLayoutVertex> vertices; - gl::IndexVector<gfx::Triangles> triangles; + gfx::VertexVector<LineLayoutVertex> vertices; + gfx::IndexVector<gfx::Triangles> triangles; SegmentVector<LineAttributes> segments; optional<gl::VertexBuffer<LineLayoutVertex>> vertexBuffer; diff --git a/src/mbgl/renderer/buckets/raster_bucket.hpp b/src/mbgl/renderer/buckets/raster_bucket.hpp index 8cf71d5234..d610548411 100644 --- a/src/mbgl/renderer/buckets/raster_bucket.hpp +++ b/src/mbgl/renderer/buckets/raster_bucket.hpp @@ -32,8 +32,8 @@ public: // Bucket specific vertices are used for Image Sources only // Raster Tile Sources use the default buffers from Painter - gl::VertexVector<RasterLayoutVertex> vertices; - gl::IndexVector<gfx::Triangles> indices; + gfx::VertexVector<RasterLayoutVertex> vertices; + gfx::IndexVector<gfx::Triangles> indices; SegmentVector<RasterAttributes> segments; optional<gl::VertexBuffer<RasterLayoutVertex>> vertexBuffer; diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp index af9ce91b35..cea46a54eb 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.cpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp @@ -152,7 +152,7 @@ void SymbolBucket::updateOpacity() { uploaded = false; } -void addPlacedSymbol(gl::IndexVector<gfx::Triangles>& triangles, const PlacedSymbol& placedSymbol) { +void addPlacedSymbol(gfx::IndexVector<gfx::Triangles>& triangles, const PlacedSymbol& placedSymbol) { auto endIndex = placedSymbol.vertexStartIndex + placedSymbol.glyphOffsets.size() * 4; for (auto vertexIndex = placedSymbol.vertexStartIndex; vertexIndex < endIndex; vertexIndex += 4) { triangles.emplace_back(vertexIndex + 0, vertexIndex + 1, vertexIndex + 2); diff --git a/src/mbgl/renderer/buckets/symbol_bucket.hpp b/src/mbgl/renderer/buckets/symbol_bucket.hpp index 5b9b11cf4d..2ebeb99062 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.hpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.hpp @@ -88,10 +88,10 @@ public: std::unique_ptr<SymbolSizeBinder> textSizeBinder; struct TextBuffer { - gl::VertexVector<SymbolLayoutVertex> vertices; - gl::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>> dynamicVertices; - gl::VertexVector<gfx::Vertex<SymbolOpacityAttributes>> opacityVertices; - gl::IndexVector<gfx::Triangles> triangles; + gfx::VertexVector<SymbolLayoutVertex> vertices; + gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>> dynamicVertices; + gfx::VertexVector<gfx::Vertex<SymbolOpacityAttributes>> opacityVertices; + gfx::IndexVector<gfx::Triangles> triangles; SegmentVector<SymbolTextAttributes> segments; std::vector<PlacedSymbol> placedSymbols; @@ -104,10 +104,10 @@ public: std::unique_ptr<SymbolSizeBinder> iconSizeBinder; struct IconBuffer { - gl::VertexVector<SymbolLayoutVertex> vertices; - gl::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>> dynamicVertices; - gl::VertexVector<gfx::Vertex<SymbolOpacityAttributes>> opacityVertices; - gl::IndexVector<gfx::Triangles> triangles; + gfx::VertexVector<SymbolLayoutVertex> vertices; + gfx::VertexVector<gfx::Vertex<SymbolDynamicLayoutAttributes>> dynamicVertices; + gfx::VertexVector<gfx::Vertex<SymbolOpacityAttributes>> opacityVertices; + gfx::IndexVector<gfx::Triangles> triangles; SegmentVector<SymbolIconAttributes> segments; std::vector<PlacedSymbol> placedSymbols; PremultipliedImage atlasImage; @@ -119,8 +119,8 @@ public: } icon; struct CollisionBuffer { - gl::VertexVector<gfx::Vertex<CollisionBoxLayoutAttributes>> vertices; - gl::VertexVector<gfx::Vertex<CollisionBoxDynamicAttributes>> dynamicVertices; + gfx::VertexVector<gfx::Vertex<CollisionBoxLayoutAttributes>> vertices; + gfx::VertexVector<gfx::Vertex<CollisionBoxDynamicAttributes>> dynamicVertices; SegmentVector<CollisionBoxProgram::Attributes> segments; optional<gl::VertexBuffer<gfx::Vertex<CollisionBoxLayoutAttributes>>> vertexBuffer; @@ -128,12 +128,12 @@ public: }; struct CollisionBoxBuffer : public CollisionBuffer { - gl::IndexVector<gfx::Lines> lines; + gfx::IndexVector<gfx::Lines> lines; optional<gl::IndexBuffer<gfx::Lines>> indexBuffer; } collisionBox; struct CollisionCircleBuffer : public CollisionBuffer { - gl::IndexVector<gfx::Triangles> triangles; + gfx::IndexVector<gfx::Triangles> triangles; optional<gl::IndexBuffer<gfx::Triangles>> indexBuffer; } collisionCircle; diff --git a/src/mbgl/renderer/paint_property_binder.hpp b/src/mbgl/renderer/paint_property_binder.hpp index 56f187507f..874fab5add 100644 --- a/src/mbgl/renderer/paint_property_binder.hpp +++ b/src/mbgl/renderer/paint_property_binder.hpp @@ -221,7 +221,7 @@ public: private: style::PropertyExpression<T> expression; T defaultValue; - gl::VertexVector<BaseVertex> vertexVector; + gfx::VertexVector<BaseVertex> vertexVector; optional<gl::VertexBuffer<BaseVertex>> vertexBuffer; }; @@ -284,7 +284,7 @@ private: style::PropertyExpression<T> expression; T defaultValue; Range<float> zoomRange; - gl::VertexVector<Vertex> vertexVector; + gfx::VertexVector<Vertex> vertexVector; optional<gl::VertexBuffer<Vertex>> vertexBuffer; }; @@ -375,9 +375,9 @@ private: style::PropertyExpression<T> expression; T defaultValue; Range<float> zoomRange; - gl::VertexVector<Vertex> patternToVertexVector; - gl::VertexVector<Vertex2> zoomInVertexVector; - gl::VertexVector<Vertex2> zoomOutVertexVector; + gfx::VertexVector<Vertex> patternToVertexVector; + gfx::VertexVector<Vertex2> zoomInVertexVector; + gfx::VertexVector<Vertex2> zoomOutVertexVector; optional<gl::VertexBuffer<Vertex>> patternToVertexBuffer; optional<gl::VertexBuffer<Vertex2>> zoomInVertexBuffer; optional<gl::VertexBuffer<Vertex2>> zoomOutVertexBuffer; diff --git a/src/mbgl/renderer/render_static_data.cpp b/src/mbgl/renderer/render_static_data.cpp index 7313f95ecb..cae0e0a820 100644 --- a/src/mbgl/renderer/render_static_data.cpp +++ b/src/mbgl/renderer/render_static_data.cpp @@ -3,8 +3,8 @@ namespace mbgl { -static gl::VertexVector<gfx::Vertex<PositionOnlyLayoutAttributes>> tileVertices() { - gl::VertexVector<gfx::Vertex<PositionOnlyLayoutAttributes>> result; +static gfx::VertexVector<gfx::Vertex<PositionOnlyLayoutAttributes>> tileVertices() { + gfx::VertexVector<gfx::Vertex<PositionOnlyLayoutAttributes>> result; result.emplace_back(gfx::Vertex<PositionOnlyLayoutAttributes>({{{ 0, 0 }}})); result.emplace_back(gfx::Vertex<PositionOnlyLayoutAttributes>({{{ util::EXTENT, 0 }}})); result.emplace_back(gfx::Vertex<PositionOnlyLayoutAttributes>({{{ 0, util::EXTENT }}})); @@ -12,15 +12,15 @@ static gl::VertexVector<gfx::Vertex<PositionOnlyLayoutAttributes>> tileVertices( return result; } -static gl::IndexVector<gfx::Triangles> quadTriangleIndices() { - gl::IndexVector<gfx::Triangles> result; +static gfx::IndexVector<gfx::Triangles> quadTriangleIndices() { + gfx::IndexVector<gfx::Triangles> result; result.emplace_back(0, 1, 2); result.emplace_back(1, 2, 3); return result; } -static gl::IndexVector<gfx::LineStrip> tileLineStripIndices() { - gl::IndexVector<gfx::LineStrip> result; +static gfx::IndexVector<gfx::LineStrip> tileLineStripIndices() { + gfx::IndexVector<gfx::LineStrip> result; result.emplace_back(0); result.emplace_back(1); result.emplace_back(3); @@ -29,8 +29,8 @@ static gl::IndexVector<gfx::LineStrip> tileLineStripIndices() { return result; } -static gl::VertexVector<RasterLayoutVertex> rasterVertices() { - gl::VertexVector<RasterLayoutVertex> result; +static gfx::VertexVector<RasterLayoutVertex> rasterVertices() { + gfx::VertexVector<RasterLayoutVertex> result; result.emplace_back(RasterProgram::layoutVertex({ 0, 0 }, { 0, 0 })); result.emplace_back(RasterProgram::layoutVertex({ util::EXTENT, 0 }, { util::EXTENT, 0 })); result.emplace_back(RasterProgram::layoutVertex({ 0, util::EXTENT }, { 0, util::EXTENT })); @@ -38,8 +38,8 @@ static gl::VertexVector<RasterLayoutVertex> rasterVertices() { return result; } -static gl::VertexVector<ExtrusionTextureLayoutVertex> extrusionTextureVertices() { - gl::VertexVector<ExtrusionTextureLayoutVertex> result; +static gfx::VertexVector<ExtrusionTextureLayoutVertex> extrusionTextureVertices() { + gfx::VertexVector<ExtrusionTextureLayoutVertex> result; result.emplace_back(ExtrusionTextureProgram::layoutVertex({ 0, 0 })); result.emplace_back(ExtrusionTextureProgram::layoutVertex({ 1, 0 })); result.emplace_back(ExtrusionTextureProgram::layoutVertex({ 0, 1 })); |