return matched;
}
+static INLINE EGLBoolean
+_eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
+{
+ if (_eglIndexConfig(conf, attr) < 0)
+ return EGL_FALSE;
+
+ /* there are some holes in the range */
+ switch (attr) {
+ case 0x3030 /* a gap before EGL_SAMPLES */:
+ case EGL_NONE:
+#ifdef EGL_VERSION_1_4
+ case EGL_MATCH_NATIVE_PIXMAP:
+#endif
+ return EGL_FALSE;
+ default:
+ break;
+ }
+
+ return EGL_TRUE;
+}
/**
* Initialize a criteria config from the given attribute list.
/* parse the list */
for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i += 2) {
- EGLint idx;
-
attr = attrib_list[i];
val = attrib_list[i + 1];
- idx = _eglIndexConfig(conf, attr);
- if (idx < 0)
- return EGL_FALSE;
- conf->Storage[idx] = val;
+ if (!_eglIsConfigAttribValid(conf, attr))
+ return EGL_FALSE;
+
+ SET_CONFIG_ATTRIB(conf, attr, val);
/* rememeber some attributes for post-processing */
switch (attr) {
}
-static INLINE EGLBoolean
-_eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
-{
- if (_eglIndexConfig(conf, attr) < 0)
- return EGL_FALSE;
-
- /* there are some holes in the range */
- switch (attr) {
- case 0x3030 /* a gap before EGL_SAMPLES */:
- case EGL_NONE:
-#ifdef EGL_VERSION_1_4
- case EGL_MATCH_NATIVE_PIXMAP:
-#endif
- return EGL_FALSE;
- default:
- break;
- }
-
- return EGL_TRUE;
-}
-
-
/**
* Fallback for eglGetConfigAttrib.
*/