diff --git a/drape/glfunctions.cpp b/drape/glfunctions.cpp index 26b4049d98..edca2002b4 100644 --- a/drape/glfunctions.cpp +++ b/drape/glfunctions.cpp @@ -8,8 +8,6 @@ #include "base/mutex.hpp" #include "base/string_utils.hpp" -#include "std/thread.hpp" - #ifdef DEBUG #include "base/thread.hpp" #include "std/map.hpp" @@ -448,9 +446,9 @@ void GLFunctions::Init() glUniformMatrix4fvFn = LOAD_GL_FUNC(TglUniformMatrix4fvFn, glUniformMatrix4fv); } -void GLFunctions::EnableCache() +void GLFunctions::AttachCache(thread::id const & threadId) { - s_cache.SetThread(this_thread::get_id()); + s_cache.SetThread(threadId); } bool GLFunctions::glHasExtension(string const & name) diff --git a/drape/glfunctions.hpp b/drape/glfunctions.hpp index 400c184ad4..b0a15f10d7 100644 --- a/drape/glfunctions.hpp +++ b/drape/glfunctions.hpp @@ -5,6 +5,7 @@ #include "base/src_point.hpp" #include "std/string.hpp" +#include "std/thread.hpp" class GLFunctions { @@ -13,10 +14,10 @@ class GLFunctions public: static void Init(); - /// Enables cache of gl-functions. The only cache is available, - /// so invoking of this method on other thread leads to disabling - /// of current cache and enabling another - static void EnableCache(); + /// Attaches cache of gl-functions to specified thread. The only cache + /// is available, so invoking of this method on other thread leads to + /// disabling of current cache and enabling another + static void AttachCache(thread::id const & threadId); static bool glHasExtension(string const & name); static void glClearColor(float r, float g, float b, float a); diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp index 941eace6c9..21ebc152cc 100755 --- a/drape_frontend/frontend_renderer.cpp +++ b/drape_frontend/frontend_renderer.cpp @@ -724,7 +724,7 @@ void FrontendRenderer::Routine::Do() dp::OGLContext * context = m_renderer.m_contextFactory->getDrawContext(); context->makeCurrent(); GLFunctions::Init(); - GLFunctions::EnableCache(); + GLFunctions::AttachCache(this_thread::get_id()); GLFunctions::glPixelStore(gl_const::GLUnpackAlignment, 1); GLFunctions::glEnable(gl_const::GLDepthTest);