summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_x11egl.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-02-12 14:50:49 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-02-12 16:03:16 (GMT)
commitaf1f28a0d78deee31c5df0d7d042ae7671c8c34c (patch)
treee42d9effcddda6289afbeb4d9817db68467ce308 /src/opengl/qgl_x11egl.cpp
parent040151b51780084f3a2b764bab7e2359677eb0b1 (diff)
downloadQt-af1f28a0d78deee31c5df0d7d042ae7671c8c34c.zip
Qt-af1f28a0d78deee31c5df0d7d042ae7671c8c34c.tar.gz
Qt-af1f28a0d78deee31c5df0d7d042ae7671c8c34c.tar.bz2
Cleanup QEglContext & EGLDisplays
This basicaly replaces display(), openDisplay() & defaultDisplay() methods with a single display() and nativeDisplay(), the latter being implemented in the platform-specific files and everything else being cross-platform code. Reviewed-By: Trond
Diffstat (limited to 'src/opengl/qgl_x11egl.cpp')
-rw-r--r--src/opengl/qgl_x11egl.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 572834b..3d183ee 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -190,11 +190,6 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
if (d->eglContext == 0) {
d->eglContext = new QEglContext();
d->eglContext->setApi(QEgl::OpenGL);
- if (!d->eglContext->openDisplay(device())) {
- delete d->eglContext;
- d->eglContext = 0;
- return false;
- }
// Construct the configuration we need for this surface.
QEglProperties configProps;
@@ -614,7 +609,7 @@ EGLConfig Q_OPENGL_EXPORT qt_chooseEGLConfigForPixmap(bool hasAlpha, bool readOn
EGLint configCount = 0;
do {
- eglChooseConfig(QEglContext::defaultDisplay(0), configAttribs.properties(), targetConfig, 1, &configCount);
+ eglChooseConfig(QEglContext::display(), configAttribs.properties(), targetConfig, 1, &configCount);
if (configCount > 0) {
// Got one
qDebug() << "Found an" << (hasAlpha ? "ARGB" : "RGB") << (readOnly ? "readonly" : "target" )
@@ -653,7 +648,7 @@ bool Q_OPENGL_EXPORT qt_createEGLSurfaceForPixmap(QPixmapData* pmd, bool readOnl
pixmapAttribs.setValue(EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB);
EGLSurface pixmapSurface;
- pixmapSurface = eglCreatePixmapSurface(QEglContext::defaultDisplay(0),
+ pixmapSurface = eglCreatePixmapSurface(QEglContext::display(),
pixmapConfig,
(EGLNativePixmapType) pixmapData->handle(),
pixmapAttribs.properties());
@@ -762,7 +757,7 @@ void QGLContextPrivate::destroyGlSurfaceForPixmap(QPixmapData* pmd)
QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pmd);
if (pixmapData->gl_surface) {
EGLBoolean success;
- success = eglDestroySurface(QEglContext::defaultDisplay(0), (EGLSurface)pixmapData->gl_surface);
+ success = eglDestroySurface(QEglContext::display(), (EGLSurface)pixmapData->gl_surface);
if (success == EGL_FALSE) {
qWarning() << "destroyGlSurfaceForPixmap() - Error deleting surface: "
<< QEglContext::errorString(eglGetError());
@@ -777,7 +772,7 @@ void QGLContextPrivate::unbindPixmapFromTexture(QPixmapData* pmd)
QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pmd);
if (pixmapData->gl_surface) {
EGLBoolean success;
- success = eglReleaseTexImage(QEglContext::defaultDisplay(0),
+ success = eglReleaseTexImage(QEglContext::display(),
(EGLSurface)pixmapData->gl_surface,
EGL_BACK_BUFFER);
if (success == EGL_FALSE) {