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

Unified Diff: ui/gl/gl_bindings_autogen_glx.cc

Issue 893213002: Revert of Make GL bindings conditional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_bindings_autogen_gl.cc ('k') | ui/gl/gl_bindings_autogen_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_bindings_autogen_glx.cc
diff --git a/ui/gl/gl_bindings_autogen_glx.cc b/ui/gl/gl_bindings_autogen_glx.cc
index ca36b7aa00c18877cbe10e2086419dc4c9f1e6ee..896f2cfd20a07409c6c067a8f98a3350f8a57ff8 100644
--- a/ui/gl/gl_bindings_autogen_glx.cc
+++ b/ui/gl/gl_bindings_autogen_glx.cc
@@ -24,17 +24,21 @@
DriverGLX g_driver_glx;
void DriverGLX::InitializeStaticBindings() {
- fn.glXBindTexImageEXTFn = 0;
+ fn.glXBindTexImageEXTFn = reinterpret_cast<glXBindTexImageEXTProc>(
+ GetGLProcAddress("glXBindTexImageEXT"));
fn.glXChooseFBConfigFn = reinterpret_cast<glXChooseFBConfigProc>(
GetGLProcAddress("glXChooseFBConfig"));
fn.glXChooseVisualFn = reinterpret_cast<glXChooseVisualProc>(
GetGLProcAddress("glXChooseVisual"));
fn.glXCopyContextFn =
reinterpret_cast<glXCopyContextProc>(GetGLProcAddress("glXCopyContext"));
- fn.glXCopySubBufferMESAFn = 0;
+ fn.glXCopySubBufferMESAFn = reinterpret_cast<glXCopySubBufferMESAProc>(
+ GetGLProcAddress("glXCopySubBufferMESA"));
fn.glXCreateContextFn = reinterpret_cast<glXCreateContextProc>(
GetGLProcAddress("glXCreateContext"));
- fn.glXCreateContextAttribsARBFn = 0;
+ fn.glXCreateContextAttribsARBFn =
+ reinterpret_cast<glXCreateContextAttribsARBProc>(
+ GetGLProcAddress("glXCreateContextAttribsARB"));
fn.glXCreateGLXPixmapFn = reinterpret_cast<glXCreateGLXPixmapProc>(
GetGLProcAddress("glXCreateGLXPixmap"));
fn.glXCreateNewContextFn = reinterpret_cast<glXCreateNewContextProc>(
@@ -70,13 +74,17 @@
GetGLProcAddress("glXGetCurrentReadDrawable"));
fn.glXGetFBConfigAttribFn = reinterpret_cast<glXGetFBConfigAttribProc>(
GetGLProcAddress("glXGetFBConfigAttrib"));
- fn.glXGetFBConfigFromVisualSGIXFn = 0;
+ fn.glXGetFBConfigFromVisualSGIXFn =
+ reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>(
+ GetGLProcAddress("glXGetFBConfigFromVisualSGIX"));
fn.glXGetFBConfigsFn = reinterpret_cast<glXGetFBConfigsProc>(
GetGLProcAddress("glXGetFBConfigs"));
- fn.glXGetMscRateOMLFn = 0;
+ fn.glXGetMscRateOMLFn = reinterpret_cast<glXGetMscRateOMLProc>(
+ GetGLProcAddress("glXGetMscRateOML"));
fn.glXGetSelectedEventFn = reinterpret_cast<glXGetSelectedEventProc>(
GetGLProcAddress("glXGetSelectedEvent"));
- fn.glXGetSyncValuesOMLFn = 0;
+ fn.glXGetSyncValuesOMLFn = reinterpret_cast<glXGetSyncValuesOMLProc>(
+ GetGLProcAddress("glXGetSyncValuesOML"));
fn.glXGetVisualFromFBConfigFn =
reinterpret_cast<glXGetVisualFromFBConfigProc>(
GetGLProcAddress("glXGetVisualFromFBConfig"));
@@ -99,21 +107,30 @@
GetGLProcAddress("glXQueryServerString"));
fn.glXQueryVersionFn = reinterpret_cast<glXQueryVersionProc>(
GetGLProcAddress("glXQueryVersion"));
- fn.glXReleaseTexImageEXTFn = 0;
+ fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>(
+ GetGLProcAddress("glXReleaseTexImageEXT"));
fn.glXSelectEventFn =
reinterpret_cast<glXSelectEventProc>(GetGLProcAddress("glXSelectEvent"));
fn.glXSwapBuffersFn =
reinterpret_cast<glXSwapBuffersProc>(GetGLProcAddress("glXSwapBuffers"));
- fn.glXSwapIntervalEXTFn = 0;
- fn.glXSwapIntervalMESAFn = 0;
+ fn.glXSwapIntervalEXTFn = reinterpret_cast<glXSwapIntervalEXTProc>(
+ GetGLProcAddress("glXSwapIntervalEXT"));
+ fn.glXSwapIntervalMESAFn = reinterpret_cast<glXSwapIntervalMESAProc>(
+ GetGLProcAddress("glXSwapIntervalMESA"));
fn.glXUseXFontFn =
reinterpret_cast<glXUseXFontProc>(GetGLProcAddress("glXUseXFont"));
fn.glXWaitGLFn =
reinterpret_cast<glXWaitGLProc>(GetGLProcAddress("glXWaitGL"));
- fn.glXWaitVideoSyncSGIFn = 0;
+ fn.glXWaitVideoSyncSGIFn = reinterpret_cast<glXWaitVideoSyncSGIProc>(
+ GetGLProcAddress("glXWaitVideoSyncSGI"));
fn.glXWaitXFn = reinterpret_cast<glXWaitXProc>(GetGLProcAddress("glXWaitX"));
- std::string extensions(GetPlatformExtensions());
- extensions += " ";
+}
+
+void DriverGLX::InitializeDynamicBindings(GLContext* context) {
+ DCHECK(context && context->IsCurrent(NULL));
+ const GLVersionInfo* ver = context->GetVersionInfo();
+ ALLOW_UNUSED_LOCAL(ver);
+ std::string extensions = context->GetExtensions() + " ";
ALLOW_UNUSED_LOCAL(extensions);
ext.b_GLX_ARB_create_context =
@@ -133,78 +150,6 @@
ext.b_GLX_SGI_video_sync =
extensions.find("GLX_SGI_video_sync ") != std::string::npos;
- debug_fn.glXBindTexImageEXTFn = 0;
- if (ext.b_GLX_EXT_texture_from_pixmap) {
- fn.glXBindTexImageEXTFn = reinterpret_cast<glXBindTexImageEXTProc>(
- GetGLProcAddress("glXBindTexImageEXT"));
- DCHECK(fn.glXBindTexImageEXTFn);
- }
-
- debug_fn.glXCopySubBufferMESAFn = 0;
- if (ext.b_GLX_MESA_copy_sub_buffer) {
- fn.glXCopySubBufferMESAFn = reinterpret_cast<glXCopySubBufferMESAProc>(
- GetGLProcAddress("glXCopySubBufferMESA"));
- DCHECK(fn.glXCopySubBufferMESAFn);
- }
-
- debug_fn.glXCreateContextAttribsARBFn = 0;
- if (ext.b_GLX_ARB_create_context) {
- fn.glXCreateContextAttribsARBFn =
- reinterpret_cast<glXCreateContextAttribsARBProc>(
- GetGLProcAddress("glXCreateContextAttribsARB"));
- DCHECK(fn.glXCreateContextAttribsARBFn);
- }
-
- debug_fn.glXGetFBConfigFromVisualSGIXFn = 0;
- if (ext.b_GLX_SGIX_fbconfig) {
- fn.glXGetFBConfigFromVisualSGIXFn =
- reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>(
- GetGLProcAddress("glXGetFBConfigFromVisualSGIX"));
- DCHECK(fn.glXGetFBConfigFromVisualSGIXFn);
- }
-
- debug_fn.glXGetMscRateOMLFn = 0;
- if (ext.b_GLX_OML_sync_control) {
- fn.glXGetMscRateOMLFn = reinterpret_cast<glXGetMscRateOMLProc>(
- GetGLProcAddress("glXGetMscRateOML"));
- DCHECK(fn.glXGetMscRateOMLFn);
- }
-
- debug_fn.glXGetSyncValuesOMLFn = 0;
- if (ext.b_GLX_OML_sync_control) {
- fn.glXGetSyncValuesOMLFn = reinterpret_cast<glXGetSyncValuesOMLProc>(
- GetGLProcAddress("glXGetSyncValuesOML"));
- DCHECK(fn.glXGetSyncValuesOMLFn);
- }
-
- debug_fn.glXReleaseTexImageEXTFn = 0;
- if (ext.b_GLX_EXT_texture_from_pixmap) {
- fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>(
- GetGLProcAddress("glXReleaseTexImageEXT"));
- DCHECK(fn.glXReleaseTexImageEXTFn);
- }
-
- debug_fn.glXSwapIntervalEXTFn = 0;
- if (ext.b_GLX_EXT_swap_control) {
- fn.glXSwapIntervalEXTFn = reinterpret_cast<glXSwapIntervalEXTProc>(
- GetGLProcAddress("glXSwapIntervalEXT"));
- DCHECK(fn.glXSwapIntervalEXTFn);
- }
-
- debug_fn.glXSwapIntervalMESAFn = 0;
- if (ext.b_GLX_MESA_swap_control) {
- fn.glXSwapIntervalMESAFn = reinterpret_cast<glXSwapIntervalMESAProc>(
- GetGLProcAddress("glXSwapIntervalMESA"));
- DCHECK(fn.glXSwapIntervalMESAFn);
- }
-
- debug_fn.glXWaitVideoSyncSGIFn = 0;
- if (ext.b_GLX_SGI_video_sync) {
- fn.glXWaitVideoSyncSGIFn = reinterpret_cast<glXWaitVideoSyncSGIProc>(
- GetGLProcAddress("glXWaitVideoSyncSGI"));
- DCHECK(fn.glXWaitVideoSyncSGIFn);
- }
-
if (g_debugBindingsInitialized)
InitializeDebugBindings();
}
« no previous file with comments | « ui/gl/gl_bindings_autogen_gl.cc ('k') | ui/gl/gl_bindings_autogen_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698