Introduce GLObjectStore

Make a class for keeping GL objects ids and attach it
to the ThreadContext instead of hanging it on the Environment.
This commit is contained in:
Thiago Marcos P. Santos
2015-06-25 00:10:34 +03:00
parent be4cb6786b
commit e32b0b7e20
12 changed files with 126 additions and 14 deletions

View File

@@ -1,5 +1,7 @@
#include <mbgl/util/texture_pool.hpp>
#include <mbgl/map/environment.hpp>
#include <mbgl/util/gl_object_store.hpp>
#include <mbgl/util/thread_context.hpp>
#include <vector>
@@ -43,9 +45,9 @@ void TexturePool::removeTextureID(GLuint texture_id) {
}
void TexturePool::clearTextureIDs() {
auto& env = Environment::Get();
auto getGLObjectStore = util::ThreadContext::getGLObjectStore();
for (auto texture : texture_ids) {
env.abandonTexture(texture);
getGLObjectStore->abandonTexture(texture);
}
texture_ids.clear();
}