glx/dri: add initial dri interface for GLX_EXT_framebuffer_sRGB.
authorDave Airlie <airlied@redhat.com>
Sun, 6 Mar 2011 10:06:42 +0000 (20:06 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 6 Mar 2011 10:06:42 +0000 (20:06 +1000)
This realigns the name of the glx bit to align with the core mesa names.

src/glx/dri_common.c
src/glx/glxconfig.c
src/glx/glxconfig.h
src/glx/glxext.c
src/mesa/drivers/dri/common/utils.c

index 83d6e3c31082ca22420e58468be3535ce268bb66..06a73e4a6b25039c32bec1181bced5f2780b8400 100644 (file)
@@ -222,7 +222,9 @@ __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),
       __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba),
       __ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE,
                      bindToMipmapTexture),
-      __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),};
+      __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),
+      __ATTRIB(__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE, sRGBCapable)
+};
 
 static int
 scalarEqual(struct glx_config *mode, unsigned int attrib, unsigned int value)
index 805c301efb46ab497f94d9767befe75f9433c548..c3e1d5a568044067816f2d662ec74ac8951f20c8 100644 (file)
@@ -189,7 +189,7 @@ glx_config_get(struct glx_config * mode, int attribute, int *value_return)
       return 0;
 
    case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
-      *value_return = mode->framebuffer_srgb_capable;
+      *value_return = mode->sRGBCapable;
       return 0;
 
       /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX.
@@ -255,7 +255,7 @@ glx_config_create_list(unsigned count)
       (*next)->bindToMipmapTexture = GLX_DONT_CARE;
       (*next)->bindToTextureTargets = GLX_DONT_CARE;
       (*next)->yInverted = GLX_DONT_CARE;
-      (*next)->framebuffer_srgb_capable = GLX_DONT_CARE;
+      (*next)->sRGBCapable = GLX_DONT_CARE;
 
       next = &((*next)->next);
    }
index a587612cc456246548e5447cc4ae43ad0c676eef..2f1074ca5fa376129813a481af96efc90cd9a564 100644 (file)
@@ -102,7 +102,7 @@ struct glx_config {
     GLint yInverted;
 
     /* EXT_framebuffer_sRGB */
-    GLint framebuffer_srgb_capable;
+    GLint sRGBCapable;
 };
 
 #define __GLX_MIN_CONFIG_PROPS 18
index 38622f382645c7a590cd2f6c5f6d2dd4649775be..e35dcb73e89538802200c8db047e9ed4e60e5e79 100644 (file)
@@ -547,7 +547,7 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count,
          break;
 #endif
       case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
-         config->framebuffer_srgb_capable = *bp++;
+         config->sRGBCapable = *bp++;
          break;
 
       case GLX_USE_GL:
index 42be77fd7c46ef7241f94bf3f6f7f4b98ed95d88..083edfaa9b40955315e4f43ad85e0d6065680874 100644 (file)
@@ -648,6 +648,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
                        __DRI_ATTRIB_TEXTURE_1D_BIT |
                        __DRI_ATTRIB_TEXTURE_2D_BIT |
                        __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT;
+
+                   modes->sRGBCapable = GL_FALSE;
                }
            }
        }
@@ -727,6 +729,7 @@ static const struct { unsigned int attrib, offset; } attribMap[] = {
     __ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE,      bindToMipmapTexture),
     __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS,     bindToTextureTargets),
     __ATTRIB(__DRI_ATTRIB_YINVERTED,                   yInverted),
+    __ATTRIB(__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE,    sRGBCapable),
 
     /* The struct field doesn't matter here, these are handled by the
      * switch in driGetConfigAttribIndex.  We need them in the array