egl: fix EGL_MATCH_NATIVE_PIXMAP
authorChia-I Wu <olv@lunarg.com>
Sat, 25 Jun 2011 09:28:20 +0000 (18:28 +0900)
committerChia-I Wu <olv@lunarg.com>
Sat, 25 Jun 2011 09:51:11 +0000 (18:51 +0900)
EGL_MATCH_NATIVE_PIXMAP is valid for eglChooseConfig, but invalid for
eglGetConfigAttrib.

src/egl/main/eglconfig.c

index 1fd473d6208b53abc12da4574f530a8bd9e00bfe..55ce6fd2e09dab06cce969d85049bd57c226f7bb 100644 (file)
@@ -456,8 +456,6 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
       return EGL_FALSE;
 
    switch (attr) {
-   case EGL_MATCH_NATIVE_PIXMAP:
-      return EGL_FALSE;
    case EGL_Y_INVERTED_NOK:
       return conf->Display->Extensions.NOK_texture_from_pixmap;
    default:
@@ -767,6 +765,16 @@ _eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
 {
    if (!_eglIsConfigAttribValid(conf, attribute))
       return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
+
+   /* nonqueryable attributes */
+   switch (attribute) {
+   case EGL_MATCH_NATIVE_PIXMAP:
+      return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
+      break;
+   default:
+      break;
+   }
+
    if (!value)
       return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib");