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

Side by Side Diff: gpu/command_buffer/client/gles2_lib.h

Issue 549090: Added pglGetCurrentContext. Make gles2 implementation pointer global variable... (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_lib.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // These functions emluate GLES2 over command buffers. 5 // These functions emluate GLES2 over command buffers.
6 6
7 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_
8 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ 8 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_
9 9
10 #include "gpu/command_buffer/client/gles2_implementation.h" 10 #include "gpu/command_buffer/client/gles2_implementation.h"
11 11
12 #if defined(_MSC_VER)
13 #define THREAD_LOCAL __declspec(thread)
14 #else
15 #define THREAD_LOCAL __thread
16 #endif
17
12 namespace gles2 { 18 namespace gles2 {
13 19
14 extern ::gpu::gles2::GLES2Implementation* g_gl_impl; 20 extern THREAD_LOCAL gpu::gles2::GLES2Implementation* g_gl_impl;
15 21
16 inline ::gpu::gles2::GLES2Implementation* GetGLContext() { 22 inline gpu::gles2::GLES2Implementation* GetGLContext() {
17 return g_gl_impl; 23 return g_gl_impl;
18 } 24 }
19 25
20 // Initializes the GLES2 library. 26 inline void SetGLContext(gpu::gles2::GLES2Implementation* impl) {
21 bool InitGLES2Lib(); 27 g_gl_impl = impl;
28 }
22 29
23 } // namespace gles2 30 } // namespace gles2
24 31
25 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ 32 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_
26
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_lib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698