summaryrefslogtreecommitdiffstats
path: root/src/gui/egl
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-15 07:05:31 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-15 07:05:31 (GMT)
commit9672bec709bb8ee3d35dcd889b218708e4804c55 (patch)
treeb653a221baa1a3801c77faab08ebc712bdb7d866 /src/gui/egl
parent8a37a69c961092aae7dd7f55f30a15b3fae1b7cc (diff)
downloadQt-9672bec709bb8ee3d35dcd889b218708e4804c55.zip
Qt-9672bec709bb8ee3d35dcd889b218708e4804c55.tar.gz
Qt-9672bec709bb8ee3d35dcd889b218708e4804c55.tar.bz2
Make EGL surface transparency working on Symbian.
When the hardware is capable enough, setting WA_TranslucentBackground will not lead to falling back to raster, but will continue using OpenVG or OpenGL based rendering. However this needs an alpha channel which was not requested previously. This patch corrects it. Task-number: QT-4729 Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/gui/egl')
-rw-r--r--src/gui/egl/qegl_symbian.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/egl/qegl_symbian.cpp b/src/gui/egl/qegl_symbian.cpp
index 6533d11..fabf9d1 100644
--- a/src/gui/egl/qegl_symbian.cpp
+++ b/src/gui/egl/qegl_symbian.cpp
@@ -42,6 +42,7 @@
#include <QtGui/qpaintdevice.h>
#include <QtGui/qpixmap.h>
#include <QtGui/qwidget.h>
+#include <QtGui/private/qapplication_p.h>
#include "qegl_p.h"
#include "qeglcontext_p.h"
@@ -73,10 +74,14 @@ void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev)
return;
int devType = dev->devType();
- if (devType == QInternal::Image)
+ if (devType == QInternal::Image) {
setPixelFormat(static_cast<QImage *>(dev)->format());
- else
- setPixelFormat(QImage::Format_RGB32);
+ } else {
+ QImage::Format format = QImage::Format_RGB32;
+ if (QApplicationPrivate::instance() && QApplicationPrivate::instance()->useTranslucentEGLSurfaces)
+ format = QImage::Format_ARGB32_Premultiplied;
+ setPixelFormat(format);
+ }
}