summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/vertex_buffer.hpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-06-28 17:39:49 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-06-28 18:20:45 +0300
commit5a03ae3d906336536ee493426d6cdcc3129c155d (patch)
tree8083c4a5dfd1c743db6c73d0e14434c06390d16a /src/mbgl/gl/vertex_buffer.hpp
parenta35b268606b6becf218286036e4d1cfc22ddcaa3 (diff)
downloadqtlocation-mapboxgl-upstream/index-vertex-vector-reserve.tar.gz
[core] Reserve space for index/vertex items when possibleupstream/index-vertex-vector-reserve
Diffstat (limited to 'src/mbgl/gl/vertex_buffer.hpp')
-rw-r--r--src/mbgl/gl/vertex_buffer.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mbgl/gl/vertex_buffer.hpp b/src/mbgl/gl/vertex_buffer.hpp
index 4808803d00..3490e06e9f 100644
--- a/src/mbgl/gl/vertex_buffer.hpp
+++ b/src/mbgl/gl/vertex_buffer.hpp
@@ -16,6 +16,10 @@ public:
using Vertex = V;
static constexpr std::size_t groupSize = DrawMode::bufferGroupSize;
+ void reserve(std::size_t size) {
+ v.reserve(size);
+ }
+
template <class... Args>
void emplace_back(Args&&... args) {
static_assert(sizeof...(args) == groupSize, "wrong buffer element count");