summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience/qeglconvenience.cpp
diff options
context:
space:
mode:
authorGirish Ramakrishnan <girish.1.ramakrishnan@nokia.com>2012-06-13 15:15:12 -0700
committerQt by Nokia <qt-info@nokia.com>2012-06-14 10:07:23 +0200
commitcb97d846e2c50718ca5795dac4c3111e4136e479 (patch)
tree44ee4721852693c706386e03f77d7d1a2bcfc02c /src/platformsupport/eglconvenience/qeglconvenience.cpp
parentd40ab8b9f562c993c863f6f0ccc798ced04a2c6c (diff)
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>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglconvenience.cpp')
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp
index 32c7a44730..8cfa8cf4c4 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience.cpp
+++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp
@@ -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;