egl: Surface type validaction should depend on extensions supported.
authorChia-I Wu <olvaffe@gmail.com>
Sun, 31 Jan 2010 06:39:06 +0000 (14:39 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Sun, 31 Jan 2010 06:46:15 +0000 (14:46 +0800)
EGL_SCREEN_BIT_MESA is a valid bit only when EGL_MESA_screen_surface is
supported.

src/egl/main/eglconfig.c

index 1a5fdbd4250e75823b8600fa62ab69c8f55d7397..635ffee92b2dead2b4c8c0b3dafae4cb85300b0a 100644 (file)
@@ -325,11 +325,12 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
             mask = EGL_PBUFFER_BIT |
                    EGL_PIXMAP_BIT |
                    EGL_WINDOW_BIT |
-                   EGL_SCREEN_BIT_MESA | /* XXX should check the extension */
                    EGL_VG_COLORSPACE_LINEAR_BIT |
                    EGL_VG_ALPHA_FORMAT_PRE_BIT |
                    EGL_MULTISAMPLE_RESOLVE_BOX_BIT |
                    EGL_SWAP_BEHAVIOR_PRESERVED_BIT;
+            if (conf->Display->Extensions.MESA_screen_surface)
+               mask |= EGL_SCREEN_BIT_MESA;
             break;
          case EGL_RENDERABLE_TYPE:
          case EGL_CONFORMANT: