summaryrefslogtreecommitdiff
path: root/src/opengl/qgl_egl.cpp
diff options
context:
space:
mode:
authorJani Hautakangas <jani.hautakangas@nokia.com>2011-12-09 14:40:29 +0200
committerJani Hautakangas <jani.hautakangas@nokia.com>2011-12-09 17:13:59 +0200
commit54613aec3bdac668d198923814873a9e622ad675 (patch)
tree0ea1e26e8199900e6f314242653ceb0bb4ec63a6 /src/opengl/qgl_egl.cpp
parent5fbd3e1aacf789cc46fef57d8726333ee8a00e03 (diff)
downloadqt4-tools-54613aec3bdac668d198923814873a9e622ad675.tar.gz
Fix window surface config on OpenGL graphics system.
QtOpenGL uses 16-bit configs by default but on Symbian it should use 32-bit config. Task-number: QTBUG-23082 Task-number: ou1cimx1#951223 Reviewed-by: Murray Read
Diffstat (limited to 'src/opengl/qgl_egl.cpp')
-rw-r--r--src/opengl/qgl_egl.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index 0b963503c5..21047d7dda 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -64,6 +64,25 @@ void qt_eglproperties_set_glformat(QEglProperties& eglProperties, const QGLForma
int stencilSize = glFormat.stencilBufferSize();
int sampleCount = glFormat.samples();
+#ifdef Q_OS_SYMBIAN
+ // on Symbian we prefer 32-bit configs
+ if (glFormat.alpha() && alphaSize <= 0)
+ alphaSize = 8;
+ if (glFormat.depth() && depthSize <= 0)
+ depthSize = 24;
+ if (glFormat.stencil() && stencilSize <= 0)
+ stencilSize = 8;
+ if (glFormat.sampleBuffers() && sampleCount <= 0)
+ sampleCount = 1;
+
+ redSize = redSize > 0 ? redSize : 8;
+ greenSize = greenSize > 0 ? greenSize : 8;
+ blueSize = blueSize > 0 ? blueSize : 8;
+ alphaSize = alphaSize > 0 ? alphaSize : 8;
+ depthSize = depthSize > 0 ? depthSize : 24;
+ stencilSize = stencilSize > 0 ? stencilSize : 8;
+ sampleCount = sampleCount > 0 ? sampleCount : 4;
+#else
// QGLFormat uses a magic value of -1 to indicate "don't care", even when a buffer of that
// type has been requested. So we must check QGLFormat's booleans too if size is -1:
if (glFormat.alpha() && alphaSize <= 0)
@@ -101,6 +120,7 @@ void qt_eglproperties_set_glformat(QEglProperties& eglProperties, const QGLForma
depthSize = depthSize > 0 ? depthSize : 0;
stencilSize = stencilSize > 0 ? stencilSize : 0;
sampleCount = sampleCount > 0 ? sampleCount : 0;
+#endif
eglProperties.setValue(EGL_RED_SIZE, redSize);
eglProperties.setValue(EGL_GREEN_SIZE, greenSize);