summaryrefslogtreecommitdiff
path: root/src/mbgl/util/thread_context.hpp
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-06-25 00:10:34 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-06-25 16:26:21 +0300
commite32b0b7e20179c24ffa12325b4d5e184941acbb8 (patch)
treed724bae0b0f3d949cde4b0fed3e879d8c6a9a45d /src/mbgl/util/thread_context.hpp
parentbe4cb6786babca3368b10e2c1c1aaa9eb43e5663 (diff)
downloadqtlocation-mapboxgl-e32b0b7e20179c24ffa12325b4d5e184941acbb8.tar.gz
Introduce GLObjectStore
Make a class for keeping GL objects ids and attach it to the ThreadContext instead of hanging it on the Environment.
Diffstat (limited to 'src/mbgl/util/thread_context.hpp')
-rw-r--r--src/mbgl/util/thread_context.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mbgl/util/thread_context.hpp b/src/mbgl/util/thread_context.hpp
index c22f513289..a2be0cd364 100644
--- a/src/mbgl/util/thread_context.hpp
+++ b/src/mbgl/util/thread_context.hpp
@@ -13,6 +13,8 @@ class FileSource;
namespace util {
+class GLObjectStore;
+
enum class ThreadPriority : bool {
Regular,
Low,
@@ -49,12 +51,21 @@ public:
current.get()->fileSource = fileSource;
}
+ static GLObjectStore* getGLObjectStore() {
+ return current.get()->glObjectStore;
+ }
+
+ static void setGLObjectStore(GLObjectStore* glObjectStore) {
+ current.get()->glObjectStore = glObjectStore;
+ }
+
private:
std::string name;
ThreadType type;
ThreadPriority priority;
FileSource* fileSource = nullptr;
+ GLObjectStore* glObjectStore = nullptr;
static uv::tls<ThreadContext> current;