diff options
author | Jon Turney <[email protected]> | 2018-07-14 15:24:14 +0100 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2018-07-31 13:56:13 -0400 |
commit | faa29c0e2449e3d7521bc273d723012b537593df (patch) | |
tree | 5049a3f1f0c84ccb854cb789767336db3a1ab9b9 /src/glx/glxext.c | |
parent | 03a61b977e1f6adb64658aa059ce53e766ff9ad9 (diff) |
Make glXChooseFBConfig handle unspecified sRGB correctly
Make glXChooseFBConfig properly handle the case where the only matching
configs have the sRGB flag set, but no sRGB attribute is specified.
Since 6e06e281, the sRGBcapable flag is now actually compared, using
MATCH_DONT_CARE.
7b0f912e added defaulting of sRGBcapable to GL_FALSE in
__glXInitializeVisualConfigFromTags(), to handle servers which don't report
it, but this function is also used by glXChooseFBConfig(), so sRGBcapable is
implicitly false when not explicitly specified.
(This can cause e.g. glxinfo to fail to find anything matching the simple
config it looks for if all the candidates have the sRGB flag set to true.
I'm assuming this doesn't happen 'normally' as candidate configs with and
without sRGB true are available)
Move this defaulting to createConfigsFromProperties(), and set the default
for glXChooseFBConfig() in init_fbconfig_for_chooser() to GLX_DONT_CARE.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glx/glxext.c')
-rw-r--r-- | src/glx/glxext.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 5f23d3717a4..ca3bf9d027f 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -402,8 +402,6 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count, #endif } - config->sRGBCapable = GL_FALSE; - /* ** Additional properties may be in a list at the end ** of the reply. They are in pairs of property type @@ -660,6 +658,8 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops, */ m->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT; #endif + /* Older X servers don't send this so we default it here. */ + m->sRGBCapable = GL_FALSE; __glXInitializeVisualConfigFromTags(m, nprops, props, tagged_only, GL_TRUE); m->screen = screen; |