[gl] When making a boilerplate GLX window, ensure it has alpha.

cairo_gl_surface_create_for_window assumes CONTENT_COLOR_ALPHA, so
make sure the fbconfig we choose is good enough.  Fixes gl-window
testcase results to basically match the non-window testcases.
This commit is contained in:
Eric Anholt 2010-02-04 23:57:43 -08:00
parent 6708bc0593
commit 297b0ab47f

View file

@ -149,12 +149,13 @@ _cairo_boilerplate_gl_create_window (const char *name,
int id,
void **closure)
{
int rgb_attribs[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
None };
int rgba_attribs[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_ALPHA_SIZE, 1,
GLX_DOUBLEBUFFER,
None };
XVisualInfo *vi;
GLXContext ctx;
gl_target_closure_t *gltc;
@ -181,9 +182,9 @@ _cairo_boilerplate_gl_create_window (const char *name,
if (mode == CAIRO_BOILERPLATE_MODE_TEST)
XSynchronize (gltc->dpy, 1);
vi = glXChooseVisual (dpy, DefaultScreen (dpy), rgb_attribs);
vi = glXChooseVisual (dpy, DefaultScreen (dpy), rgba_attribs);
if (vi == NULL) {
fprintf (stderr, "Failed to create RGB, double-buffered visual\n");
fprintf (stderr, "Failed to create RGBA, double-buffered visual\n");
XCloseDisplay (dpy);
free (gltc);
return NULL;