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

Side by Side Diff: ui/gl/gl_bindings.h

Issue 16894002: Unset GL Api when releasing a context. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | ui/gl/gl_context.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_GL_GL_BINDINGS_H_ 5 #ifndef UI_GL_GL_BINDINGS_H_
6 #define UI_GL_GL_BINDINGS_H_ 6 #define UI_GL_GL_BINDINGS_H_
7 7
8 // Includes the platform independent and platform dependent GL headers. 8 // Includes the platform independent and platform dependent GL headers.
9 // Only include this in cc files. It pulls in system headers, including 9 // Only include this in cc files. It pulls in system headers, including
10 // the X11 headers on linux, which define all kinds of macros that are 10 // the X11 headers on linux, which define all kinds of macros that are
11 // liable to cause conflicts. 11 // liable to cause conflicts.
12 12
13 #include <GL/gl.h> 13 #include <GL/gl.h>
14 #include <GL/glext.h> 14 #include <GL/glext.h>
15 #include <EGL/egl.h> 15 #include <EGL/egl.h>
16 #include <EGL/eglext.h> 16 #include <EGL/eglext.h>
17 17
18 #include "base/lazy_instance.h"
18 #include "base/logging.h" 19 #include "base/logging.h"
20 #include "base/threading/thread_local.h"
19 #include "build/build_config.h" 21 #include "build/build_config.h"
20 #include "ui/gl/gl_export.h" 22 #include "ui/gl/gl_export.h"
21 23
22 // The standard OpenGL native extension headers are also included. 24 // The standard OpenGL native extension headers are also included.
23 #if defined(OS_WIN) 25 #if defined(OS_WIN)
24 #include <GL/wglext.h> 26 #include <GL/wglext.h>
25 #elif defined(OS_MACOSX) 27 #elif defined(OS_MACOSX)
26 #include <OpenGL/OpenGL.h> 28 #include <OpenGL/OpenGL.h>
27 #elif defined(USE_X11) 29 #elif defined(USE_X11)
28 #include <GL/glx.h> 30 #include <GL/glx.h>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 void InitializeDebugBindings(); 280 void InitializeDebugBindings();
279 void ClearBindings(); 281 void ClearBindings();
280 void UpdateDebugExtensionBindings(); 282 void UpdateDebugExtensionBindings();
281 283
282 ProcsGLX fn; 284 ProcsGLX fn;
283 ProcsGLX debug_fn; 285 ProcsGLX debug_fn;
284 ExtensionsGLX ext; 286 ExtensionsGLX ext;
285 }; 287 };
286 #endif 288 #endif
287 289
288 GL_EXPORT extern GLApi* g_current_gl_context; 290 #define g_current_gl_context g_current_gl_context_tls.Pointer()->Get()
no sievers 2013/06/12 23:34:59 I did this hack for the autogenerated code.
291 GL_EXPORT extern base::LazyInstance<base::ThreadLocalPointer<GLApi> >
292 g_current_gl_context_tls;
289 GL_EXPORT extern OSMESAApi* g_current_osmesa_context; 293 GL_EXPORT extern OSMESAApi* g_current_osmesa_context;
290 GL_EXPORT extern DriverGL g_driver_gl; 294 GL_EXPORT extern DriverGL g_driver_gl;
291 GL_EXPORT extern DriverOSMESA g_driver_osmesa; 295 GL_EXPORT extern DriverOSMESA g_driver_osmesa;
292 296
293 #if defined(OS_WIN) 297 #if defined(OS_WIN)
294 298
295 GL_EXPORT extern EGLApi* g_current_egl_context; 299 GL_EXPORT extern EGLApi* g_current_egl_context;
296 GL_EXPORT extern WGLApi* g_current_wgl_context; 300 GL_EXPORT extern WGLApi* g_current_wgl_context;
297 GL_EXPORT extern DriverEGL g_driver_egl; 301 GL_EXPORT extern DriverEGL g_driver_egl;
298 GL_EXPORT extern DriverWGL g_driver_wgl; 302 GL_EXPORT extern DriverWGL g_driver_wgl;
(...skipping 16 matching lines...) Expand all
315 GL_EXPORT extern DriverEGL g_driver_egl; 319 GL_EXPORT extern DriverEGL g_driver_egl;
316 320
317 #endif 321 #endif
318 322
319 // Find an entry point to the mock GL implementation. 323 // Find an entry point to the mock GL implementation.
320 void* GL_BINDING_CALL GetMockGLProcAddress(const char* name); 324 void* GL_BINDING_CALL GetMockGLProcAddress(const char* name);
321 325
322 } // namespace gfx 326 } // namespace gfx
323 327
324 #endif // UI_GL_GL_BINDINGS_H_ 328 #endif // UI_GL_GL_BINDINGS_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698