summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglpixelbuffer_egl.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-10-15 10:44:27 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-10-15 10:44:27 +1000
commit93eb7c1378d97978fbe415f532e341de0138f4fe (patch)
treee55ca788b049deb32bf16cdc2092769004f7774d /src/opengl/qglpixelbuffer_egl.cpp
parent252fa3d8fa159791a0762a3e02c1594a34a104af (diff)
Back-port several OpenGL/ES fixes from 4.6 to 4.5
8ee6d090d45198fb2530849236c97f014666b7e4: fix EGL_SAMPLES b125af1b298d694c332f56deebe4755d0c985d5d: memory leak of EGLSurface's ef8d9fa7091b0d45fe15aae43b8f1c47547cb16d: double-destroy of pbuffer 73d9dced8298dfad7bc72607146e81e96fffb6d4: suppress pbuffer warnings Reviewed-by: Donald Carr
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 b2f16c1390..fbe6c3601a 100644
--- a/src/opengl/qglpixelbuffer_egl.cpp
+++ b/src/opengl/qglpixelbuffer_egl.cpp
@@ -152,7 +152,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;
}
@@ -203,13 +203,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(QEglContext::OpenGL);
- return ctx.chooseConfig(configProps, QEglContext::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