summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 22:15:39 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 22:15:39 +0000
commit98c41b12a3dd200ba88db7c3c8ab8740da4ead90 (patch)
treec9f51c66b7419181de6f30e0b73f1feff306df49 /gpu/command_buffer/client
parent684666433198b901c53e10f40f2d3a2b4d5a7be1 (diff)
downloadchromium_src-98c41b12a3dd200ba88db7c3c8ab8740da4ead90.zip
chromium_src-98c41b12a3dd200ba88db7c3c8ab8740da4ead90.tar.gz
chromium_src-98c41b12a3dd200ba88db7c3c8ab8740da4ead90.tar.bz2
Added pglGetCurrentContext. Make gles2 implementation pointer global variable thread local.
TEST=none BUG=none Review URL: http://codereview.chromium.org/549090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client')
-rw-r--r--gpu/command_buffer/client/gles2_lib.cc7
-rw-r--r--gpu/command_buffer/client/gles2_lib.h16
2 files changed, 12 insertions, 11 deletions
diff --git a/gpu/command_buffer/client/gles2_lib.cc b/gpu/command_buffer/client/gles2_lib.cc
index 87f74c4..cd7cfed 100644
--- a/gpu/command_buffer/client/gles2_lib.cc
+++ b/gpu/command_buffer/client/gles2_lib.cc
@@ -6,12 +6,7 @@
namespace gles2 {
-::gpu::gles2::GLES2Implementation* g_gl_impl;
-
-bool InitGLES2Lib() {
- // TODO(gman): Encapulate initalizing the GLES2 library for client apps.
- return false;
-}
+THREAD_LOCAL ::gpu::gles2::GLES2Implementation* g_gl_impl;
} // namespace gles2
diff --git a/gpu/command_buffer/client/gles2_lib.h b/gpu/command_buffer/client/gles2_lib.h
index b7fd864..e2825fa 100644
--- a/gpu/command_buffer/client/gles2_lib.h
+++ b/gpu/command_buffer/client/gles2_lib.h
@@ -9,18 +9,24 @@
#include "gpu/command_buffer/client/gles2_implementation.h"
+#if defined(_MSC_VER)
+#define THREAD_LOCAL __declspec(thread)
+#else
+#define THREAD_LOCAL __thread
+#endif
+
namespace gles2 {
-extern ::gpu::gles2::GLES2Implementation* g_gl_impl;
+extern THREAD_LOCAL gpu::gles2::GLES2Implementation* g_gl_impl;
-inline ::gpu::gles2::GLES2Implementation* GetGLContext() {
+inline gpu::gles2::GLES2Implementation* GetGLContext() {
return g_gl_impl;
}
-// Initializes the GLES2 library.
-bool InitGLES2Lib();
+inline void SetGLContext(gpu::gles2::GLES2Implementation* impl) {
+ g_gl_impl = impl;
+}
} // namespace gles2
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_
-