[core] Thread GLObjectStore through to Holder objects

This eliminates the reliance on ThreadContext to provide GLObjectStore, and statically enforces that GL cleanup functions happen only when GLObjectStore::performCleanup is called.

With the elimination of the Map thread, this becomes important because there may be multiple GLObjectStore's per-thread, and Map will need to ensure that the correct context is active when calling GLObjectStore::performCleanup.
This commit is contained in:
John Firebaugh
2016-02-18 11:19:24 -08:00
parent 7b39ce9521
commit 9c26f06318
66 changed files with 313 additions and 321 deletions

View File

@@ -44,22 +44,6 @@ ThreadPriority ThreadContext::getPriority() {
}
}
gl::GLObjectStore* ThreadContext::getGLObjectStore() {
if (current.get() != nullptr) {
return current.get()->glObjectStore;
} else {
return nullptr;
}
}
void ThreadContext::setGLObjectStore(gl::GLObjectStore* glObjectStore) {
if (current.get() != nullptr) {
current.get()->glObjectStore = glObjectStore;
} else {
throw std::runtime_error("Current thread has no current ThreadContext.");
}
}
class MainThreadContextRegistrar {
public:
MainThreadContextRegistrar() : context("Main", ThreadType::Main, ThreadPriority::Regular) {