summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglpixelbuffer_egl.cpp
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-10-09 11:35:16 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-10-09 11:35:16 (GMT)
commit6a5be55e5f96758daeca44899bc8598c76c214e7 (patch)
tree84d1c808bd491a29bbd265e515563ef79dbc3213 /src/opengl/qglpixelbuffer_egl.cpp
parentb8eb2784a1c1a9812d09fca7c8722624f12dbd1c (diff)
parent2caa16ff98348b043ecc3598e5b9af4a2e2ae3bc (diff)
downloadQt-6a5be55e5f96758daeca44899bc8598c76c214e7.zip
Qt-6a5be55e5f96758daeca44899bc8598c76c214e7.tar.gz
Qt-6a5be55e5f96758daeca44899bc8598c76c214e7.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/opengl/qglpixelbuffer_egl.cpp')
-rw-r--r--src/opengl/qglpixelbuffer_egl.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/opengl/qglpixelbuffer_egl.cpp b/src/opengl/qglpixelbuffer_egl.cpp
index 4cba1bb..744fbd4 100644
--- a/src/opengl/qglpixelbuffer_egl.cpp
+++ b/src/opengl/qglpixelbuffer_egl.cpp
@@ -151,7 +151,7 @@ bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidge
bool QGLPixelBufferPrivate::cleanup()
{
- eglDestroySurface(QEglContext::defaultDisplay(0), pbuf);
+ // No need to destroy "pbuf" here - it is done in QGLContext::reset().
return true;
}
@@ -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);
+ 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