summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-10-09 13:19:36 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-10-09 13:20:01 +1000
commit73d9dced8298dfad7bc72607146e81e96fffb6d4 (patch)
tree41c2253175851547e5da64f4d530e18c10913d0b /src
parent8ee6d090d45198fb2530849236c97f014666b7e4 (diff)
Suppress unnecessary warning messages if pbuffers are not supported
Reviewed-by: trustme
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qglpixelbuffer_egl.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/opengl/qglpixelbuffer_egl.cpp b/src/opengl/qglpixelbuffer_egl.cpp
index 2b5e2f5b1a..744fbd483d 100644
--- a/src/opengl/qglpixelbuffer_egl.cpp
+++ b/src/opengl/qglpixelbuffer_egl.cpp
@@ -202,13 +202,20 @@ GLuint QGLPixelBuffer::generateDynamicTexture() const
bool QGLPixelBuffer::hasOpenGLPbuffers()
{
// See if we have at least 1 configuration that matches the default format.
- QEglContext ctx;
- if (!ctx.openDisplay(0))
+ EGLDisplay dpy = QEglContext::defaultDisplay(0);
+ if (dpy == EGL_NO_DISPLAY)
return false;
QEglProperties configProps;
qt_egl_set_format(configProps, QInternal::Pbuffer, QGLFormat::defaultFormat());
configProps.setRenderableType(QEgl::OpenGL);
- return ctx.chooseConfig(configProps, QEgl::BestPixelFormat);
+ do {
+ EGLConfig cfg = 0;
+ EGLint matching = 0;
+ if (eglChooseConfig(dpy, configProps.properties(),
+ &cfg, 1, &matching) && matching > 0)
+ return true;
+ } while (configProps.reduceConfiguration());
+ return false;
}
QT_END_NAMESPACE