Bug 715952 - glxtest incorrectly creates the backing pixmap and causes X errors - r=bjacob
authorNicholas Miell <nmiell@gmail.com>
Sat, 07 Jan 2012 18:45:48 -0500
changeset 85247 23d71e342b3e8d1d5afe4942001a1547d5c3f06b
parent 85246 33359378d8f80f88796c969cd30e862f46191fce
child 85248 cddeb9fcc249fdbac692d74275f6395c4118bb9a
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs715952
milestone12.0a1
Bug 715952 - glxtest incorrectly creates the backing pixmap and causes X errors - r=bjacob Was always using 32bit depth, disregarding the actual depth of the FBConfig. This was causing a X error on Mesa sofware renderers.
toolkit/xre/glxtest.cpp
--- a/toolkit/xre/glxtest.cpp
+++ b/toolkit/xre/glxtest.cpp
@@ -197,17 +197,17 @@ static void glxtest()
   GLXFBConfig *fbConfigs = glXChooseFBConfig(dpy, DefaultScreen(dpy), attribs, &numReturned );
   if (!fbConfigs)
     fatal_error("No FBConfigs found");
   XVisualInfo *vInfo = glXGetVisualFromFBConfig(dpy, fbConfigs[0]);
   if (!vInfo)
     fatal_error("No visual found for first FBConfig");
 
   ///// Get a Pixmap and a GLXPixmap /////
-  Pixmap pixmap = XCreatePixmap(dpy, RootWindow(dpy, vInfo->screen), 4, 4, 32);
+  Pixmap pixmap = XCreatePixmap(dpy, RootWindow(dpy, vInfo->screen), 4, 4, vInfo->depth);
   GLXPixmap glxpixmap = glXCreatePixmap(dpy, fbConfigs[0], pixmap, NULL);
 
   ///// Get a GL context and make it current //////
   GLXContext context = glXCreateNewContext(dpy, fbConfigs[0], GLX_RGBA_TYPE, NULL, True);
   glXMakeCurrent(dpy, glxpixmap, context);
 
   ///// Look for this symbol to determine texture_from_pixmap support /////
   void* glXBindTexImageEXT = glXGetProcAddress("glXBindTexImageEXT");