summaryrefslogtreecommitdiff
path: root/src/mbgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl')
-rw-r--r--src/mbgl/layout/symbol_layout.cpp2
-rw-r--r--src/mbgl/renderer/circle_bucket.cpp2
-rw-r--r--src/mbgl/renderer/circle_bucket.hpp2
-rw-r--r--src/mbgl/renderer/fill_bucket.cpp4
-rw-r--r--src/mbgl/renderer/fill_bucket.hpp4
-rw-r--r--src/mbgl/renderer/line_bucket.cpp3
-rw-r--r--src/mbgl/renderer/line_bucket.hpp2
-rw-r--r--src/mbgl/renderer/symbol_bucket.cpp2
-rw-r--r--src/mbgl/renderer/symbol_bucket.hpp4
9 files changed, 12 insertions, 13 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp
index fb0c67a481..f1886e807e 100644
--- a/src/mbgl/layout/symbol_layout.cpp
+++ b/src/mbgl/layout/symbol_layout.cpp
@@ -448,7 +448,7 @@ void SymbolLayout::addSymbols(Buffer &buffer, const SymbolQuads &symbols, float
minZoom = 0;
}
- if (buffer.segments.back().vertexLength + vertexLength > std::numeric_limits<uint16_t>::max()) {
+ if (buffer.segments.empty() || buffer.segments.back().vertexLength + vertexLength > std::numeric_limits<uint16_t>::max()) {
buffer.segments.emplace_back(buffer.vertices.size(), buffer.triangles.size());
}
diff --git a/src/mbgl/renderer/circle_bucket.cpp b/src/mbgl/renderer/circle_bucket.cpp
index 9c1c5a6b44..3e98d725bb 100644
--- a/src/mbgl/renderer/circle_bucket.cpp
+++ b/src/mbgl/renderer/circle_bucket.cpp
@@ -44,7 +44,7 @@ void CircleBucket::addGeometry(const GeometryCollection& geometryCollection) {
if ((mode != MapMode::Still) &&
(x < 0 || x >= util::EXTENT || y < 0 || y >= util::EXTENT)) continue;
- if (segments.back().vertexLength + vertexLength > std::numeric_limits<uint16_t>::max()) {
+ if (segments.empty() || segments.back().vertexLength + vertexLength > std::numeric_limits<uint16_t>::max()) {
// Move to a new segments because the old one can't hold the geometry.
segments.emplace_back(vertices.size(), triangles.size());
}
diff --git a/src/mbgl/renderer/circle_bucket.hpp b/src/mbgl/renderer/circle_bucket.hpp
index 494e64cc0f..a682d423d6 100644
--- a/src/mbgl/renderer/circle_bucket.hpp
+++ b/src/mbgl/renderer/circle_bucket.hpp
@@ -22,7 +22,7 @@ public:
std::vector<CircleVertex> vertices;
std::vector<gl::Triangle> triangles;
- std::vector<gl::Segment> segments { { 0, 0 } };
+ std::vector<gl::Segment> segments;
optional<gl::VertexBuffer<CircleVertex>> vertexBuffer;
optional<gl::IndexBuffer<gl::Triangle>> indexBuffer;
diff --git a/src/mbgl/renderer/fill_bucket.cpp b/src/mbgl/renderer/fill_bucket.cpp
index 86b3946f64..6a5cc09e6a 100644
--- a/src/mbgl/renderer/fill_bucket.cpp
+++ b/src/mbgl/renderer/fill_bucket.cpp
@@ -51,7 +51,7 @@ void FillBucket::addGeometry(const GeometryCollection& geometry) {
if (nVertices == 0)
continue;
- if (lineSegments.back().vertexLength + nVertices > std::numeric_limits<uint16_t>::max()) {
+ if (lineSegments.empty() || lineSegments.back().vertexLength + nVertices > std::numeric_limits<uint16_t>::max()) {
lineSegments.emplace_back(vertices.size(), lines.size());
}
@@ -76,7 +76,7 @@ void FillBucket::addGeometry(const GeometryCollection& geometry) {
std::size_t nIndicies = indices.size();
assert(nIndicies % 3 == 0);
- if (triangleSegments.back().vertexLength + totalVertices > std::numeric_limits<uint16_t>::max()) {
+ if (triangleSegments.empty() || triangleSegments.back().vertexLength + totalVertices > std::numeric_limits<uint16_t>::max()) {
triangleSegments.emplace_back(startVertices, triangles.size());
}
diff --git a/src/mbgl/renderer/fill_bucket.hpp b/src/mbgl/renderer/fill_bucket.hpp
index 58fa916f82..715b8e2745 100644
--- a/src/mbgl/renderer/fill_bucket.hpp
+++ b/src/mbgl/renderer/fill_bucket.hpp
@@ -22,8 +22,8 @@ public:
std::vector<FillVertex> vertices;
std::vector<gl::Line> lines;
std::vector<gl::Triangle> triangles;
- std::vector<gl::Segment> lineSegments { { 0, 0 } };
- std::vector<gl::Segment> triangleSegments { { 0, 0 } };
+ std::vector<gl::Segment> lineSegments;
+ std::vector<gl::Segment> triangleSegments;
optional<gl::VertexBuffer<FillVertex>> vertexBuffer;
optional<gl::IndexBuffer<gl::Line>> lineIndexBuffer;
diff --git a/src/mbgl/renderer/line_bucket.cpp b/src/mbgl/renderer/line_bucket.cpp
index 0298e174a1..9856684c58 100644
--- a/src/mbgl/renderer/line_bucket.cpp
+++ b/src/mbgl/renderer/line_bucket.cpp
@@ -348,8 +348,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& coordinates) {
const std::size_t endVertex = vertices.size();
const std::size_t vertexCount = endVertex - startVertex;
- if (segments.back().vertexLength + vertexCount > std::numeric_limits<uint16_t>::max()) {
- // Move to a new group because the old one can't hold the geometry.
+ if (segments.empty() || segments.back().vertexLength + vertexCount > std::numeric_limits<uint16_t>::max()) {
segments.emplace_back(startVertex, triangles.size());
}
diff --git a/src/mbgl/renderer/line_bucket.hpp b/src/mbgl/renderer/line_bucket.hpp
index 3ee142a70b..7b4c5f1b57 100644
--- a/src/mbgl/renderer/line_bucket.hpp
+++ b/src/mbgl/renderer/line_bucket.hpp
@@ -28,7 +28,7 @@ public:
std::vector<LineVertex> vertices;
std::vector<gl::Triangle> triangles;
- std::vector<gl::Segment> segments { { 0, 0 } };
+ std::vector<gl::Segment> segments;
optional<gl::VertexBuffer<LineVertex>> vertexBuffer;
optional<gl::IndexBuffer<gl::Triangle>> indexBuffer;
diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp
index 5edf742917..7fb3473967 100644
--- a/src/mbgl/renderer/symbol_bucket.cpp
+++ b/src/mbgl/renderer/symbol_bucket.cpp
@@ -42,7 +42,7 @@ void SymbolBucket::render(Painter& painter,
}
bool SymbolBucket::hasData() const {
- assert(false); // Should be calling SymbolLayout::hasSymbolInstances() instead.
+ assert(false); // Should be calling SymbolLayout::has{Text,Icon,CollisonBox}Data() instead.
return false;
}
diff --git a/src/mbgl/renderer/symbol_bucket.hpp b/src/mbgl/renderer/symbol_bucket.hpp
index 881475e4a9..a905e25363 100644
--- a/src/mbgl/renderer/symbol_bucket.hpp
+++ b/src/mbgl/renderer/symbol_bucket.hpp
@@ -36,7 +36,7 @@ public:
struct TextBuffer {
std::vector<SymbolVertex> vertices;
std::vector<gl::Triangle> triangles;
- std::vector<gl::Segment> segments { { 0, 0 } };
+ std::vector<gl::Segment> segments;
optional<gl::VertexBuffer<SymbolVertex>> vertexBuffer;
optional<gl::IndexBuffer<gl::Triangle>> indexBuffer;
@@ -45,7 +45,7 @@ public:
struct IconBuffer {
std::vector<SymbolVertex> vertices;
std::vector<gl::Triangle> triangles;
- std::vector<gl::Segment> segments { { 0, 0 } };
+ std::vector<gl::Segment> segments;
optional<gl::VertexBuffer<SymbolVertex>> vertexBuffer;
optional<gl::IndexBuffer<gl::Triangle>> indexBuffer;