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