diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-06-25 00:10:34 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-06-25 16:26:21 +0300 |
commit | e32b0b7e20179c24ffa12325b4d5e184941acbb8 (patch) | |
tree | d724bae0b0f3d949cde4b0fed3e879d8c6a9a45d /src/mbgl/util/thread_context.hpp | |
parent | be4cb6786babca3368b10e2c1c1aaa9eb43e5663 (diff) | |
download | qtlocation-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.hpp | 11 |
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; |