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

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

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed nits Created 7 years 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
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
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 #include "gl_bindings_autogen_glx.h" 218 #include "gl_bindings_autogen_glx.h"
219 #elif defined(USE_OZONE) 219 #elif defined(USE_OZONE)
220 #include "gl_bindings_autogen_egl.h" 220 #include "gl_bindings_autogen_egl.h"
221 #elif defined(OS_ANDROID) 221 #elif defined(OS_ANDROID)
222 #include "gl_bindings_autogen_egl.h" 222 #include "gl_bindings_autogen_egl.h"
223 #endif 223 #endif
224 224
225 namespace gfx { 225 namespace gfx {
226 226
227 struct GL_EXPORT DriverGL { 227 struct GL_EXPORT DriverGL {
228 void Initialize(); 228 void InitializeStaticBindings();
229 void InitializeExtensions(GLContext* context); 229 void InitializeDynamic(GLContext* context);
no sievers 2013/12/05 20:51:57 nit: InitializeDynamicBindings()
oetuaho 2013/12/09 17:17:07 This is intentional - the InitializeDynamicBinding
230 void InitializeDebugBindings(); 230 void InitializeDebugBindings();
231 void ClearBindings(); 231 void ClearBindings();
232 void UpdateDebugExtensionBindings();
233 232
234 ProcsGL fn; 233 ProcsGL fn;
235 ProcsGL orig_fn; 234 ProcsGL orig_fn;
236 ProcsGL debug_fn; 235 ProcsGL debug_fn;
237 ExtensionsGL ext; 236 ExtensionsGL ext;
238 237
239 private: 238 private:
240 void InitializeBindings(); 239 void InitializeDynamicBindings(GLContext* context);
241 void InitializeExtensionBindings(GLContext* context);
242 }; 240 };
243 241
244 struct GL_EXPORT DriverOSMESA { 242 struct GL_EXPORT DriverOSMESA {
245 void InitializeBindings(); 243 void InitializeStaticBindings();
246 void InitializeExtensionBindings(GLContext* context); 244 void InitializeDynamicBindings(GLContext* context);
247 void InitializeDebugBindings(); 245 void InitializeDebugBindings();
248 void ClearBindings(); 246 void ClearBindings();
249 void UpdateDebugExtensionBindings();
250 247
251 ProcsOSMESA fn; 248 ProcsOSMESA fn;
252 ProcsOSMESA debug_fn; 249 ProcsOSMESA debug_fn;
253 ExtensionsOSMESA ext; 250 ExtensionsOSMESA ext;
254 }; 251 };
255 252
256 #if defined(OS_WIN) 253 #if defined(OS_WIN)
257 struct GL_EXPORT DriverWGL { 254 struct GL_EXPORT DriverWGL {
258 void InitializeBindings(); 255 void InitializeStaticBindings();
259 void InitializeExtensionBindings(GLContext* context); 256 void InitializeDynamicBindings(GLContext* context);
260 void InitializeDebugBindings(); 257 void InitializeDebugBindings();
261 void ClearBindings(); 258 void ClearBindings();
262 void UpdateDebugExtensionBindings();
263 259
264 ProcsWGL fn; 260 ProcsWGL fn;
265 ProcsWGL debug_fn; 261 ProcsWGL debug_fn;
266 ExtensionsWGL ext; 262 ExtensionsWGL ext;
267 }; 263 };
268 #endif 264 #endif
269 265
270 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZ ONE) 266 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZ ONE)
271 struct GL_EXPORT DriverEGL { 267 struct GL_EXPORT DriverEGL {
272 void InitializeBindings(); 268 void InitializeStaticBindings();
273 void InitializeExtensionBindings(GLContext* context); 269 void InitializeDynamicBindings(GLContext* context);
274 void InitializeDebugBindings(); 270 void InitializeDebugBindings();
275 void ClearBindings(); 271 void ClearBindings();
276 void UpdateDebugExtensionBindings();
277 272
278 ProcsEGL fn; 273 ProcsEGL fn;
279 ProcsEGL debug_fn; 274 ProcsEGL debug_fn;
280 ExtensionsEGL ext; 275 ExtensionsEGL ext;
281 }; 276 };
282 #endif 277 #endif
283 278
284 #if defined(USE_X11) 279 #if defined(USE_X11)
285 struct GL_EXPORT DriverGLX { 280 struct GL_EXPORT DriverGLX {
286 void InitializeBindings(); 281 void InitializeStaticBindings();
287 void InitializeExtensionBindings(GLContext* context); 282 void InitializeDynamicBindings(GLContext* context);
288 void InitializeDebugBindings(); 283 void InitializeDebugBindings();
289 void ClearBindings(); 284 void ClearBindings();
290 void UpdateDebugExtensionBindings();
291 285
292 ProcsGLX fn; 286 ProcsGLX fn;
293 ProcsGLX debug_fn; 287 ProcsGLX debug_fn;
294 ExtensionsGLX ext; 288 ExtensionsGLX ext;
295 }; 289 };
296 #endif 290 #endif
297 291
298 // This #define is here to support autogenerated code. 292 // This #define is here to support autogenerated code.
299 #define g_current_gl_context g_current_gl_context_tls->Get() 293 #define g_current_gl_context g_current_gl_context_tls->Get()
300 GL_EXPORT extern base::ThreadLocalPointer<GLApi>* g_current_gl_context_tls; 294 GL_EXPORT extern base::ThreadLocalPointer<GLApi>* g_current_gl_context_tls;
(...skipping 27 matching lines...) Expand all
328 GL_EXPORT extern DriverEGL g_driver_egl; 322 GL_EXPORT extern DriverEGL g_driver_egl;
329 323
330 #endif 324 #endif
331 325
332 // Find an entry point to the mock GL implementation. 326 // Find an entry point to the mock GL implementation.
333 void* GL_BINDING_CALL GetMockGLProcAddress(const char* name); 327 void* GL_BINDING_CALL GetMockGLProcAddress(const char* name);
334 328
335 } // namespace gfx 329 } // namespace gfx
336 330
337 #endif // UI_GL_GL_BINDINGS_H_ 331 #endif // UI_GL_GL_BINDINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698