diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-07-31 15:33:39 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-08-03 09:32:49 (GMT) |
commit | f9f91a3ce45bb3ae0d1e47337791eaf373a0e734 (patch) | |
tree | 6ca614f307c4051b2edc44bb7507075edef69fa3 | |
parent | fc34e1cbaeeaa54b15d28edfab16d5f302334f70 (diff) | |
download | Qt-f9f91a3ce45bb3ae0d1e47337791eaf373a0e734.zip Qt-f9f91a3ce45bb3ae0d1e47337791eaf373a0e734.tar.gz Qt-f9f91a3ce45bb3ae0d1e47337791eaf373a0e734.tar.bz2 |
Make QEglProperties::setVisualFormat() read alpha for visual
Reviewed-by: Trustme
-rw-r--r-- | src/gui/egl/qegl_x11.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp index be89efe..daaa4ba 100644 --- a/src/gui/egl/qegl_x11.cpp +++ b/src/gui/egl/qegl_x11.cpp @@ -125,7 +125,17 @@ void QEglProperties::setVisualFormat(const QX11Info *xinfo) setValue(EGL_RED_SIZE, countBits(visual->red_mask)); setValue(EGL_GREEN_SIZE, countBits(visual->green_mask)); setValue(EGL_BLUE_SIZE, countBits(visual->blue_mask)); - setValue(EGL_ALPHA_SIZE, 0); // XXX + + EGLint alphaBits = 0; +#if !defined(QT_NO_XRENDER) + XRenderPictFormat *format; + format = XRenderFindVisualFormat(xinfo->display(), visual); + if (format && (format->type == PictTypeDirect) && format->direct.alphaMask) { + alphaBits = countBits(format->direct.alphaMask); + qDebug("QEglProperties::setVisualFormat() - visual's alphaMask is %d", alphaBits); + } +#endif + setValue(EGL_ALPHA_SIZE, alphaBits); } extern const QX11Info *qt_x11Info(const QPaintDevice *pd); |