x11/gl: Do not use GLX_EXT_texture_from_pixmap if not available
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 26 Mar 2015 17:26:29 +0000 (17:26 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 26 Mar 2015 17:28:48 +0000 (17:28 +0000)
If the GLX_EXT_texture_from_pixmap extension is not available when we
did the extensions check, then there's no point in using the backend
specific code paths that rely on it.

gdk/x11/gdkglcontext-x11.c

index d9a49fdccb8c056bd46fe450d63fcbda0bdaa1b3..9bf8cc37af83858c9789d334b8bbd786494e0d42 100644 (file)
@@ -432,6 +432,11 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
   double sx, sy;
   float uscale, vscale;
   GdkTexturedQuad *quads;
+  GdkX11Display *display_x11;
+
+  display_x11 = GDK_X11_DISPLAY (gdk_gl_context_get_display (paint_context));
+  if (!display_x11->has_glx_texture_from_pixmap)
+    return FALSE;
 
   if (cairo_surface_get_type (surface) != CAIRO_SURFACE_TYPE_XLIB)
     return FALSE;