summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-07-10 12:19:23 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-07-12 14:55:02 -0700
commit4c42132183f81bd9263f8513b1fa9f610035ed57 (patch)
tree71ebf62f10f50849eced82afa9f2172a062c502b /src/mbgl/gl/context.cpp
parent49726cdc7592eddb2c9dc37cd7af79e668755ce1 (diff)
downloadqtlocation-mapboxgl-4c42132183f81bd9263f8513b1fa9f610035ed57.tar.gz
[core] Reduce memory requirements of VertexArrays
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r--src/mbgl/gl/context.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index f7d210d52e..35683cff89 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -285,11 +285,12 @@ VertexArray Context::createVertexArray() {
if (supportsVertexArrays()) {
VertexArrayID id = 0;
MBGL_CHECK_ERROR(vertexArray->genVertexArrays(1, &id));
- return { std::make_unique<VertexArrayState>(UniqueVertexArray(std::move(id), { this }), *this) };
+ UniqueVertexArray vao(std::move(id), { this });
+ return { UniqueVertexArrayState(new VertexArrayState(std::move(vao), *this), VertexArrayStateDeleter { true })};
} else {
// On GL implementations which do not support vertex arrays, attribute bindings are global state.
// So return a VertexArray which shares our global state tracking and whose deleter is a no-op.
- return { UniqueVertexArrayState(&globalVertexArrayState, [] (VertexArrayState*) {}) };
+ return { UniqueVertexArrayState(&globalVertexArrayState, VertexArrayStateDeleter { false }) };
}
}