summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-03-05 15:37:01 +0100
committerKonstantin Käfer <mail@kkaefer.com>2019-03-06 16:12:51 +0100
commitf13c2b86e427e29a856ca8f0f79379203c61f431 (patch)
treeb41fd7ab9d8d9b0e20caa31c161df684a844a3ae /src/mbgl/renderer
parent2f646af255bf05bd50070deb83bb89e48509afc4 (diff)
downloadqtlocation-mapboxgl-f13c2b86e427e29a856ca8f0f79379203c61f431.tar.gz
[core] unify *Buffer/Vector naming
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r--src/mbgl/renderer/buckets/circle_bucket.cpp4
-rw-r--r--src/mbgl/renderer/buckets/debug_bucket.cpp6
-rw-r--r--src/mbgl/renderer/buckets/fill_bucket.cpp10
-rw-r--r--src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp8
-rw-r--r--src/mbgl/renderer/buckets/heatmap_bucket.cpp4
-rw-r--r--src/mbgl/renderer/buckets/hillshade_bucket.cpp2
-rw-r--r--src/mbgl/renderer/buckets/line_bucket.cpp16
-rw-r--r--src/mbgl/renderer/buckets/raster_bucket.cpp2
-rw-r--r--src/mbgl/renderer/paint_property_binder.hpp8
9 files changed, 30 insertions, 30 deletions
diff --git a/src/mbgl/renderer/buckets/circle_bucket.cpp b/src/mbgl/renderer/buckets/circle_bucket.cpp
index bf54205978..8ebc685df3 100644
--- a/src/mbgl/renderer/buckets/circle_bucket.cpp
+++ b/src/mbgl/renderer/buckets/circle_bucket.cpp
@@ -62,7 +62,7 @@ void CircleBucket::addFeature(const GeometryTileFeature& feature,
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.vertexSize(), triangles.indexSize());
+ segments.emplace_back(vertices.elements(), triangles.elements());
}
// this geometry will be of the Point type, and we'll derive
@@ -94,7 +94,7 @@ void CircleBucket::addFeature(const GeometryTileFeature& feature,
}
for (auto& pair : paintPropertyBinders) {
- pair.second.populateVertexVectors(feature, vertices.vertexSize(), {}, {});
+ pair.second.populateVertexVectors(feature, vertices.elements(), {}, {});
}
}
diff --git a/src/mbgl/renderer/buckets/debug_bucket.cpp b/src/mbgl/renderer/buckets/debug_bucket.cpp
index ca96bb62d2..0de6cccdb2 100644
--- a/src/mbgl/renderer/buckets/debug_bucket.cpp
+++ b/src/mbgl/renderer/buckets/debug_bucket.cpp
@@ -46,8 +46,8 @@ DebugBucket::DebugBucket(const OverscaledTileID& id,
vertices.emplace_back(FillProgram::layoutVertex(p));
if (prev) {
- indices.emplace_back(vertices.vertexSize() - 2,
- vertices.vertexSize() - 1);
+ indices.emplace_back(vertices.elements() - 2,
+ vertices.elements() - 1);
}
prev = p;
@@ -74,7 +74,7 @@ DebugBucket::DebugBucket(const OverscaledTileID& id,
addText(expiresText, 50, baseline + 200, 5);
}
- segments.emplace_back(0, 0, vertices.vertexSize(), indices.indexSize());
+ segments.emplace_back(0, 0, vertices.elements(), indices.elements());
vertexBuffer = context.createVertexBuffer(std::move(vertices));
indexBuffer = context.createIndexBuffer(std::move(indices));
diff --git a/src/mbgl/renderer/buckets/fill_bucket.cpp b/src/mbgl/renderer/buckets/fill_bucket.cpp
index 517c9b184a..302b708713 100644
--- a/src/mbgl/renderer/buckets/fill_bucket.cpp
+++ b/src/mbgl/renderer/buckets/fill_bucket.cpp
@@ -60,7 +60,7 @@ void FillBucket::addFeature(const GeometryTileFeature& feature,
throw GeometryTooLongException();
}
- std::size_t startVertices = vertices.vertexSize();
+ std::size_t startVertices = vertices.elements();
for (const auto& ring : polygon) {
std::size_t nVertices = ring.size();
@@ -69,7 +69,7 @@ void FillBucket::addFeature(const GeometryTileFeature& feature,
continue;
if (lineSegments.empty() || lineSegments.back().vertexLength + nVertices > std::numeric_limits<uint16_t>::max()) {
- lineSegments.emplace_back(vertices.vertexSize(), lines.indexSize());
+ lineSegments.emplace_back(vertices.elements(), lines.elements());
}
auto& lineSegment = lineSegments.back();
@@ -94,7 +94,7 @@ void FillBucket::addFeature(const GeometryTileFeature& feature,
assert(nIndicies % 3 == 0);
if (triangleSegments.empty() || triangleSegments.back().vertexLength + totalVertices > std::numeric_limits<uint16_t>::max()) {
- triangleSegments.emplace_back(startVertices, triangles.indexSize());
+ triangleSegments.emplace_back(startVertices, triangles.elements());
}
auto& triangleSegment = triangleSegments.back();
@@ -114,9 +114,9 @@ void FillBucket::addFeature(const GeometryTileFeature& feature,
for (auto& pair : paintPropertyBinders) {
const auto it = patternDependencies.find(pair.first);
if (it != patternDependencies.end()){
- pair.second.populateVertexVectors(feature, vertices.vertexSize(), patternPositions, it->second);
+ pair.second.populateVertexVectors(feature, vertices.elements(), patternPositions, it->second);
} else {
- pair.second.populateVertexVectors(feature, vertices.vertexSize(), patternPositions, {});
+ pair.second.populateVertexVectors(feature, vertices.elements(), patternPositions, {});
}
}
}
diff --git a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp
index 7b932e6b2b..77d9bfd907 100644
--- a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp
+++ b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp
@@ -71,12 +71,12 @@ void FillExtrusionBucket::addFeature(const GeometryTileFeature& feature,
std::vector<uint32_t> flatIndices;
flatIndices.reserve(totalVertices);
- std::size_t startVertices = vertices.vertexSize();
+ std::size_t startVertices = vertices.elements();
if (triangleSegments.empty() ||
triangleSegments.back().vertexLength + (5 * (totalVertices - 1) + 1) >
std::numeric_limits<uint16_t>::max()) {
- triangleSegments.emplace_back(startVertices, triangles.indexSize());
+ triangleSegments.emplace_back(startVertices, triangles.elements());
}
auto& triangleSegment = triangleSegments.back();
@@ -158,9 +158,9 @@ void FillExtrusionBucket::addFeature(const GeometryTileFeature& feature,
for (auto& pair : paintPropertyBinders) {
const auto it = patternDependencies.find(pair.first);
if (it != patternDependencies.end()){
- pair.second.populateVertexVectors(feature, vertices.vertexSize(), patternPositions, it->second);
+ pair.second.populateVertexVectors(feature, vertices.elements(), patternPositions, it->second);
} else {
- pair.second.populateVertexVectors(feature, vertices.vertexSize(), patternPositions, {});
+ pair.second.populateVertexVectors(feature, vertices.elements(), patternPositions, {});
}
}
}
diff --git a/src/mbgl/renderer/buckets/heatmap_bucket.cpp b/src/mbgl/renderer/buckets/heatmap_bucket.cpp
index 28d2efe302..ca1264305f 100644
--- a/src/mbgl/renderer/buckets/heatmap_bucket.cpp
+++ b/src/mbgl/renderer/buckets/heatmap_bucket.cpp
@@ -61,7 +61,7 @@ void HeatmapBucket::addFeature(const GeometryTileFeature& feature,
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.vertexSize(), triangles.indexSize());
+ segments.emplace_back(vertices.elements(), triangles.elements());
}
// this geometry will be of the Point type, and we'll derive
@@ -93,7 +93,7 @@ void HeatmapBucket::addFeature(const GeometryTileFeature& feature,
}
for (auto& pair : paintPropertyBinders) {
- pair.second.populateVertexVectors(feature, vertices.vertexSize(), {}, {});
+ pair.second.populateVertexVectors(feature, vertices.elements(), {}, {});
}
}
diff --git a/src/mbgl/renderer/buckets/hillshade_bucket.cpp b/src/mbgl/renderer/buckets/hillshade_bucket.cpp
index 8dda9dd376..6affd53196 100644
--- a/src/mbgl/renderer/buckets/hillshade_bucket.cpp
+++ b/src/mbgl/renderer/buckets/hillshade_bucket.cpp
@@ -84,7 +84,7 @@ void HillshadeBucket::setMask(TileMask&& mask_) {
if (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.vertexSize(), indices.indexSize());
+ segments.emplace_back(vertices.elements(), indices.elements());
}
vertices.emplace_back(
diff --git a/src/mbgl/renderer/buckets/line_bucket.cpp b/src/mbgl/renderer/buckets/line_bucket.cpp
index f17a309163..8d13bf0793 100644
--- a/src/mbgl/renderer/buckets/line_bucket.cpp
+++ b/src/mbgl/renderer/buckets/line_bucket.cpp
@@ -41,9 +41,9 @@ void LineBucket::addFeature(const GeometryTileFeature& feature,
for (auto& pair : paintPropertyBinders) {
const auto it = patternDependencies.find(pair.first);
if (it != patternDependencies.end()){
- pair.second.populateVertexVectors(feature, vertices.vertexSize(), patternPositions, it->second);
+ pair.second.populateVertexVectors(feature, vertices.elements(), patternPositions, it->second);
} else {
- pair.second.populateVertexVectors(feature, vertices.vertexSize(), patternPositions, {});
+ pair.second.populateVertexVectors(feature, vertices.elements(), patternPositions, {});
}
}
}
@@ -164,7 +164,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& coordinates, const Geome
nextNormal = util::perp(util::unit(convertPoint<double>(firstCoordinate - *currentCoordinate)));
}
- const std::size_t startVertex = vertices.vertexSize();
+ const std::size_t startVertex = vertices.elements();
std::vector<TriangleElement> triangleStore;
for (std::size_t i = first; i < len; ++i) {
@@ -421,11 +421,11 @@ void LineBucket::addGeometry(const GeometryCoordinates& coordinates, const Geome
startOfLine = false;
}
- const std::size_t endVertex = vertices.vertexSize();
+ const std::size_t endVertex = vertices.elements();
const std::size_t vertexCount = endVertex - startVertex;
if (segments.empty() || segments.back().vertexLength + vertexCount > std::numeric_limits<uint16_t>::max()) {
- segments.emplace_back(startVertex, triangles.indexSize());
+ segments.emplace_back(startVertex, triangles.elements());
}
auto& segment = segments.back();
@@ -455,7 +455,7 @@ void LineBucket::addCurrentVertex(const GeometryCoordinate& currentCoordinate,
if (endLeft)
extrude = extrude - (util::perp(normal) * endLeft);
vertices.emplace_back(LineProgram::layoutVertex(currentCoordinate, extrude, round, false, endLeft, scaledDistance * LINE_DISTANCE_SCALE));
- e3 = vertices.vertexSize() - 1 - startVertex;
+ e3 = vertices.elements() - 1 - startVertex;
if (e1 >= 0 && e2 >= 0) {
triangleStore.emplace_back(e1, e2, e3);
}
@@ -466,7 +466,7 @@ void LineBucket::addCurrentVertex(const GeometryCoordinate& currentCoordinate,
if (endRight)
extrude = extrude - (util::perp(normal) * endRight);
vertices.emplace_back(LineProgram::layoutVertex(currentCoordinate, extrude, round, true, -endRight, scaledDistance * LINE_DISTANCE_SCALE));
- e3 = vertices.vertexSize() - 1 - startVertex;
+ e3 = vertices.elements() - 1 - startVertex;
if (e1 >= 0 && e2 >= 0) {
triangleStore.emplace_back(e1, e2, e3);
}
@@ -496,7 +496,7 @@ void LineBucket::addPieSliceVertex(const GeometryCoordinate& currentVertex,
}
vertices.emplace_back(LineProgram::layoutVertex(currentVertex, flippedExtrude, false, lineTurnsLeft, 0, distance * LINE_DISTANCE_SCALE));
- e3 = vertices.vertexSize() - 1 - startVertex;
+ e3 = vertices.elements() - 1 - startVertex;
if (e1 >= 0 && e2 >= 0) {
triangleStore.emplace_back(e1, e2, e3);
}
diff --git a/src/mbgl/renderer/buckets/raster_bucket.cpp b/src/mbgl/renderer/buckets/raster_bucket.cpp
index 47d6d0b96f..a1884b8f7a 100644
--- a/src/mbgl/renderer/buckets/raster_bucket.cpp
+++ b/src/mbgl/renderer/buckets/raster_bucket.cpp
@@ -79,7 +79,7 @@ void RasterBucket::setMask(TileMask&& mask_) {
if (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.vertexSize(), indices.indexSize());
+ segments.emplace_back(vertices.elements(), indices.elements());
}
vertices.emplace_back(
diff --git a/src/mbgl/renderer/paint_property_binder.hpp b/src/mbgl/renderer/paint_property_binder.hpp
index cbf60ea679..cb4c3b5519 100644
--- a/src/mbgl/renderer/paint_property_binder.hpp
+++ b/src/mbgl/renderer/paint_property_binder.hpp
@@ -187,7 +187,7 @@ public:
auto evaluated = expression.evaluate(feature, defaultValue);
this->statistics.add(evaluated);
auto value = attributeValue(evaluated);
- for (std::size_t i = vertexVector.vertexSize(); i < length; ++i) {
+ for (std::size_t i = vertexVector.elements(); i < length; ++i) {
vertexVector.emplace_back(BaseVertex { value });
}
}
@@ -247,7 +247,7 @@ public:
AttributeValue value = zoomInterpolatedAttributeValue(
attributeValue(range.min),
attributeValue(range.max));
- for (std::size_t i = vertexVector.vertexSize(); i < length; ++i) {
+ for (std::size_t i = vertexVector.elements(); i < length; ++i) {
vertexVector.emplace_back(Vertex { value });
}
}
@@ -319,7 +319,7 @@ public:
// Unlike other propperties with expressions that evaluate to null, the default value for `*-pattern` properties is an empty
// string and will not have a valid entry in patternPositions. We still need to populate the attribute buffers to avoid crashes
// when we try to draw the layer because we don't know at draw time if all features were evaluated to valid pattern dependencies.
- for (std::size_t i = zoomInVertexVector.vertexSize(); i < length; ++i) {
+ for (std::size_t i = zoomInVertexVector.elements(); i < length; ++i) {
patternToVertexVector.emplace_back(Vertex { std::array<uint16_t, 4>{{0, 0, 0, 0}} });
zoomInVertexVector.emplace_back(Vertex2 { std::array<uint16_t, 4>{{0, 0, 0, 0}} } );
zoomOutVertexVector.emplace_back(Vertex2 { std::array<uint16_t, 4>{{0, 0, 0, 0}} });
@@ -336,7 +336,7 @@ public:
const ImagePosition imageMid = mid->second;
const ImagePosition imageMax = max->second;
- for (std::size_t i = zoomInVertexVector.vertexSize(); i < length; ++i) {
+ for (std::size_t i = zoomInVertexVector.elements(); i < length; ++i) {
patternToVertexVector.emplace_back(Vertex { imageMid.tlbr() });
zoomInVertexVector.emplace_back(Vertex2 { imageMin.tlbr() });
zoomOutVertexVector.emplace_back(Vertex2 { imageMax.tlbr() });