diff options
author | Eric Anholt <eric@anholt.net> | 2010-02-04 23:57:43 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-02-05 00:12:12 -0800 |
commit | 297b0ab47fa63ef99e65b6834b731c260ea3e941 (patch) | |
tree | 8e17df14ccf8572806755a2f3e8422974bad1bfc /boilerplate | |
parent | 6708bc0593a649d083ede429ae73f06691edc018 (diff) |
[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.
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/cairo-boilerplate-gl.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/boilerplate/cairo-boilerplate-gl.c b/boilerplate/cairo-boilerplate-gl.c index d4f5e377..05c2d044 100644 --- a/boilerplate/cairo-boilerplate-gl.c +++ b/boilerplate/cairo-boilerplate-gl.c @@ -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; |