OLD | NEW |
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 #include <string> | |
9 | |
10 // Includes the platform independent and platform dependent GL headers. | 8 // Includes the platform independent and platform dependent GL headers. |
11 // 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 |
12 // 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 |
13 // liable to cause conflicts. | 11 // liable to cause conflicts. |
14 | 12 |
15 #include <GL/gl.h> | 13 #include <GL/gl.h> |
16 #include <GL/glext.h> | 14 #include <GL/glext.h> |
17 #include <EGL/egl.h> | 15 #include <EGL/egl.h> |
18 #include <EGL/eglext.h> | 16 #include <EGL/eglext.h> |
19 | 17 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 ProcsGL debug_fn; | 338 ProcsGL debug_fn; |
341 ExtensionsGL ext; | 339 ExtensionsGL ext; |
342 bool null_draw_bindings_enabled; | 340 bool null_draw_bindings_enabled; |
343 | 341 |
344 private: | 342 private: |
345 void InitializeDynamicBindings(GLContext* context); | 343 void InitializeDynamicBindings(GLContext* context); |
346 }; | 344 }; |
347 | 345 |
348 struct GL_EXPORT DriverOSMESA { | 346 struct GL_EXPORT DriverOSMESA { |
349 void InitializeStaticBindings(); | 347 void InitializeStaticBindings(); |
| 348 void InitializeDynamicBindings(GLContext* context); |
350 void InitializeDebugBindings(); | 349 void InitializeDebugBindings(); |
351 void ClearBindings(); | 350 void ClearBindings(); |
352 | 351 |
353 ProcsOSMESA fn; | 352 ProcsOSMESA fn; |
354 ProcsOSMESA debug_fn; | 353 ProcsOSMESA debug_fn; |
355 ExtensionsOSMESA ext; | 354 ExtensionsOSMESA ext; |
356 | |
357 private: | |
358 static std::string GetPlatformExtensions(); | |
359 }; | 355 }; |
360 | 356 |
361 #if defined(OS_WIN) | 357 #if defined(OS_WIN) |
362 struct GL_EXPORT DriverWGL { | 358 struct GL_EXPORT DriverWGL { |
363 void InitializeStaticBindings(); | 359 void InitializeStaticBindings(); |
| 360 void InitializeDynamicBindings(GLContext* context); |
364 void InitializeDebugBindings(); | 361 void InitializeDebugBindings(); |
365 void ClearBindings(); | 362 void ClearBindings(); |
366 | 363 |
367 ProcsWGL fn; | 364 ProcsWGL fn; |
368 ProcsWGL debug_fn; | 365 ProcsWGL debug_fn; |
369 ExtensionsWGL ext; | 366 ExtensionsWGL ext; |
370 | |
371 private: | |
372 static std::string GetPlatformExtensions(); | |
373 }; | 367 }; |
374 #endif | 368 #endif |
375 | 369 |
376 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZ
ONE) | 370 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZ
ONE) |
377 struct GL_EXPORT DriverEGL { | 371 struct GL_EXPORT DriverEGL { |
378 void InitializeStaticBindings(); | 372 void InitializeStaticBindings(); |
| 373 void InitializeDynamicBindings(GLContext* context); |
379 void InitializeDebugBindings(); | 374 void InitializeDebugBindings(); |
380 void ClearBindings(); | 375 void ClearBindings(); |
381 | 376 |
382 ProcsEGL fn; | 377 ProcsEGL fn; |
383 ProcsEGL debug_fn; | 378 ProcsEGL debug_fn; |
384 ExtensionsEGL ext; | 379 ExtensionsEGL ext; |
385 | |
386 private: | |
387 static std::string GetPlatformExtensions(); | |
388 }; | 380 }; |
389 #endif | 381 #endif |
390 | 382 |
391 #if defined(USE_X11) | 383 #if defined(USE_X11) |
392 struct GL_EXPORT DriverGLX { | 384 struct GL_EXPORT DriverGLX { |
393 void InitializeStaticBindings(); | 385 void InitializeStaticBindings(); |
| 386 void InitializeDynamicBindings(GLContext* context); |
394 void InitializeDebugBindings(); | 387 void InitializeDebugBindings(); |
395 void ClearBindings(); | 388 void ClearBindings(); |
396 | 389 |
397 ProcsGLX fn; | 390 ProcsGLX fn; |
398 ProcsGLX debug_fn; | 391 ProcsGLX debug_fn; |
399 ExtensionsGLX ext; | 392 ExtensionsGLX ext; |
400 | |
401 private: | |
402 static std::string GetPlatformExtensions(); | |
403 }; | 393 }; |
404 #endif | 394 #endif |
405 | 395 |
406 // This #define is here to support autogenerated code. | 396 // This #define is here to support autogenerated code. |
407 #define g_current_gl_context g_current_gl_context_tls->Get() | 397 #define g_current_gl_context g_current_gl_context_tls->Get() |
408 GL_EXPORT extern base::ThreadLocalPointer<GLApi>* g_current_gl_context_tls; | 398 GL_EXPORT extern base::ThreadLocalPointer<GLApi>* g_current_gl_context_tls; |
409 | 399 |
410 GL_EXPORT extern OSMESAApi* g_current_osmesa_context; | 400 GL_EXPORT extern OSMESAApi* g_current_osmesa_context; |
411 GL_EXPORT extern DriverGL g_driver_gl; | 401 GL_EXPORT extern DriverGL g_driver_gl; |
412 GL_EXPORT extern DriverOSMESA g_driver_osmesa; | 402 GL_EXPORT extern DriverOSMESA g_driver_osmesa; |
(...skipping 20 matching lines...) Expand all Loading... |
433 #elif defined(OS_ANDROID) | 423 #elif defined(OS_ANDROID) |
434 | 424 |
435 GL_EXPORT extern EGLApi* g_current_egl_context; | 425 GL_EXPORT extern EGLApi* g_current_egl_context; |
436 GL_EXPORT extern DriverEGL g_driver_egl; | 426 GL_EXPORT extern DriverEGL g_driver_egl; |
437 | 427 |
438 #endif | 428 #endif |
439 | 429 |
440 } // namespace gfx | 430 } // namespace gfx |
441 | 431 |
442 #endif // UI_GL_GL_BINDINGS_H_ | 432 #endif // UI_GL_GL_BINDINGS_H_ |
OLD | NEW |