Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1067)

Unified Diff: gpu/command_buffer/client/gles2_lib.cc

Issue 553050: Windows now uses the TLS API instead of __declspec(thread) for client side co... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/gles2_lib.cc
===================================================================
--- gpu/command_buffer/client/gles2_lib.cc (revision 37133)
+++ gpu/command_buffer/client/gles2_lib.cc (working copy)
@@ -3,11 +3,29 @@
// found in the LICENSE file.
#include "gpu/command_buffer/client/gles2_lib.h"
+#include "gpu/command_buffer/common/thread_local.h"
namespace gles2 {
+namespace {
+gpu::ThreadLocalKey g_gl_context_key;
+} // namespace anonymous
-THREAD_LOCAL ::gpu::gles2::GLES2Implementation* g_gl_impl;
+void Initialize() {
+ g_gl_context_key = gpu::ThreadLocalAlloc();
+}
+void Terminate() {
+ gpu::ThreadLocalFree(g_gl_context_key);
+}
+
+gpu::gles2::GLES2Implementation* GetGLContext() {
+ return static_cast<gpu::gles2::GLES2Implementation*>(
+ gpu::ThreadLocalGetValue(g_gl_context_key));
+}
+
+void SetGLContext(gpu::gles2::GLES2Implementation* context) {
+ gpu::ThreadLocalSetValue(g_gl_context_key, context);
+}
} // namespace gles2

Powered by Google App Engine
This is Rietveld 408576698