| OLD | NEW |
| 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 | |
| 18 namespace gles2 { | 12 namespace gles2 { |
| 19 | 13 |
| 20 extern THREAD_LOCAL gpu::gles2::GLES2Implementation* g_gl_impl; | 14 // Initialize the GLES2 library. |
| 15 void Initialize(); |
| 21 | 16 |
| 22 inline gpu::gles2::GLES2Implementation* GetGLContext() { | 17 // Terminate the GLES2 library. |
| 23 return g_gl_impl; | 18 void Terminate(); |
| 24 } | |
| 25 | 19 |
| 26 inline void SetGLContext(gpu::gles2::GLES2Implementation* impl) { | 20 // Get the current GL context. |
| 27 g_gl_impl = impl; | 21 gpu::gles2::GLES2Implementation* GetGLContext(); |
| 28 } | 22 |
| 23 // Set the current GL context. |
| 24 void SetGLContext(gpu::gles2::GLES2Implementation* impl); |
| 29 | 25 |
| 30 } // namespace gles2 | 26 } // namespace gles2 |
| 31 | 27 |
| 32 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ | 28 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ |
| OLD | NEW |