egl: return EGL config when r/g/b sizes are not set

The check is already done for alpha. Do a similar check for
r/g/b sizes.

The problem was discovered because the default scenegraph context
in QSGContext::defaultSurfaceFormat does not have r/g/b set.

Change-Id: I2f529c9d5cc7dbc61a27722336e8099e7be08965
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
This commit is contained in:
Girish Ramakrishnan 2012-06-13 15:15:12 -07:00 committed by Qt by Nokia
parent d40ab8b9f5
commit cb97d846e2

View File

@ -256,11 +256,10 @@ EGLConfig q_configFromGLFormat(EGLDisplay display, const QSurfaceFormat &format,
eglGetConfigAttrib(display, configs[index], EGL_GREEN_SIZE, &green);
eglGetConfigAttrib(display, configs[index], EGL_BLUE_SIZE, &blue);
eglGetConfigAttrib(display, configs[index], EGL_ALPHA_SIZE, &alpha);
if (red == confAttrRed &&
green == confAttrGreen &&
blue == confAttrBlue &&
(confAttrAlpha == 0 ||
alpha == confAttrAlpha)) {
if ((confAttrRed == 0 || red == confAttrRed) &&
(confAttrGreen == 0 || green == confAttrGreen) &&
(confAttrBlue == 0 || blue == confAttrBlue) &&
(confAttrAlpha == 0 || alpha == confAttrAlpha)) {
cfg = configs[index];
delete [] configs;
return cfg;