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