diff options
Diffstat (limited to 'src/mbgl/util/gl_object_store.cpp')
-rw-r--r-- | src/mbgl/util/gl_object_store.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/mbgl/util/gl_object_store.cpp b/src/mbgl/util/gl_object_store.cpp deleted file mode 100644 index 78d6700237..0000000000 --- a/src/mbgl/util/gl_object_store.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include <mbgl/util/gl_object_store.hpp> - -#include <mbgl/util/thread.hpp> -#include <mbgl/geometry/vao.hpp> -#include <mbgl/platform/gl.hpp> - -#include <cassert> - -namespace mbgl { -namespace util { - -void GLObjectStore::abandonVAO(GLuint vao) { - assert(ThreadContext::currentlyOn(ThreadType::Map)); - abandonedVAOs.emplace_back(vao); -} - -void GLObjectStore::abandonBuffer(GLuint buffer) { - assert(ThreadContext::currentlyOn(ThreadType::Map)); - abandonedBuffers.emplace_back(buffer); -} - -void GLObjectStore::abandonTexture(GLuint texture) { - assert(ThreadContext::currentlyOn(ThreadType::Map)); - abandonedTextures.emplace_back(texture); -} - -void GLObjectStore::performCleanup() { - assert(ThreadContext::currentlyOn(ThreadType::Map)); - - if (!abandonedVAOs.empty()) { - MBGL_CHECK_ERROR(VertexArrayObject::Delete(static_cast<GLsizei>(abandonedVAOs.size()), - abandonedVAOs.data())); - abandonedVAOs.clear(); - } - - if (!abandonedTextures.empty()) { - MBGL_CHECK_ERROR(glDeleteTextures(static_cast<GLsizei>(abandonedTextures.size()), - abandonedTextures.data())); - abandonedTextures.clear(); - } - - if (!abandonedBuffers.empty()) { - MBGL_CHECK_ERROR(glDeleteBuffers(static_cast<GLsizei>(abandonedBuffers.size()), - abandonedBuffers.data())); - abandonedBuffers.clear(); - } -} - -} // namespace util -} // namespace mbgl |