forked from organicmaps/organicmaps
Review fixes
This commit is contained in:
parent
02ab0073e8
commit
80c8646850
3 changed files with 8 additions and 9 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue