summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor_glx_provider.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/glamor/glamor_glx_provider.c b/glamor/glamor_glx_provider.c
index 8a8239f68..77ccc3c8b 100644
--- a/glamor/glamor_glx_provider.c
+++ b/glamor/glamor_glx_provider.c
@@ -142,7 +142,8 @@ egl_create_glx_drawable(ClientPtr client, __GLXscreen *screen,
static struct egl_config *
translate_eglconfig(struct egl_screen *screen, EGLConfig hc,
struct egl_config *chain, Bool direct_color,
- Bool duplicate_for_composite, Bool srgb_only)
+ Bool double_buffer, Bool duplicate_for_composite,
+ Bool srgb_only)
{
EGLint value;
struct egl_config *c = calloc(1, sizeof *c);
@@ -190,8 +191,10 @@ translate_eglconfig(struct egl_screen *screen, EGLConfig hc,
else
c->base.visualType = GLX_TRUE_COLOR;
- /* We choose not to implement front-buffer-only configs */
- c->base.doubleBufferMode = GL_TRUE;
+ if (double_buffer)
+ c->base.doubleBufferMode = GL_TRUE;
+ else
+ c->base.doubleBufferMode = GL_FALSE;
/* direct-mapped state */
#define GET(attr, slot) \
@@ -317,7 +320,7 @@ translate_eglconfig(struct egl_screen *screen, EGLConfig hc,
static __GLXconfig *
egl_mirror_configs(ScreenPtr pScreen, struct egl_screen *screen)
{
- int i, j, nconfigs;
+ int i, j, k, nconfigs;
struct egl_config *c = NULL;
EGLConfig *host_configs = NULL;
bool can_srgb = epoxy_has_gl_extension("GL_ARB_framebuffer_sRGB") ||
@@ -334,18 +337,21 @@ egl_mirror_configs(ScreenPtr pScreen, struct egl_screen *screen)
* ->next chain easier.
*/
for (i = nconfigs - 1; i >= 0; i--)
- for (j = 0; j < 3; j++) { /* direct_color */
- if (can_srgb)
+ for (j = 0; j < 3; j++) /* direct_color */
+ for (k = 0; k < 2; k++) /* double_buffer */ {
+ if (can_srgb)
+ c = translate_eglconfig(screen, host_configs[i], c,
+ /* direct_color */ j == 1,
+ /* double_buffer */ k > 0,
+ /* duplicate_for_composite */ j == 0,
+ /* srgb_only */ true);
+
c = translate_eglconfig(screen, host_configs[i], c,
/* direct_color */ j == 1,
+ /* double_buffer */ k > 0,
/* duplicate_for_composite */ j == 0,
- /* srgb_only */ true);
-
- c = translate_eglconfig(screen, host_configs[i], c,
- /* direct_color */ j == 1,
- /* duplicate_for_composite */ j == 0,
- /* srgb_only */ false);
- }
+ /* srgb_only */ false);
+ }
screen->configs = host_configs;
return c ? &c->base : NULL;