summaryrefslogtreecommitdiffstats
path: root/ui/gl/gl_bindings.h
diff options
context:
space:
mode:
authorepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 11:51:52 +0000
committerepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 11:51:52 +0000
commit06a1a6929980f090136c63c0f232a1e9125d7360 (patch)
tree34b36f14c6fecdaf738e99493ee2acaf23ecf528 /ui/gl/gl_bindings.h
parent99001311b0a75e16e35b0b65245b78ffd4ed86ac (diff)
downloadchromium_src-06a1a6929980f090136c63c0f232a1e9125d7360.zip
chromium_src-06a1a6929980f090136c63c0f232a1e9125d7360.tar.gz
chromium_src-06a1a6929980f090136c63c0f232a1e9125d7360.tar.bz2
GPU: Use TLS pointer for GLApi.
This is straight from: https://codereview.chromium.org/16894002/ To support GL access on multiple threads, GL-API needs to be in TLS. It hasn't mattered previously in practice because our limited threaded GL calls were always forwarded to the right native calls. But as we improve virtual contexts and unset the API on ReleaseCurrent, this will no longer be the case. BUG=261264,263398 Review URL: https://chromiumcodereview.appspot.com/20014006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/gl_bindings.h')
-rw-r--r--ui/gl/gl_bindings.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/gl/gl_bindings.h b/ui/gl/gl_bindings.h
index c6a1eac..1c12a68 100644
--- a/ui/gl/gl_bindings.h
+++ b/ui/gl/gl_bindings.h
@@ -16,6 +16,7 @@
#include <EGL/eglext.h>
#include "base/logging.h"
+#include "base/threading/thread_local.h"
#include "build/build_config.h"
#include "ui/gl/gl_export.h"
@@ -299,7 +300,10 @@ struct GL_EXPORT DriverGLX {
};
#endif
-GL_EXPORT extern GLApi* g_current_gl_context;
+// This #define is here to support autogenerated code.
+#define g_current_gl_context g_current_gl_context_tls->Get()
+GL_EXPORT extern base::ThreadLocalPointer<GLApi>* g_current_gl_context_tls;
+
GL_EXPORT extern OSMESAApi* g_current_osmesa_context;
GL_EXPORT extern DriverGL g_driver_gl;
GL_EXPORT extern DriverOSMESA g_driver_osmesa;