summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-07-28 10:58:46 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-07-28 11:45:59 (GMT)
commit7eba68adc4a7862d9474179592e5c8393a7acdbb (patch)
tree73014cabc8b10f46203844aeb40de574d97032dc /src/opengl
parenta20f8dcbeafa34b50ef69d1c5db0f17b09731d2a (diff)
parent3bf3981c7026de9017887d08312391b54fe8afc6 (diff)
downloadQt-7eba68adc4a7862d9474179592e5c8393a7acdbb.zip
Qt-7eba68adc4a7862d9474179592e5c8393a7acdbb.tar.gz
Qt-7eba68adc4a7862d9474179592e5c8393a7acdbb.tar.bz2
Merge commit 'qt/master-stable'
Conflicts: configure.exe src/corelib/io/io.pri src/corelib/io/qfilesystemwatcher.cpp tests/auto/qfileinfo/tst_qfileinfo.cpp tools/configure/configureapp.cpp
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl_x11.cpp2
-rw-r--r--src/opengl/qgl_x11egl.cpp23
2 files changed, 22 insertions, 3 deletions
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 43bdec7..a95b7a0 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1648,11 +1648,13 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmap *pm, const qi
void QGLTexture::deleteBoundPixmap()
{
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
if (boundPixmap) {
glXReleaseTexImageEXT(QX11Info::display(), boundPixmap, GLX_FRONT_LEFT_EXT);
glXDestroyPixmap(QX11Info::display(), boundPixmap);
boundPixmap = 0;
}
+#endif
}
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 99b026d..c6904fe 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -258,7 +258,8 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext,
// If the application has set WA_TranslucentBackground and not explicitly set
// the alpha buffer size to zero, modify the format so it have an alpha channel
QGLFormat& fmt = d->glcx->d_func()->glFormat;
- if (testAttribute(Qt::WA_TranslucentBackground) && fmt.alphaBufferSize() == -1)
+ const bool useArgbVisual = testAttribute(Qt::WA_TranslucentBackground);
+ if (useArgbVisual && fmt.alphaBufferSize() == -1)
fmt.setAlphaBufferSize(1);
bool createFailed = false;
@@ -297,8 +298,24 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext,
int matchingCount = 0;
chosenVisualInfo = XGetVisualInfo(x11Info().display(), VisualIDMask, &vi, &matchingCount);
if (chosenVisualInfo) {
- qDebug("Using X Visual ID (%d) provided by EGL", (int)vi.visualid);
- vi = *chosenVisualInfo;
+ if (useArgbVisual) {
+ // Check to make sure the visual provided by EGL is ARGB
+ XRenderPictFormat *format;
+ format = XRenderFindVisualFormat(x11Info().display(), chosenVisualInfo->visual);
+ if (format->type == PictTypeDirect && format->direct.alphaMask) {
+ qDebug("Using opaque X Visual ID (%d) provided by EGL", (int)vi.visualid);
+ vi = *chosenVisualInfo;
+ }
+ else {
+ qWarning("Warning: EGL suggested using X visual ID %d for config %d, but this is not ARGB",
+ nativeVisualId, (int)qeglCtx->config());
+ vi.visualid = 0;
+ }
+ }
+ else {
+ qDebug("Using opaque X Visual ID (%d) provided by EGL", (int)vi.visualid);
+ vi = *chosenVisualInfo;
+ }
XFree(chosenVisualInfo);
}
else {