[core] move VertexVector/IndexVector to gfx namespace
This commit is contained in:
@@ -500,10 +500,12 @@
|
||||
"mbgl/gfx/cull_face_mode.hpp": "src/mbgl/gfx/cull_face_mode.hpp",
|
||||
"mbgl/gfx/depth_mode.hpp": "src/mbgl/gfx/depth_mode.hpp",
|
||||
"mbgl/gfx/draw_mode.hpp": "src/mbgl/gfx/draw_mode.hpp",
|
||||
"mbgl/gfx/index_vector.hpp": "src/mbgl/gfx/index_vector.hpp",
|
||||
"mbgl/gfx/primitives.hpp": "src/mbgl/gfx/primitives.hpp",
|
||||
"mbgl/gfx/stencil_mode.hpp": "src/mbgl/gfx/stencil_mode.hpp",
|
||||
"mbgl/gfx/types.hpp": "src/mbgl/gfx/types.hpp",
|
||||
"mbgl/gfx/uniform.hpp": "src/mbgl/gfx/uniform.hpp",
|
||||
"mbgl/gfx/vertex_vector.hpp": "src/mbgl/gfx/vertex_vector.hpp",
|
||||
"mbgl/gl/attribute.hpp": "src/mbgl/gl/attribute.hpp",
|
||||
"mbgl/gl/context.hpp": "src/mbgl/gl/context.hpp",
|
||||
"mbgl/gl/debugging.hpp": "src/mbgl/gl/debugging.hpp",
|
||||
|
||||
50
src/mbgl/gfx/index_vector.hpp
Normal file
50
src/mbgl/gfx/index_vector.hpp
Normal file
@@ -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
|
||||
50
src/mbgl/gfx/vertex_vector.hpp
Normal file
50
src/mbgl/gfx/vertex_vector.hpp
Normal file
@@ -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
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -1,37 +1,10 @@
|
||||
#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:
|
||||
|
||||
@@ -1,38 +1,12 @@
|
||||
#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>
|
||||
|
||||
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:
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -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&);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 }));
|
||||
|
||||
Reference in New Issue
Block a user